Home |
RTTarget-32 Programming Manual Function RTBootRM and RTBootPM System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTBootRM and RTBootPMThese functions allow one program to boot into another previously loaded program. They are similar to RTRunProgram, but the newly loaded program overlays the loading program and it cannot return to its loader: void RTBootRM(WORD BootVectorSegment, WORD BootVectorOffset); void RTBootPM(void * BootVectorAddress); RTBootRM switches to real mode and then transfers control to the 16:16 real mode address BootVectorSegment:BootVectorOffset. RTBootPM merely disabled paging but stays in protected mode before invoking the new program. The function's parameters are the physical addresses of the boot vector of the child application. Both functions completely recreate the software environment of the target (TSS, GTD, LDT, page table, etc) and begin execution at the given addresses just like after power-on or reset. However, the hardware initialization of the target is not lost. RTBootRM expects a real mode address as its parameter. For children built with RTTarget-32, parameter BootVectorSegment must be bits 19 .. 16 of the physical address of the boot vector shifted right by 4 bits. Parameter BootVectorOffset must be the low 16 bits of the physical address of the boot vector. Example (assuming the boot vector has been located to the very start of section ChildImage): DWORD BootVectorAddress = LoadBinFile("child.bin", "ChildImage"); RTBootRM((BootVectorAddress & 0x0F0000) >> 4, BootVectorAddress & 0x0FFFF); All of the child's data must have been loaded at the correct addresses on the target before these functions can be called. These functions never return. The child is booted and will overwrite the parent in memory. The child must include a boot vector, boot code, and boot data just like a self-booting application. A disk buffer is not required but does no harm. RTBootRM supports boot codes BOOT.EXE and BIOSBOOT.EXE, while RTBootPM supports PMBOOT.EXE. RTBootRM requires the boot vector and boot code to reside below 1M. To use RTBootRM or RTBootPM:
It is not possible to debug a child started with RTBootRM/RTBootPM using the cross debugger. Demo program FTPLoader demonstrates function RTBootPM.
|