diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-08-27 23:10:04 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-08-27 23:10:04 +0200 |
| commit | 7aea8d20ec8816759c8439fc39d90579fc37e18b (patch) | |
| tree | f59d354ea1ad128929e0e810da0fa78bab00537b /kernel/pci.c | |
| parent | d680d4c641c085e7a31d19fe2d01f528e96d2ced (diff) | |
cleanup and switched logging to vesa mode console!
Diffstat (limited to 'kernel/pci.c')
| -rw-r--r-- | kernel/pci.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/kernel/pci.c b/kernel/pci.c index 8aa5eb9..c8bd95d 100644 --- a/kernel/pci.c +++ b/kernel/pci.c @@ -1,5 +1,7 @@ #include "kernel.h" #include "x86.h" +#include "../lib/logger/log.h" // logger facilities +#define FOOLOS_MODULE_NAME "pci" #define PCI_CONFIG_DATA 0xCFC #define PCI_CONFIG_ADDRESS 0xCF8 @@ -61,23 +63,8 @@ void test_bar(uint8_t bus, uint8_t slot, uint8_t offset) // restore original values pciConfigSet(bus,slot,0,offset,(bar_high<<16)+bar_low); - scr_put_string("e1000: BAR: "); - if(bar_low& 1)scr_put_string("i/o "); - else scr_put_string("mem "); - - - scr_put_hex(bar_high); - scr_put_hex(bar_low); - - scr_put_string(" size: "); - - scr_put_hex(size_high); - scr_put_hex(size_low); - scr_put_string(" => "); - scr_put_hex32(size); - - - scr_put_string_nl(";"); + + log("e1000",FOOLOS_LOG_INFO,"%s bar: (0x%x 0x%x) size: 0x%x" ,bar_low&1?"i/o":"mem",bar_high, bar_low, size); } @@ -91,11 +78,7 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) if ((vendor = pciConfigReadWord(bus,slot,0,0)) != 0xFFFF) { device = pciConfigReadWord(bus,slot,0,2); - scr_put_string("pci: "); - scr_put_hex(vendor); - scr_put_hex(device); - scr_put_string_nl(";"); - + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"[%d,%d]: vendor: 0x%x / device: 0x%x",bus,slot,vendor,device); // check for: E1000 (82540EM). PCI Ethernet Controller if(vendor==0x8086&&device==0x100e) @@ -126,7 +109,7 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) void pci_init() { - scr_put_string_nl("pci: scanning pci bus"); + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"scanning bus"); // todo: recurse on pci to pci bridges! // todo: support multiple pci host controllers! // (check more funcitons of device 0:0) |
