Added delay to print.

git-svn-id: https://spexeah.com:8443/svn/Asuro@68 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2017-05-17 15:35:27 +00:00
parent d6697f0e30
commit d54e43cca9
24 changed files with 55 additions and 12 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.

View File

@ -371,6 +371,7 @@ begin
end; end;
Console_Cursor.X:= 0; Console_Cursor.X:= 0;
console._update_cursor; console._update_cursor;
psleep(500);
end; end;
procedure _newline(); [public, alias: '_console_newline']; procedure _newline(); [public, alias: '_console_newline'];

View File

@ -11,6 +11,9 @@ unit gdt;
interface interface
uses
console;
type type
TGDT_Entry = bitpacked record TGDT_Entry = bitpacked record
limit_low : uint16; limit_low : uint16;
@ -58,10 +61,14 @@ begin
gdt_entries[Gate_Number].limit_low := (Limit AND $FFFF); gdt_entries[Gate_Number].limit_low := (Limit AND $FFFF);
gdt_entries[Gate_Number].granularity := ((Limit SHR 16) AND $0F) OR (Granularity AND $F0); gdt_entries[Gate_Number].granularity := ((Limit SHR 16) AND $0F) OR (Granularity AND $F0);
gdt_entries[Gate_Number].access := Access; gdt_entries[Gate_Number].access := Access;
console.writestring('GDT: GATE ');
console.writeint(Gate_Number);
console.writestringln(' SET.');
end; end;
procedure init(); procedure init();
begin begin
console.writestringln('GDT: INIT START.');
gdt_pointer.limit := (sizeof(TGDT_Entry) * 5) - 1; gdt_pointer.limit := (sizeof(TGDT_Entry) * 5) - 1;
gdt_pointer.base := uint32(@gdt_entries); gdt_pointer.base := uint32(@gdt_entries);
set_gate($00, $00, $00, $00, $00); set_gate($00, $00, $00, $00, $00);
@ -69,7 +76,9 @@ begin
set_gate($02, $00, $FFFFFFFF, $92, $CF); set_gate($02, $00, $FFFFFFFF, $92, $CF);
set_gate($03, $00, $FFFFFFFF, $FA, $CF); set_gate($03, $00, $FFFFFFFF, $FA, $CF);
set_gate($04, $00, $FFFFFFFF, $F2, $CF); set_gate($04, $00, $FFFFFFFF, $F2, $CF);
flush_gdt(uint32(@gdt_pointer)) console.writestringln('GDT: FLUSH.');
flush_gdt(uint32(@gdt_pointer));
console.writestringln('GDT: INIT END.');
end; end;
end. end.

View File

@ -12,7 +12,7 @@ unit idt;
interface interface
uses uses
util; util, console;
const const
ISR_RING_0 = $8E; ISR_RING_0 = $8E;
@ -52,6 +52,9 @@ begin
IDT_Entries[Number].selector:= Selector; IDT_Entries[Number].selector:= Selector;
IDT_Entries[Number].flags:= Flags; IDT_Entries[Number].flags:= Flags;
IDT_Entries[Number].always_0:= $00; IDT_Entries[Number].always_0:= $00;
console.writestring('IDT: GATE ');
console.writeint(Number);
console.writestringln(' SET.');
end; end;
procedure load(idt_pointer : uint32); assembler; nostackframe; procedure load(idt_pointer : uint32); assembler; nostackframe;
@ -62,10 +65,14 @@ end;
procedure init(); procedure init();
begin begin
console.writestringln('IDT: INIT START.');
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.');
util.memset(uint32(@IDT_Entries), 0, sizeof(TIDT_Entry) * 256); util.memset(uint32(@IDT_Entries), 0, sizeof(TIDT_Entry) * 256);
console.writestringln('IDT: LOAD.');
load(uint32(@IDT_Pointer)); load(uint32(@IDT_Pointer));
console.writestringln('IDT: INIT END.');
end; end;
end. end.

View File

@ -11,7 +11,7 @@ unit irq;
interface interface
uses util; uses util, console;
procedure init(); procedure init();
@ -19,6 +19,7 @@ implementation
procedure init(); procedure init();
begin begin
console.writestringln('IRQ: INIT START.');
outb($20, $11); outb($20, $11);
outb($A0, $11); outb($A0, $11);
outb($21, $20); outb($21, $20);
@ -29,6 +30,7 @@ begin
outb($A1, $01); outb($A1, $01);
outb($21, $00); outb($21, $00);
outb($A1, $00); outb($A1, $00);
console.writestringln('IRQ: INIT END.');
end; end;
end. end.

