Getting the base IO address
Getting the base IO address
I've begun my os project for almost a year, and now it can run in user mode. But I recently got a puzzle, I found some code for reading the device port uses a mov instruction to change the memory. So that is called IO map. Who could tell me how to get those base addresses? Such as the base IO address of rtl8139 or usb.
-
- Member
- Posts: 33
- Joined: Wed Apr 26, 2006 11:00 pm
each PCI device has it's own 256byte size configuration space which you can read. Memory/IO addresses are named BARn (eg. BAR0 BAR1...). Read PCI related stuff, you just need to encode location of device(bus, device, function) send it to PCI and then send or read data to/from it, i have my own PCI minidriver with enumeration, if you want it i can post
hi, now i have completed my PCI Driver, it can runs well now, and it can enumerate the pci devices on the machine. Yes, i also get some base address(memory&io space). But, i wonder how to use these base memories ?
At the moment, can i use a mov instruction to change those registers on the pci devices?
At the moment, can i use a mov instruction to change those registers on the pci devices?