git-svn-id: https://spexeah.com:8443/svn/Asuro@199 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron
2017-05-22 20:14:50 +00:00
parent 058f400b0c
commit b15760b7f6
39 changed files with 28 additions and 127 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.

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.

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.

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.

Binary file not shown.

Binary file not shown.

View File

@ -28,22 +28,29 @@ var
procedure Main(); interrupt; procedure Main(); interrupt;
var var
i : integer; i : uint32;
ec : uint32; Regs : PRegisters;
begin begin
asm
MOV EAX, [ESP-4]
MOV ec, EAX
end;
CLI; CLI;
asm
MOV EAX, EBP
MOV Regs, EAX
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](void(13)); if uint32(Hooks[i]) <> 0 then Hooks[i](void(13));
end; end;
console.writestring('General Protection Fault. ['); console.writestringln('General Protection Fault.');
console.writehex(ec); console.writestring('Flags: ');
console.writestringln(']'); console.writehexln(Regs^.EFlags);
util.halt_and_catch_fire; console.writestring('EIP: ');
console.writehexln(Regs^.EIP);
console.writestring('CS: ');
console.writehexln(Regs^.CS);
console.writestring('Error Code: ');
console.writehexln(Regs^.ErrorCode);
Regs^.EIP:= Regs^.EIP - 2;
//util.halt_and_catch_fire;
end; end;
procedure register(); procedure register();

View File

@ -15,10 +15,12 @@ const
MAX_HOOKS = 16; MAX_HOOKS = 16;
type type
ISR_REGS = record PRegisters = ^TRegisters;
ip, cs, flags, sp, ss : uint16; TRegisters = record
edi,esi,ebp,esp,ebx,edx,ecx,eax: uint32;
ErrorCode : uint32;
eip,cs,eflags,UserESP,ss: uint32;
end; end;
PISR_REGS = ^ISR_REGS;
pp_hook_method = procedure(data : void); pp_hook_method = procedure(data : void);
pp_void = pp_hook_method; pp_void = pp_hook_method;

View File

@ -77,7 +77,9 @@ begin
lmemorymanager.init(); lmemorymanager.init();
tss.init(); tss.init();
scheduler.init(); scheduler.init();
asm INT 13 end;
STI; STI;
isr32.hook(uint32(@bios_data_area.tick_update)); isr32.hook(uint32(@bios_data_area.tick_update));

View File

@ -20,10 +20,9 @@ const
Quantum = 64; Quantum = 64;
type type
TTask_State_Segment = packed record TTaskState = packed record
//EAX, EDX,
end; end;
TScheduler_Entry = packed record TScheduler_Entry = packed record
ThreadID : uint32; ThreadID : uint32;
Priority : uint8; Priority : uint8;

View File

@ -17,85 +17,6 @@ uses
console; console;
type type
{TTaskStateSegment = packed record
Res1 : uint16;
IOMap : uint16;
LDTR : uint16;
Res2 : uint16;
GS : uint16;
Res3 : uint16;
FS : uint16;
Res4 : uint16;
DS : uint16;
Res5 : uint16;
SS : uint16;
Res6 : uint16;
CS : uint16;
Res7 : uint16;
ES : uint16;
Res8 : uint16;
EDI : uint32;
ESI : uint32;
EBP : uint32;
ESP : uint32;
EBX : uint32;
EDX : uint32;
ECX : uint32;
EAX : uint32;
EFLAGS : uint32;
EIP : uint32;
CR3 : uint32;
SS2 : uint16;
Res9 : uint16;
SS1 : uint16;
Res10 : uint16;
SS0 : uint16;
Res11 : uint16;
ESP0 : uint32;
LINK : uint16;
Res12 : uint16;
end;
PTaskStateSegment = ^TTaskStateSegment;}
{
Res12 : uint16;
LINK : uint16;
ESP0 : uint32;
Res11 : uint16;
SS0 : uint16;
Res10 : uint16;
SS1 : uint16;
Res9 : uint16;
SS2 : uint16;
CR3 : uint32;
EIP : uint32;
EFLAGS : uint32;
EAX : uint32;
ECX : uint32;
EDX : uint32;
EBX : uint32;
ESP : uint32;
EBP : uint32;
ESI : uint32;
EDI : uint32;
Res8 : uint16;
ES : uint16;
Res7 : uint16;
CS : uint16;
Res6 : uint16;
SS : uint16;
Res5 : uint16;
DS : uint16;
Res4 : uint16;
FS : uint16;
Res3 : uint16;
GS : uint16;
Res2 : uint16;
LDTR : uint16;
IOPBOffset : uint16;
Res1 : uint16;
}
TTaskStateSegment = packed record TTaskStateSegment = packed record
link : uint16; link : uint16;
link_h : uint16; link_h : uint16;
@ -144,36 +65,6 @@ type
end; end;
PTaskStateSegment = ^TTaskStateSegment; PTaskStateSegment = ^TTaskStateSegment;
{TTaskStateSegment = packed record
link : uint32;
esp0 : uint32;
ss0 : uint32;
esp1 : uint32;
ss1 : uint32;
esp2 : uint32;
ss2 : uint32;
cr3 : uint32;
eip : uint32;
eflags : uint32;
eax : uint32;
ecx : uint32;
edx : uint32;
ebx : uint32;
esp : uint32;
ebp : uint32;
esi : uint32;
edi : uint32;
es : uint32;
cs : uint32;
ss : uint32;
ds : uint32;
fs : uint32;
gs : uint32;
ldt : uint32;
iomap : uint32;
end;
PTaskStateSegment = ^TTaskStateSegment;}
var var
TaskStateSegment : TTaskStateSegment; TaskStateSegment : TTaskStateSegment;
ptrTaskStateSegment : PTaskStateSegment = @TaskStateSegment; ptrTaskStateSegment : PTaskStateSegment = @TaskStateSegment;
@ -198,7 +89,7 @@ begin
end; end;
ptrTaskStateSegment^.esp0:= cESP; ptrTaskStateSegment^.esp0:= cESP;
ptrTaskStateSegment^.CR3:= cCR3; ptrTaskStateSegment^.CR3:= cCR3;
gdt.set_gate($05, uint32(ptrTaskStateSegment)-KERNEL_VIRTUAL_BASE, sizeof(TTaskStateSegment)-1, $89, $40); //OFFSET: 40 gdt.set_gate($05, uint32(ptrTaskStateSegment) - KERNEL_VIRTUAL_BASE, sizeof(TTaskStateSegment) - 1, $89, $40); //OFFSET: 40
gdt.reload; gdt.reload;
asm asm
mov AX, 40 mov AX, 40