Sleep working?
git-svn-id: https://spexeah.com:8443/svn/Asuro@84 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
1 parent
70aca15211
commit
7a8034196b
20 files changed
+26
-24
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
@@ -38,6 +38,13 @@ type
|
|||||||
const
|
const
|
||||||
BDA : PBDA = PBDA($0400);
|
BDA : PBDA = PBDA($0400);
|
||||||
|
|
||||||
|
procedure tick_update(data : void);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
procedure tick_update(data : void);
|
||||||
|
begin
|
||||||
|
BDA^.Ticks:= BDA^.Ticks + 1;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
+3
-2
@@ -15,7 +15,7 @@ uses
|
|||||||
util,
|
util,
|
||||||
bios_data_area;
|
bios_data_area;
|
||||||
|
|
||||||
const DEBUG = FALSE;
|
var DEBUG : Boolean;
|
||||||
|
|
||||||
type
|
type
|
||||||
TColor = ( Black = $0,
|
TColor = ( Black = $0,
|
||||||
@@ -103,6 +103,7 @@ var
|
|||||||
|
|
||||||
procedure init(); [public, alias: 'console_init'];
|
procedure init(); [public, alias: 'console_init'];
|
||||||
Begin
|
Begin
|
||||||
|
Debug:= False;
|
||||||
Console_Properties.Default_Attribute:= console.combinecolors(White, Black);
|
Console_Properties.Default_Attribute:= console.combinecolors(White, Black);
|
||||||
console.clear();
|
console.clear();
|
||||||
end;
|
end;
|
||||||
@@ -373,7 +374,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
Console_Cursor.X:= 0;
|
Console_Cursor.X:= 0;
|
||||||
console._update_cursor;
|
console._update_cursor;
|
||||||
if DEBUG then psleep(500);
|
if Debug then psleep(1000);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure _newline(); [public, alias: '_console_newline'];
|
procedure _newline(); [public, alias: '_console_newline'];
|
||||||
|
|||||||
+5
-17
@@ -9,7 +9,7 @@ uses
|
|||||||
idt,
|
idt,
|
||||||
isr,
|
isr,
|
||||||
irq,
|
irq,
|
||||||
isr0,
|
isr32,
|
||||||
console,
|
console,
|
||||||
bios_data_area,
|
bios_data_area,
|
||||||
keyboard;
|
keyboard;
|
||||||
@@ -17,17 +17,6 @@ uses
|
|||||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||||
|
|
||||||
implementation
|
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'];
|
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; [public, alias: 'kmain'];
|
||||||
var
|
var
|
||||||
@@ -58,6 +47,10 @@ begin
|
|||||||
|
|
||||||
STI;
|
STI;
|
||||||
|
|
||||||
|
isr32.hook(uint32(@bios_data_area.tick_update));
|
||||||
|
|
||||||
|
console.debug:= true;
|
||||||
|
|
||||||
asm
|
asm
|
||||||
MOV dds, CS
|
MOV dds, CS
|
||||||
end;
|
end;
|
||||||
@@ -85,11 +78,6 @@ begin
|
|||||||
console.writestringln('MB');
|
console.writestringln('MB');
|
||||||
console.setdefaultattribute(console.combinecolors(lYellow, Black));
|
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;
|
util.halt_and_dont_catch_fire;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -13,6 +13,9 @@ unit util;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
bios_data_area;
|
||||||
|
|
||||||
procedure CLI();
|
procedure CLI();
|
||||||
procedure STI();
|
procedure STI();
|
||||||
function hi(b : uint8) : uint8;
|
function hi(b : uint8) : uint8;
|
||||||
@@ -31,6 +34,9 @@ procedure psleep(t : uint16);
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
console;
|
||||||
|
|
||||||
function hi(b : uint8) : uint8; [public, alias: 'util_hi'];
|
function hi(b : uint8) : uint8; [public, alias: 'util_hi'];
|
||||||
begin
|
begin
|
||||||
hi:= (b AND $F0) SHR 4;
|
hi:= (b AND $F0) SHR 4;
|
||||||
@@ -58,13 +64,13 @@ end;
|
|||||||
|
|
||||||
procedure psleep(t : uint16);
|
procedure psleep(t : uint16);
|
||||||
var
|
var
|
||||||
i : uint32;
|
t1, t2 : uint16;
|
||||||
t1, t2 : uint32;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
for i:=0 to t*t*t do begin
|
t1:= BDA^.Ticks;
|
||||||
t1:=i;
|
t2:= BDA^.Ticks;
|
||||||
t2:=t1+4444+i;
|
while t2-t1 < t do begin
|
||||||
|
t2:= BDA^.Ticks;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user