diff options
| author | Miguel <m.i@gmx.at> | 2018-08-22 16:35:12 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-22 16:35:12 +0200 |
| commit | 98bf7b67543b36b6fe49f2b68c115ebeaf630603 (patch) | |
| tree | aad818381dfc42c4158b923d588bbe8d34f51e51 /driver | |
| parent | 323fb9d3e09903d6fa43ef7e1f0cc8934414c8d4 (diff) | |
cleanup logging
Diffstat (limited to 'driver')
| -rw-r--r-- | driver/mouse.c | 7 | ||||
| -rw-r--r-- | driver/pci.c | 6 | ||||
| -rw-r--r-- | driver/vesa.c | 13 |
3 files changed, 14 insertions, 12 deletions
diff --git a/driver/mouse.c b/driver/mouse.c index f70393c..958cdc4 100644 --- a/driver/mouse.c +++ b/driver/mouse.c @@ -1,3 +1,4 @@ +#include "kernel/kernel.h" //http://forum.osdev.org/viewtopic.php?t=10247 @@ -97,11 +98,11 @@ void mouse_init() void mouse_log() { - //log(FOOLOS_MODULE_NAME,5,"%02x / %02x / %02x ",mouse_byte[0], mouse_byte[1],mouse_byte[2]); + //klog("%02x / %02x / %02x ",mouse_byte[0], mouse_byte[1],mouse_byte[2]); //TODO: ignore last packet for 4packets mouse and resync if you get out of sync if(mouse_byte[0]&0x80||mouse_byte[0]&0x40)return; //skip packet on overflow - if(!(mouse_byte[0]&0x8))panic(FOOLOS_MODULE_NAME,"mouse packets out of sync!?"); // this bit is always 1, otherwise panic! + if(!(mouse_byte[0]&0x8))kpanic("mouse packets out of sync!?"); // this bit is always 1, otherwise panic! // if(mouse_byte[1]>127){ @@ -126,7 +127,7 @@ void mouse_log() if(mouse_x>800)mouse_x=800; if(mouse_y>600)mouse_y=600; - //log(FOOLOS_MODULE_NAME,5,"%d / %d / %02x ",mouse_x, mouse_y,mouse_byte[2]); + //klog("%d / %d / %02x ",mouse_x, mouse_y,mouse_byte[2]); if (mouse_byte[0] & 1)vesa_put_rect(mouse_x,600-mouse_y,10,10,0x00ffff); //else vesa_put_rect(mouse_x,600-mouse_y,10,10,0x0000ff); PutFont('X', mouse_x,600-mouse_y, 0xff0000); diff --git a/driver/pci.c b/driver/pci.c index 48aaff9..4ea01d1 100644 --- a/driver/pci.c +++ b/driver/pci.c @@ -65,7 +65,7 @@ void test_bar(uint8_t bus, uint8_t slot, uint8_t offset) pciConfigSet(bus,slot,0,offset,(bar_high<<16)+bar_low); - log("e1000",5,"%s bar: (0x%x 0x%x) size: 0x%x" ,bar_low&1?"i/o":"mem",bar_high, bar_low, size); + klog("%s bar: (0x%x 0x%x) size: 0x%x" ,bar_low&1?"i/o":"mem",bar_high, bar_low, size); } @@ -79,7 +79,7 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) if ((vendor = pciConfigReadWord(bus,slot,0,0)) != 0xFFFF) { device = pciConfigReadWord(bus,slot,0,2); - log(FOOLOS_MODULE_NAME,5,"[%d,%d]: vendor: 0x%x / device: 0x%x",bus,slot,vendor,device); + klog("[%d,%d]: vendor: 0x%x / device: 0x%x",bus,slot,vendor,device); // check for: E1000 (82540EM). PCI Ethernet Controller if(vendor==0x8086&&device==0x100e) @@ -111,7 +111,7 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) void pci_init() { - log(FOOLOS_MODULE_NAME,5,"scanning bus"); + klog("scanning bus"); // todo: recurse on pci to pci bridges! // todo: support multiple pci host controllers! // (check more funcitons of device 0:0) diff --git a/driver/vesa.c b/driver/vesa.c index 06c9f6f..090596c 100644 --- a/driver/vesa.c +++ b/driver/vesa.c @@ -1,3 +1,4 @@ +#include "kernel/kernel.h" //http://wiki.osdev.org/GUI #include <stdarg.h> @@ -138,18 +139,18 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont) console_lines=24; // vesa info - log(FOOLOS_MODULE_NAME,5,"vbe version: 0x%x / video mode ptr: 0x%x 0x%x", + klog("vbe version: 0x%x / video mode ptr: 0x%x 0x%x", info->VbeVersion, info->VideoModePtr[1], info->VideoModePtr[0]); // vesa info on selected mode: - log(FOOLOS_MODULE_NAME,5,"colors r:%d 0x%x g:%d 0x%x b:%d 0x%x", + klog("colors r:%d 0x%x g:%d 0x%x b:%d 0x%x", mode->red_position,mode->red_mask, mode->green_position,mode->green_mask, mode->blue_position,mode->blue_mask); - log(FOOLOS_MODULE_NAME,5,"res: %d * %d / banks: %d / attr: 0x%x", + klog("res: %d * %d / banks: %d / attr: 0x%x", mode->Xres, mode->Yres, mode->banks, mode->attributes); - log(FOOLOS_MODULE_NAME,5,"bpp: %d / physbase: 0x%x", + klog("bpp: %d / physbase: 0x%x", mode->bpp,mode->physbase); // vesa modes @@ -159,7 +160,7 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont) while(*modeptr!=0xffff&&*modeptr!=0) { - log(FOOLOS_MODULE_NAME,5,"mode supported : 0x%X", (*modeptr)); + klog("mode supported : 0x%X", (*modeptr)); modeptr++; } #endif @@ -315,7 +316,7 @@ void vesa_init_doublebuff() int blocks=800*600*2/4096+1; physbase=VbeModeInfoBlock->physbase; buffer=pmmngr_alloc_blocks(blocks); - log(FOOLOS_MODULE_NAME,5,"Init buffer of %d blocks at 0x%08X",blocks,buffer); + klog("Init buffer of %d blocks at 0x%08X",blocks,buffer); VbeModeInfoBlock->physbase=buffer; } |
