Code Cleanup

git-svn-id: https://spexeah.com:8443/svn/Asuro@180 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2017-05-22 01:07:19 +00:00
parent 27ad1415c3
commit 77a41c94f7
10 changed files with 4 additions and 11 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.

View File

@ -70,6 +70,7 @@ end;
procedure reload; procedure reload;
begin begin
console.writestringln('GDT: RELOAD.');
reload_gdt(uint32(@gdt_pointer)); reload_gdt(uint32(@gdt_pointer));
end; end;
@ -80,8 +81,6 @@ var
begin begin
lLimit:= (Gate_Number + 1) * 8; lLimit:= (Gate_Number + 1) * 8;
lLimit:= lLimit - 1; lLimit:= lLimit - 1;
writestring('lLimit: ');
writewordln(lLimit);
if lLimit > gdt_pointer.limit then begin if lLimit > gdt_pointer.limit then begin
gdt_pointer.limit:= lLimit; gdt_pointer.limit:= lLimit;
end; end;

View File

@ -66,8 +66,8 @@ begin
pmemorymanager.init(); pmemorymanager.init();
vmemorymanager.init(); vmemorymanager.init();
lmemorymanager.init(); lmemorymanager.init();
scheduler.init();
tss.init(); tss.init();
scheduler.init();
STI; STI;
isr32.hook(uint32(@bios_data_area.tick_update)); isr32.hook(uint32(@bios_data_area.tick_update));

View File

@ -188,7 +188,7 @@ var
cCR3 : uint32; cCR3 : uint32;
begin begin
console.writehexln(uint32(ptrTaskStateSegment)); console.writestringln('TSS: INIT BEGIN.')
ptrTaskStateSegment^.ss0:= $08; ptrTaskStateSegment^.ss0:= $08;
ptrTaskStateSegment^.iomap:= sizeof(TTaskStateSegment)-1; ptrTaskStateSegment^.iomap:= sizeof(TTaskStateSegment)-1;
asm asm
@ -199,19 +199,13 @@ begin
console.writewordln(sizeof(TTaskStateSegment)); console.writewordln(sizeof(TTaskStateSegment));
ptrTaskStateSegment^.esp0:= cESP; ptrTaskStateSegment^.esp0:= cESP;
ptrTaskStateSegment^.CR3:= cCR3; ptrTaskStateSegment^.CR3:= cCR3;
console.writestring('OLD LIMIT: ');
console.writewordln(gdt.gdt_pointer.limit);
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
console.writestring('NEW LIMIT: ');
console.writewordln(gdt.gdt_pointer.limit);
gdt.reload; gdt.reload;
//while true do begin end;
console.writestringln('A');
asm asm
mov AX, 40 mov AX, 40
ltr AX ltr AX
end; end;
console.writestringln('B'); console.writestringln('TSS: INIT END.')
end; end;
end. end.