Sleep working?

git-svn-id: https://spexeah.com:8443/svn/Asuro@84 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2017-05-17 18:13:22 +00:00
parent 70aca15211
commit 7a8034196b
20 changed files with 26 additions and 24 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.

View File

@ -38,6 +38,13 @@ type
const
BDA : PBDA = PBDA($0400);
procedure tick_update(data : void);
implementation
procedure tick_update(data : void);
begin
BDA^.Ticks:= BDA^.Ticks + 1;
end;
end.

View File

@ -15,7 +15,7 @@ uses
util,
bios_data_area;
const DEBUG = FALSE;
var DEBUG : Boolean;
type
TColor = ( Black = $0,
@ -103,6 +103,7 @@ var
procedure init(); [public, alias: 'console_init'];
Begin
Debug:= False;
Console_Properties.Default_Attribute:= console.combinecolors(White, Black);
console.clear();
end;
@ -373,7 +374,7 @@ begin
end;
Console_Cursor.X:= 0;
console._update_cursor;
if DEBUG then psleep(500);
if Debug then psleep(1000);
end;
procedure _newline(); [public, alias: '_console_newline'];

View File

@ -9,7 +9,7 @@ uses
idt,
isr,
irq,
isr0,
isr32,
console,
bios_data_area,
keyboard;
@ -17,17 +17,6 @@ uses
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
implementation
procedure test2(data : void);
begin
console.writestringln('It works 2.');
end;
procedure test(data : void);
begin
console.writestringln('It works.');
end;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; [public, alias: 'kmain'];
var
@ -58,6 +47,10 @@ begin
STI;
isr32.hook(uint32(@bios_data_area.tick_update));
console.debug:= true;
asm
MOV dds, CS
end;
@ -85,11 +78,6 @@ begin
console.writestringln('MB');
console.setdefaultattribute(console.combinecolors(lYellow, Black));
isr0.hook(uint32(@test));
isr0.hook(uint32(@test2));
isr0.unhook(uint32(@test));
asm INT 0 end;
util.halt_and_dont_catch_fire;
end;

View File

@ -13,6 +13,9 @@ unit util;
interface
uses
bios_data_area;
procedure CLI();
procedure STI();
function hi(b : uint8) : uint8;
@ -31,6 +34,9 @@ procedure psleep(t : uint16);
implementation
uses
console;
function hi(b : uint8) : uint8; [public, alias: 'util_hi'];
begin
hi:= (b AND $F0) SHR 4;
@ -58,13 +64,13 @@ end;
procedure psleep(t : uint16);
var
i : uint32;
t1, t2 : uint32;
t1, t2 : uint16;
begin
for i:=0 to t*t*t do begin
t1:=i;
t2:=t1+4444+i;
t1:= BDA^.Ticks;
t2:= BDA^.Ticks;
while t2-t1 < t do begin
t2:= BDA^.Ticks;
end;
end;