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

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -69,7 +69,7 @@ begin
IDT_Pointer.limit:= (sizeof(TIDT_Entry) * 256) - 1; IDT_Pointer.limit:= (sizeof(TIDT_Entry) * 256) - 1;
IDT_Pointer.base:= uint32(@IDT_Entries); IDT_Pointer.base:= uint32(@IDT_Entries);
console.writestringln('IDT: CLEAR.'); 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.'); console.writestringln('IDT: LOAD.');
load(uint32(@IDT_Pointer)); load(uint32(@IDT_Pointer));
console.writestringln('IDT: INIT END.'); console.writestringln('IDT: INIT END.');

View File

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