Thursday, August 19, 2004
Device Scan Successful
Intel 440BX/ZX AGPset Host Bridge [82443BX/ZX]
Intel 440BX/ZX AGPset PCI-to-PCI bridge [82443BX/ZX]
ESS Technology Solo-1 PCI AudioDrive family [ES1938/41/46]
Agere Systems LT Winmodem 56K [1456VQH19R-1(INT)]
Intel PIIX4/4E/4M ISA Bridge [82371AB/EB/MB]
Intel PIIX4/4E/4M IDE Controller [82371AB/EB/MB]
Intel PIIX4/4E/4M USB Interface [82371AB/EB/MB]
Intel PIIX4/4E/4M Power Management Controller [82371AB/EB/MB]
O2Micro CardBus Controller [OZ6832/3]
O2Micro CardBus Controller [OZ6832/3]
ATI Technologies Rage P/M Mobility AGP 2x [01541014]
I think I'll write the intel drivers first since they hook up to core services.
Here is the source code for reference:
bits 16
org 7C00h
pci_scan
mov ax,cs
mov ds,ax
mov ax,0B800h
mov es,ax
xor di,di
mov dx,0CF8h
mov eax,80000000h
mov ebx,eax
out dx,eax
in eax,dx
cmp eax,ebx
jne .error
.again mov eax,ebx
out dx,eax
add dx,4
in eax,dx
sub dx,4
cmp eax,-1
je .no_dev
call print_dev
.no_dev
test ebx,700h
jnz .next
mov eax,ebx
mov al,0Ch
out dx,eax
add dx,6
in al,dx
sub dx,6
test al,80h
jnz .next
add ebx,800h
.fin cmp ebx,80080000h
je .done
jmp short .again
.next add ebx,100h
jmp short .fin
.done mov si,.dn_msg
mov cx,(.dn_msg_end-.dn_msg) / 2
rep movsw
jmp short .halt
.error mov si,.err_msg
mov cx,(.err_msg_end-.err_msg) / 2
rep movsw
.halt jmp short .halt
.dn_msg db 'D',7,'O',7,'N',7,'E',7
.dn_msg_end
.err_msg db 'N',7,'O',7,' ',7,'P',7,'C',7,'I',7
.err_msg_end
print_dev
mov ecx,eax
mov eax,ebx
bswap eax
mov al,ah
call print_al
mov ax,073Ah
stosw
shr eax,16
push ax
shr al,3
call print_al
mov ax,073Ah
stosw
pop ax
and al,7
call print_al
mov ax,072Dh
stosw
mov eax,ecx
xchg al,ah
call print_al
mov al,ah
call print_al
mov ax,073Ah
stosw
shr eax,16
xchg al,ah
call print_al
mov al,ah
call print_al
add edi,160-18*2
ret
print_al push ax
push ax
shr al,4
add al,90h
daa
adc al,40h
daa
mov ah,7
stosw
pop ax
and al,0Fh
add al,90h
daa
adc al,40h
daa
mov ah,7
stosw
pop ax
ret
times $$+510-$ db 0
dw 0AA55h

