fixed the bugs, calling the pxe bios now works
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19621 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
#define REAL_MODE_STACK 0x9000
|
#define REAL_MODE_STACK 0x9000
|
||||||
// the location of the stack in real mode
|
// the location of the stack in real mode
|
||||||
|
|
||||||
#define SAVED_EAX 0x10000
|
#define SAVED_EAX 0x10014
|
||||||
// we're overwriting the start of our boot loader to hold some
|
// we're overwriting the start of our boot loader to hold some
|
||||||
// temporary values - the first 1024 bytes of it are used at
|
// temporary values - the first 1024 bytes of it are used at
|
||||||
// startup only, and we avoid some linking issues this way
|
// startup only, and we avoid some linking issues this way
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
/** uint16 call_pxe_bios(void *pxe, uint16 opcode, void *param)
|
/** uint16 call_pxe_bios(void *pxe, uint16 opcode, void *param)
|
||||||
* Does a call to the PXE BIOS functions in real mode.
|
* Does a call to the PXE BIOS functions in real mode.
|
||||||
* Both pxe and param must be as linear pointer in lower 1 MB,
|
* Both pxe and param must be as linear pointer into lower 1 MB,
|
||||||
* pxe is the pointer to the !PXE structure.
|
* pxe is the pointer to the !PXE structure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -44,9 +44,9 @@ FUNCTION(call_pxe_bios)
|
|||||||
lidt idt_descriptor
|
lidt idt_descriptor
|
||||||
|
|
||||||
// !PXE
|
// !PXE
|
||||||
movl 40(%esp), %eax
|
movl 40(%esp), %ebx
|
||||||
// entry point SEG:OFS
|
// make %ebx a pointer to entry point SEG:OFS
|
||||||
movl 0x10(%eax), %ebx
|
addl $0x10, %ebx
|
||||||
|
|
||||||
// opcode
|
// opcode
|
||||||
movl 44(%esp), %ecx
|
movl 44(%esp), %ecx
|
||||||
@@ -54,16 +54,17 @@ FUNCTION(call_pxe_bios)
|
|||||||
// param
|
// param
|
||||||
movl 48(%esp), %edx
|
movl 48(%esp), %edx
|
||||||
|
|
||||||
|
// enter real mode (clobbers %eax, %ds, %es, %fs, %gs, %ss, %sp)
|
||||||
call switch_to_real_mode
|
call switch_to_real_mode
|
||||||
|
|
||||||
.code16
|
.code16
|
||||||
|
|
||||||
// SEG param
|
// param (segment)
|
||||||
movl %edx, %eax
|
movl %edx, %eax
|
||||||
shrl $4, %eax
|
shrl $4, %eax
|
||||||
pushw %ax
|
pushw %ax
|
||||||
|
|
||||||
// OFS param
|
// param (offset)
|
||||||
andw $0xf, %dx
|
andw $0xf, %dx
|
||||||
pushw %dx
|
pushw %dx
|
||||||
|
|
||||||
@@ -71,16 +72,20 @@ FUNCTION(call_pxe_bios)
|
|||||||
pushw %cx
|
pushw %cx
|
||||||
|
|
||||||
// call PXE entry point
|
// call PXE entry point
|
||||||
call * %ebx
|
movl %ebx, %eax
|
||||||
|
shrl $4, %eax
|
||||||
|
movw %ax, %es
|
||||||
|
andw $0xf, %bx
|
||||||
|
lcall * %es:(%bx)
|
||||||
|
|
||||||
addw $6, %sp
|
addw $6, %sp
|
||||||
|
|
||||||
// save %ax from the call
|
// save %ax result
|
||||||
xorl %ebx, %ebx
|
xorl %ebx, %ebx
|
||||||
movw %ax, %bx
|
movw %ax, %bx
|
||||||
movl %ebx, (SAVED_EAX - 0x10000)
|
movl %ebx, (SAVED_EAX - 0x10000)
|
||||||
|
|
||||||
// back to protected mode
|
// back to protected mode (clobbers %eax)
|
||||||
call switch_to_protected_mode
|
call switch_to_protected_mode
|
||||||
.code32
|
.code32
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user