Questions about PCI configuration space register writing
-
- Member
- Posts: 46
- Joined: Mon Sep 07, 2020 5:50 pm
Questions about PCI configuration space register writing
I've been working on adding a pci driver to my OS, and I've been following the guide here https://wiki.osdev.org/PCI, and I don't see anywhere in the guide where it says how to write to one of these registers? My guess is that you'd write to the config address register and then write to the config data register, but I'm not sure, and I don't know where to find the information on how to write to one of these registers.
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: Questions about PCI configuration space register writing
If I understand you correctly, you are correct.abstractmath wrote:My guess is that you'd write to the config address register and then write to the config data register
Writing a PCI register is very similar to reading it.
For reading it you do:
Code: Select all
outl(0xCF8,pci_address);
inl(0xCFC);
Code: Select all
outl(0xCF8,pci_address);
outl(0xCFC,value_to_write);
(Here's my code for writing a PCI byte)
My OS: TritiumOS
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?