git-svn-id: https://spexeah.com:8443/svn/Asuro@205 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron
2017-05-23 19:46:30 +00:00
parent 5912e3b228
commit 82c557ecab
53 changed files with 131 additions and 17 deletions

View File

@ -38,29 +38,45 @@ procedure clear();
procedure setdefaultattribute(attribute : char);
procedure writechar(character : char);
procedure writestring(str: PChar);
procedure writeint(i: Integer);
procedure writeword(i: DWORD);
procedure writehex(i: DWORD);
procedure writecharln(character : char);
procedure writestringln(str: PChar);
procedure writeintln(i: Integer);
procedure writewordln(i: DWORD);
procedure writehexln(i: DWORD);
procedure writecharex(character : char; attributes : char);
procedure writestringex(str: PChar; attributes : char);
procedure writeintex(i: Integer; attributes : char);
procedure writewordex(i: DWORD; attributes : char);
procedure writehexex(i : DWORD; attributes : char);
procedure writecharlnex(character : char; attributes : char);
procedure writestring(str: PChar);
procedure writestringln(str: PChar);
procedure writestringex(str: PChar; attributes : char);
procedure writestringlnex(str: PChar; attributes : char);
procedure writeint(i: Integer);
procedure writeintln(i: Integer);
procedure writeintex(i: Integer; attributes : char);
procedure writeintlnex(i: Integer; attributes : char);
procedure writeword(i: DWORD);
procedure writewordln(i: DWORD);
procedure writewordex(i: DWORD; attributes : char);
procedure writewordlnex(i: DWORD; attributes : char);
procedure writehex(i: DWORD);
procedure writehexln(i: DWORD);
procedure writehexex(i : DWORD; attributes : char);
procedure writehexlnex(i: DWORD; attributes : char);
procedure writebin8(b : uint8);
procedure writebin8ln(b : uint8);
procedure writebin8ex(b : uint8; attributes : char);
procedure writebin8lnex(b : uint8; attributes : char);
procedure writebin16(b : uint16);
procedure writebin16ln(b : uint16);
procedure writebin16ex(b : uint16; attributes : char);
procedure writebin16lnex(b : uint16; attributes : char);
procedure writebin32(b : uint32);
procedure writebin32ln(b : uint32);
procedure writebin32ex(b : uint32; attributes : char);
procedure writebin32lnex(b : uint32; attributes : char);
function combinecolors(Foreground, Background : TColor) : char;
procedure _increment_x();
@ -120,6 +136,94 @@ begin
Console_Cursor.Y:= 0;
end;
procedure writebin8ex(b : uint8; attributes : char);
var
Mask : PMask;
i : uint8;
begin
Mask:= PMask(@b);
for i:=0 to 7 do begin
If Mask^[7-i] then writecharex('1', attributes) else writecharex('0', attributes);
end;
end;
procedure writebin16ex(b : uint16; attributes : char);
var
Mask : PMask;
i,j : uint8;
begin
for j:=1 downto 0 do begin
Mask:= PMask(uint32(@b) + (1 * j));
for i:=0 to 7 do begin
If Mask^[7-i] then writecharex('1', attributes) else writecharex('0', attributes);
end;
end;
end;
procedure writebin32ex(b : uint32; attributes : char);
var
Mask : PMask;
i,j : uint8;
begin
for j:=3 downto 0 do begin
Mask:= PMask(uint32(@b) + (1 * j));
for i:=0 to 7 do begin
If Mask^[7-i] then writecharex('1', attributes) else writecharex('0', attributes);
end;
end;
end;
procedure writebin8(b : uint8);
begin
writebin8ex(b, Console_Properties.Default_Attribute);
end;
procedure writebin16(b : uint16);
begin
writebin16ex(b, Console_Properties.Default_Attribute);
end;
procedure writebin32(b : uint32);
begin
writebin32ex(b, Console_Properties.Default_Attribute);
end;
procedure writebin8lnex(b : uint8; attributes : char);
begin
writebin8ex(b, attributes);
console._safeincrement_y();
end;
procedure writebin16lnex(b : uint16; attributes : char);
begin
writebin16ex(b, attributes);
console._safeincrement_y();
end;
procedure writebin32lnex(b : uint32; attributes : char);
begin
writebin32ex(b, attributes);
console._safeincrement_y();
end;
procedure writebin8ln(b : uint8);
begin
writebin8lnex(b, Console_Properties.Default_Attribute);
end;
procedure writebin16ln(b : uint16);
begin
writebin16lnex(b, Console_Properties.Default_Attribute);
end;
procedure writebin32ln(b : uint32);
begin
writebin32lnex(b, Console_Properties.Default_Attribute);
end;
procedure setdefaultattribute(attribute: char); [public, alias: 'console_setdefaultattribute'];
begin
Console_Properties.Default_Attribute:= attribute;

View File

@ -42,17 +42,24 @@ procedure register();
var
status : uint8;
bm : PBitMask;
ak : uint8;
begin
memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS);
IDT.set_gate(45, uint32(@Main), $08, ISR_RING_0);
outb($64, $20);
status:= inb($64);
ak:= inb($64);
console.writebin8ln(status);
bm:= PBitMask(@status);
bm^.b1:= true;
bm^.b5:= false;
console.writebin8ln(status);
//while true do begin end;
outb($64, $60);
ak:= inb($64);
outb($60, status);
ak:= inb($60);
end;
procedure hook(hook_method : uint32);

View File

@ -69,6 +69,7 @@ begin
console.writestringlnex('GDT: LOAD FAIL.', console.combinecolors(Red, Black));
halt_and_catch_fire;
end;
idt.init();
isr.init();
irq.init();
@ -79,7 +80,6 @@ begin
scheduler.init();
//asm INT 13 end;
STI;
isr32.hook(uint32(@bios_data_area.tick_update));

View File

@ -66,10 +66,13 @@ type
UBit30 = 0..(1 shl 30) - 1;
TBitMask = bitpacked record
b7,b6,b5,b4,b3,b2,b1,b0 : Boolean;
b0,b1,b2,b3,b4,b5,b6,b7 : Boolean;
end;
PBitMask = ^TBitMask;
TMask = bitpacked array[0..7] of Boolean;
PMask = ^TMask;
implementation
end.