View File

@ -12,6 +12,7 @@ unit isr;
interface interface
uses uses
Console,
ISR0, ISR1, ISR2, ISR3, ISR4, ISR5, ISR6, ISR7, ISR8, ISR9, ISR0, ISR1, ISR2, ISR3, ISR4, ISR5, ISR6, ISR7, ISR8, ISR9,
ISR10, ISR11, ISR12, ISR13, ISR14, ISR15, ISR16, ISR17, ISR18, ISR10, ISR11, ISR12, ISR13, ISR14, ISR15, ISR16, ISR17, ISR18,
ISR32, ISR33, ISR32, ISR33,
@ -23,6 +24,7 @@ implementation
procedure init(); procedure init();
begin begin
console.writestringln('ISR: INIT START.');
ISR0.register(); // Divide-By-Zero ISR0.register(); // Divide-By-Zero
ISR1.register(); // Debug ISR1.register(); // Debug
ISR2.register(); // Non-Maskable Inturrupt ISR2.register(); // Non-Maskable Inturrupt
@ -46,6 +48,7 @@ begin
ISR32.register(); // 55ms Timer ISR32.register(); // 55ms Timer
ISR33.register(); // Keyboard ISR33.register(); // Keyboard
ISR40.register(); // 1024/s Timer ISR40.register(); // 1024/s Timer
console.writestringln('ISR: INIT END.');
end; end;
end. end.

View File

@ -28,26 +28,34 @@ var
begin begin
mbi:= mbinfo; mbi:= mbinfo;
mbm:= mbmagic; mbm:= mbmagic;
gdt.init();
idt.init();
isr.init();
irq.init();
console.init(); console.init();
console.writestringln('Booting Asuro...'); console.writestringln('Booting Asuro...');
if (mbm <> MULTIBOOT_BOOTLOADER_MAGIC) then begin if (mbm <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
console.setdefaultattribute(console.combinecolors(Red, Black)); console.setdefaultattribute(console.combinecolors(Red, Black));
console.writestringln('Multiboot Compliant Boot-Loader Needed!'); console.writestringln('Multiboot Compliant Boot-Loader Needed!');
console.writestringln('HALTING'); console.writestringln('HALTING');
util.halt_and_catch_fire; util.halt_and_catch_fire;
end; end;
console.clear();
console.writestring('If this reads "0x8" then we have a GDT: '); gdt.init();
idt.init();
isr.init();
irq.init();
asm asm
MOV dds, CS MOV dds, CS
end; end;
console.setdefaultattribute(console.combinecolors(Red, Black));
if dds = $08 then console.setdefaultattribute(console.combinecolors(Green, Black)); if dds = $08 then begin
console.writehexln(dds); console.setdefaultattribute(console.combinecolors(Green, Black));
console.writestringln('GDT: LOAD SUCCESS.');
end else begin
console.setdefaultattribute(console.combinecolors(Red, Black));
console.writestringln('GDT: LOAD FAIL.');
end;
console.writestringln('');
console.setdefaultattribute(console.combinecolors(Green, Black)); console.setdefaultattribute(console.combinecolors(Green, Black));
console.writestringln('Asuro Booted Correctly!'); console.writestringln('Asuro Booted Correctly!');
console.writestringln(''); console.writestringln('');

View File

@ -26,6 +26,7 @@ function inb(port : uint16) : uint8;
function inw(port : uint16) : uint16; function inw(port : uint16) : uint16;
function inl(port : uint16) : uint32; function inl(port : uint16) : uint32;
procedure memset(location : uint32; value : uint8; size : uint32); procedure memset(location : uint32; value : uint8; size : uint32);
procedure psleep(t : uint16);
implementation implementation
@ -49,6 +50,18 @@ begin
switchendian:= (lo(b) SHL 4) OR hi(b); switchendian:= (lo(b) SHL 4) OR hi(b);
end; end;
procedure psleep(t : uint16);
var
i : uint32;
t1, t2 : uint32;
begin
for i:=0 to t*t*t do begin
t1:=i;
t2:=t1+4444+i;
end;
end;
procedure outl(port : uint16; val : uint32); [public, alias: 'util_outl']; procedure outl(port : uint16; val : uint32); [public, alias: 'util_outl'];
begin begin
asm asm