git-svn-id: https://spexeah.com:8443/svn/Asuro@75 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron
2017-05-17 17:07:20 +00:00
parent c528e72f4a
commit 886e6a8cdf
11 changed files with 16 additions and 2 deletions

View File

@ -41,6 +41,7 @@ end;
procedure register();
begin
memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS);
IDT.set_gate(0, uint32(@Main), $08, ISR_RING_0);
end;
@ -53,7 +54,10 @@ 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 Hooks[i]:= pp_hook_method(hook_method);
if uint32(Hooks[i]) = 0 then begin
Hooks[i]:= pp_hook_method(hook_method);
exit;
end;
end;
end;

View File

@ -69,7 +69,7 @@ begin
IDT_Pointer.limit:= (sizeof(TIDT_Entry) * 256) - 1;
IDT_Pointer.base:= uint32(@IDT_Entries);
console.writestringln('IDT: CLEAR.');
util.memset(uint32(@IDT_Entries), 0, sizeof(TIDT_Entry) * 256);
util.memset(uint32(@IDT_Entries[0]), 0, sizeof(TIDT_Entry) * 256);
console.writestringln('IDT: LOAD.');
load(uint32(@IDT_Pointer));
console.writestringln('IDT: INIT END.');

View File

@ -9,6 +9,7 @@ uses
idt,
isr,
irq,
isr0,
console,
bios_data_area,
keyboard;
@ -17,6 +18,11 @@ procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
implementation
procedure test(data : void);
begin
console.writestringln('It works.');
end;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; [public, alias: 'kmain'];
var
c : uint8;
@ -72,6 +78,10 @@ begin
console.writeint(((mbinfo^.mem_upper + 1000) div 1024) +1);
console.writestringln('MB');
console.setdefaultattribute(console.combinecolors(lYellow, Black));
isr0.hook(uint32(@test));
asm INT 0 end;
util.halt_and_dont_catch_fire;
end;