Currently I am working on the pci bus. I am aware that usng the wrong configuation method may cause the computer to freez or reset. so im am calling the pci bios to determin which configuration method to use.
I have scaned the paragraph bouneries and located the bios 32 entry point and called it. This returns without error.
Then I create a code segment with the base specified and called the code at the offset specifed by the bios 32 unsing the followig method.
NASM syntax:
Code: Select all
global _call_pci_bios32
_call_pci_bios32:
push edi
mov eax, 0xB101
mov edi, 0
call dword far [bioscall]
pop edi
ret
bioscall:
dd 0 ;filled in after call to bios32
dw 0x20 ;selector for pcibios code in gdt
The system calls a GPF after the call.
the Register dump shows that the pci bios has completed i.e. the register contain the expected values.
the error occours in both bochs and qemu
bochs prints the error: load segment register valid bit cleared.
Thankyou.
Edward.