Copy the startup code and OS image into RAM and prepare it for execution
int image_setup (unsigned long address)
int image_setup_2 (unsigned long address)
int image_setup_ext (unsigned long address)
The image_setup() function prepares an image for execution. It copies the startup code from ROM into RAM where it can execute. It takes the image's address in ROM as its parameter, and always returns 0.
This function:
Copies the startup header from the OS image to a startup_header structure.
This copy is necessary to ensure that the correct header information is in the structure, because image_scan() may find multiple images, and may return without updating the header structure with the data for the image which will be passed to image_setup().
Fills in the imagefs_paddr structure member, based on where the image is stored.
The startup program doesn't necessarily know where the bootable image is stored, so it relies on the value in imagefs_paddr correctly specifiying the final location in RAM to where the OS image filesystem must be copied.
The image_setup_ext() function is an extension version of image_setup(). It operates in a 16-bit real-mode environment and makes use of the int15_copy() function to perform its tasks on the OS image. Use the image_setup_ext() function for an x86 system with a BIOS. This function copies the startup code to memory from where it is stored using an industry-standard BIOS routine.