PCI BIOS 32

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ed_tait

PCI BIOS 32

Post by ed_tait »

Hello.

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.
Kemp

Re:PCI BIOS 32

Post by Kemp »

When I see

Code: Select all

call dword far [bioscall]
and

Code: Select all

bioscall:
dd 0
I immediately think "Null pointer". Do you change the value of that variable before jumping to address 0?
ed_tait

Re:PCI BIOS 32

Post by ed_tait »

Oops.

sorry. It's not a null pointer. I do set it up but i call some code that magled the contents of the register containing the entry point before I put it I place. all fixed now.

Thankyou.

Ed.
Post Reply