Page 1 of 1

PCI detection in bochs

Posted: Mon Jul 28, 2003 10:18 pm
by Slasher
hi,
I'm adding PCI support to the kernel i'm working on.
here's the asm code i use to detect the PCI bios

Code: Select all

.....

_find_pci_bios:
                push ebp
                mov ebp,esp

                mov ebx,dword [ebp+8]
                mov [ptr32],dword ebx
                mov [ptr16],word KERNEL_CODE_SEL
                        
                mov eax,0x49435024    ;$PCI string needed for                    
                mov ebx,0                      ;bios32 function call 
                
                call far [ptr32]

                pop ebp
                ret


[section .data]

ptr32     dd 0
ptr16     KERNEL_CODE_SEL

I'm using the info in the PCI 2.0 spec docs.
[ebp+8] is the address of Bios32 service directory
According to the doc, on return from the far call
if AL = 00h then PCI bios is available
if AL = 80h then PCI bios is NOT available.
Using this fucntion, I get AL=80h in Bochs (but AL=00h on REAL pc) but the bochs spec state that Bios32 and PIC bios are supported.
has anyone tried detection PCI bios in bochs and how did you do it. Thanks

Re:PCI detection in bochs

Posted: Mon Jul 28, 2003 10:49 pm
by bkilgore
I don't know what compile options were turned on in your build, but did you try compiling with the --enable-pci option?

Also, you need the following option in your configuration file to enable emulation of the i440fx pci chipset:

Code: Select all

i440fxsupport: enabled=1
Hope that helps.

- Brandon