Updated: October 28, 2024 |
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)
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.