/* Set the function ID */
mov bx, FNID_Reboot
- /* Switch to real mode (We don't return) */
+ /* Switch to real mode (we don't return) */
jmp SwitchToReal
+/*
+ * VOID __cdecl ChainLoadBiosBootSectorCode(
+ * IN UCHAR BootDrive OPTIONAL,
+ * IN ULONG BootPartition OPTIONAL);
+ *
+ * RETURNS: Nothing
+ */
+PUBLIC ChainLoadBiosBootSectorCode
+ChainLoadBiosBootSectorCode:
+ /* Set the boot drive */
+ mov dl, [esp + 4]
+ test dl, dl
+ jnz set_part
+ mov dl, byte ptr [FrldrBootDrive]
+
+ /* Set the boot partition */
+set_part:
+ mov eax, [esp + 8]
+ test eax, eax
+ jnz continue
+ mov eax, dword ptr [FrldrBootPartition]
+continue:
+ /* Store the 1-byte truncated partition number in DH */
+ mov dh, al
+
+ /* Set the function ID */
+ mov bx, FNID_ChainLoadBiosBootSectorCode
+
+ /* Switch to real mode (we don't return) */
+ jmp SwitchToReal
+
+
+PUBLIC PxeCallApi
+PxeCallApi:
+ xor eax, eax
+ ret
+
+
/* Internal function for realmode calls
* bx must be set to the ID of the realmode function to call. */
PUBLIC CallRealMode
/////////////////////////////////////////
- /* 64-bit stack pointer */
-stack64:
- .quad STACKADDR
-
-PUBLIC FrldrBootDrive
-FrldrBootDrive:
- .byte 0
-
-PUBLIC FrldrBootPartition
-FrldrBootPartition:
- .long 0
-
-PUBLIC PxeCallApi
-PxeCallApi:
- xor eax, eax
- ret
-
//void __lgdt(void *Source);
PUBLIC __lgdt
__lgdt:
ret
+ /* 64-bit stack pointer */
+stack64:
+ .quad STACKADDR
+
+PUBLIC FrldrBootDrive
+FrldrBootDrive:
+ .byte 0
+
+PUBLIC FrldrBootPartition
+FrldrBootPartition:
+ .long 0
+
END