diff --git a/Functions.c b/Functions.c index 12ed8fd..1f6c0da 100644 --- a/Functions.c +++ b/Functions.c @@ -107,6 +107,13 @@ inline void init_timer() outportb(0x40, 0x2e); //msb } + +//Invalidates the page tables to re-cache the Translation Lookaside Buffer +/*inline void invlpg() +{ + asm("invlpg"); +}*/ + //Signals an End Of Interrupt signal to the first PIC inline void eoi() { diff --git a/functions.h b/functions.h index 3f0708a..0dd0bd5 100644 --- a/functions.h +++ b/functions.h @@ -21,6 +21,8 @@ inline void eoi(); inline void eoi2(); inline dword kernel_size(); inline void init_timer(); +//inline void invlpg(); + diff --git a/kernel.c b/kernel.c index 5b7f753..90f4535 100644 --- a/kernel.c +++ b/kernel.c @@ -45,8 +45,8 @@ void k_init() console_cls(); remap_pics(0x20, 0x28); init_timer(); - video_init((ModeInfoBlock *) 0x90306); mm_init(); + video_init((ModeInfoBlock *) 0x90306); vmm_init(); mouse_init(); vmm_enable_paging(); @@ -74,7 +74,7 @@ void isr(dword num) { case 0x20: // IRQ0 - timer interrupt timer++; - (*(byte *)(0xb8000+3998))++; + (*(byte *)(0xb8000))++; eoi(); break; case 0x21: // IRQ1 - keyboard interrupt diff --git a/video.c b/video.c index 8cf6935..e4a936a 100644 --- a/video.c +++ b/video.c @@ -17,6 +17,8 @@ void video_init(ModeInfoBlock *mib) case 32: vid_ptr32 = (dword *) video_mode.PhysBasePtr; } + + vid_Buffer = mm_palloc((4*video_mode.XResolution*video_mode.YResolution)/4096+1, PID_KERNEL); dword tot = ((video_mode.XResolution) * (video_mode.YResolution)); int a; diff --git a/video.h b/video.h index 527694d..679cec3 100644 --- a/video.h +++ b/video.h @@ -57,7 +57,7 @@ ModeInfoBlock video_mode; byte *vid_ptr24; word *vid_ptr16; dword *vid_ptr32; - +dword *vid_Buffer;