gbowne1 / ClassicOS

An x86 32 biit Operating System for 386, 486, Pentium class (P-60 to 233MHz, Pentium II, P3, P4, etc)
GNU General Public License v3.0
4 stars 1 forks source link

Fix PCI bus driver pci.c #32

Open gbowne1 opened 8 months ago

gbowne1 commented 8 months ago

The PCI bus driver is incomplete and has a bunch of unused variables.

/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c: In function ‘pci_detect_devices’:
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:43:30: warning: unused variable ‘bar5’ [-Wunused-variable]
                     uint32_t bar5 = pci_read(bus, device, function, 0x24);
                              ^~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:42:30: warning: unused variable ‘bar4’ [-Wunused-variable]
                     uint32_t bar4 = pci_read(bus, device, function, 0x20);
                              ^~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:41:30: warning: unused variable ‘bar3’ [-Wunused-variable]
                     uint32_t bar3 = pci_read(bus, device, function, 0x1C);
                              ^~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:40:30: warning: unused variable ‘bar2’ [-Wunused-variable]
                     uint32_t bar2 = pci_read(bus, device, function, 0x18);
                              ^~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:39:30: warning: unused variable ‘bar1’ [-Wunused-variable]
                     uint32_t bar1 = pci_read(bus, device, function, 0x14);
                              ^~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:38:30: warning: unused variable ‘bar0’ [-Wunused-variable]
                     uint32_t bar0 = pci_read(bus, device, function, 0x10);
                              ^~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:37:29: warning: unused variable ‘irq_line’ [-Wunused-variable]
                     uint8_t irq_line = pci_read(bus, device, function, 0x3C);
                             ^~~~~~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:36:29: warning: unused variable ‘header_type’ [-Wunused-variable]
                     uint8_t header_type = pci_read(bus, device, function, 0x0E);
                             ^~~~~~~~~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:35:29: warning: unused variable ‘prog_if’ [-Wunused-variable]
                     uint8_t prog_if = pci_read(bus, device, function, 0x09);
                             ^~~~~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:34:29: warning: unused variable ‘subclass_code’ [-Wunused-variable]
                     uint8_t subclass_code = pci_read(bus, device, function, 0x0A);
                             ^~~~~~~~~~~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:33:29: warning: unused variable ‘class_code’ [-Wunused-variable]
                     uint8_t class_code = pci_read(bus, device, function, 0x0B);
                             ^~~~~~~~~~
/home/gbowne1/Documents/ClassicOS/src/drivers/bus/pci.c:32:30: warning: unused variable ‘device_id’ [-Wunused-variable]
                     uint16_t device_id = pci_read(bus, device, function, 0x02);
                              ^~~~~~~~~
gbowne1 commented 8 months ago

References you can use:

https://wiki.osdev.org/PCI https://wiki.osdev.org/User:Intx13 https://wiki.osdev.org/Category:PCI https://en.wikipedia.org/wiki/PCI_configuration_space https://wiki.osdev.org/Detecting_Hardware https://forum.osdev.org/viewtopic.php?f=1&t=36972 https://tldp.org/LDP/tlk/dd/pci.html https://wiki.osdev.org/Pci#Enumerating_PCI_Buses https://wiki.osdev.org/PCI_Local_Bus_Signals

https://www.youtube.com/watch?v=qhIHu8mFrdg https://ics.uci.edu/~harris/ics216/pci/PCI_22.pdf https://en.wikipedia.org/wiki/Peripheral_Component_Interconnect

gbowne1 commented 8 months ago

This might be better as pci.asm?