diff --git a/Asuro.iso b/Asuro.iso index 0fb402d4..dab0fa68 100644 Binary files a/Asuro.iso and b/Asuro.iso differ diff --git a/bin/kernel.bin b/bin/kernel.bin index 1b2d3bbe..299b8c51 100755 Binary files a/bin/kernel.bin and b/bin/kernel.bin differ diff --git a/iso/boot/asuro.bin b/iso/boot/asuro.bin index 1b2d3bbe..299b8c51 100755 Binary files a/iso/boot/asuro.bin and b/iso/boot/asuro.bin differ diff --git a/lib/isr.ppu b/lib/isr.ppu index b7262b9f..9cb27c52 100644 Binary files a/lib/isr.ppu and b/lib/isr.ppu differ diff --git a/lib/libpkernel.a b/lib/libpkernel.a index b5c358ed..6cdc6323 100644 Binary files a/lib/libpkernel.a and b/lib/libpkernel.a differ diff --git a/src/drivers/isr40.pas b/src/drivers/isr40.pas index 89bc63fb..3b866649 100644 --- a/src/drivers/isr40.pas +++ b/src/drivers/isr40.pas @@ -4,7 +4,7 @@ * Description: 1024/s Timer interrupt ************************************************ * Author: Aaron Hance - * Contributors: + * Contributors: K Morris ************************************************ } unit isr40; @@ -17,27 +17,58 @@ uses isr_types, IDT; -//var - //procedure_ptr : pp_void = nil; - procedure register(); +procedure hook(hook_method : uint32); +procedure unhook(hook_method : uint32); implementation +var + Hooks : Array[1..MAX_HOOKS] of pp_hook_method; + procedure Main; interrupt; //IRQ0, called 1024 times a second. +var + i : integer; + begin - console.writestringln('helo3'); - //if(procedure_ptr <> nil) then begin - // procedure_ptr(); - //end; + for i:=0 to MAX_HOOKS-1 do begin + if uint32(Hooks[i]) <> 0 then Hooks[i](void(18)); + end; outb($A0, $20); outb($20, $20); end; procedure register(); begin + memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS); IDT.set_gate(40, uint32(@Main), $08, ISR_RING_0); end; +procedure hook(hook_method : uint32); +var + i : uint32; + +begin + for i:=0 to MAX_HOOKS-1 do begin + if uint32(Hooks[i]) = hook_method then exit; + end; + for i:=0 to MAX_HOOKS-1 do begin + if uint32(Hooks[i]) = 0 then begin + Hooks[i]:= pp_hook_method(hook_method); + exit; + end; + end; +end; + +procedure unhook(hook_method : uint32); +var + i : uint32; +begin + for i:=0 to MAX_HOOKS-1 do begin + If uint32(Hooks[i]) = hook_method then Hooks[i]:= nil; + exit; + end; +end; + end. \ No newline at end of file