block 46 Code

north bridge empty macro
4! ef 1, drop ; forth dev -2147424256
nb 80000000 dev ! ;
agp 80000800 dev ! ;
sb 80003800 dev ! ;
usb 8000e800 dev ! ;
graphic 3000000 device dev ! ;
ether 2000000 device dev ! ;
devs 80020000 65 for dup pci dup 1 + drop if dup h. space drop dup 8 + pci dup h. space over h. cr then drop fffff800 + next drop ;
k show black screen text devs keyboard ;
regs dev @ 19 4 * + 20 for dup pci h. space dup h. cr -4 + next drop ;
ok show black screen text regs keyboard ;
u 40 dev +! ;
d -64 dev +! ;
pci! na pci drop 4! ; ok k shows all pci devices while ok shows pci registers


block 47 Comments

4! nb store 4-byte word in byte address
dev -a current device configuration address
nb select north bridge as device
agp select agp bus
sb select south bridge
graphic locate graphic accelerator. starts with agp - bus 1, dev 0, - searches down. defaults to dev 2
ether locate ethernet controller
devs display device/vendor and class for each installed device
k start devices display
regs display configuration registers of current device
ok start register display
u move up in register space
d move down
pci! na store into configuration register. be carefull