we
git-svn-id: https://spexeah.com:8443/svn/Asuro@205 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
5912e3b228
commit
82c557ecab
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
Binary file not shown.
BIN
lib/PCI.ppu
BIN
lib/PCI.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/console.o
BIN
lib/console.o
Binary file not shown.
BIN
lib/console.ppu
BIN
lib/console.ppu
Binary file not shown.
BIN
lib/gdt.ppu
BIN
lib/gdt.ppu
Binary file not shown.
BIN
lib/idt.ppu
BIN
lib/idt.ppu
Binary file not shown.
BIN
lib/irq.ppu
BIN
lib/irq.ppu
Binary file not shown.
BIN
lib/isr.ppu
BIN
lib/isr.ppu
Binary file not shown.
BIN
lib/isr0.ppu
BIN
lib/isr0.ppu
Binary file not shown.
BIN
lib/isr1.ppu
BIN
lib/isr1.ppu
Binary file not shown.
BIN
lib/isr10.ppu
BIN
lib/isr10.ppu
Binary file not shown.
BIN
lib/isr11.ppu
BIN
lib/isr11.ppu
Binary file not shown.
BIN
lib/isr12.ppu
BIN
lib/isr12.ppu
Binary file not shown.
BIN
lib/isr13.ppu
BIN
lib/isr13.ppu
Binary file not shown.
BIN
lib/isr14.ppu
BIN
lib/isr14.ppu
Binary file not shown.
BIN
lib/isr15.ppu
BIN
lib/isr15.ppu
Binary file not shown.
BIN
lib/isr16.ppu
BIN
lib/isr16.ppu
Binary file not shown.
BIN
lib/isr17.ppu
BIN
lib/isr17.ppu
Binary file not shown.
BIN
lib/isr18.ppu
BIN
lib/isr18.ppu
Binary file not shown.
BIN
lib/isr2.ppu
BIN
lib/isr2.ppu
Binary file not shown.
BIN
lib/isr3.ppu
BIN
lib/isr3.ppu
Binary file not shown.
BIN
lib/isr32.ppu
BIN
lib/isr32.ppu
Binary file not shown.
BIN
lib/isr33.ppu
BIN
lib/isr33.ppu
Binary file not shown.
BIN
lib/isr4.ppu
BIN
lib/isr4.ppu
Binary file not shown.
BIN
lib/isr40.ppu
BIN
lib/isr40.ppu
Binary file not shown.
BIN
lib/isr45.ppu
BIN
lib/isr45.ppu
Binary file not shown.
BIN
lib/isr5.ppu
BIN
lib/isr5.ppu
Binary file not shown.
BIN
lib/isr6.ppu
BIN
lib/isr6.ppu
Binary file not shown.
BIN
lib/isr7.ppu
BIN
lib/isr7.ppu
Binary file not shown.
BIN
lib/isr8.ppu
BIN
lib/isr8.ppu
Binary file not shown.
BIN
lib/isr9.ppu
BIN
lib/isr9.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.ppu
Binary file not shown.
BIN
lib/keyboard.ppu
BIN
lib/keyboard.ppu
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/libpsystem.a
BIN
lib/libpsystem.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/system.o
BIN
lib/system.o
Binary file not shown.
BIN
lib/system.ppu
BIN
lib/system.ppu
Binary file not shown.
BIN
lib/tss.ppu
BIN
lib/tss.ppu
Binary file not shown.
BIN
lib/util.ppu
BIN
lib/util.ppu
Binary file not shown.
Binary file not shown.
134
src/console.pas
134
src/console.pas
@ -38,29 +38,45 @@ procedure clear();
|
|||||||
procedure setdefaultattribute(attribute : char);
|
procedure setdefaultattribute(attribute : char);
|
||||||
|
|
||||||
procedure writechar(character : 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 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 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 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 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 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 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 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;
|
function combinecolors(Foreground, Background : TColor) : char;
|
||||||
|
|
||||||
procedure _increment_x();
|
procedure _increment_x();
|
||||||
@ -120,6 +136,94 @@ begin
|
|||||||
Console_Cursor.Y:= 0;
|
Console_Cursor.Y:= 0;
|
||||||
end;
|
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'];
|
procedure setdefaultattribute(attribute: char); [public, alias: 'console_setdefaultattribute'];
|
||||||
begin
|
begin
|
||||||
Console_Properties.Default_Attribute:= attribute;
|
Console_Properties.Default_Attribute:= attribute;
|
||||||
|
@ -42,17 +42,24 @@ procedure register();
|
|||||||
var
|
var
|
||||||
status : uint8;
|
status : uint8;
|
||||||
bm : PBitMask;
|
bm : PBitMask;
|
||||||
|
ak : uint8;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS);
|
memset(uint32(@Hooks[0]), 0, sizeof(pp_hook_method)*MAX_HOOKS);
|
||||||
IDT.set_gate(45, uint32(@Main), $08, ISR_RING_0);
|
IDT.set_gate(45, uint32(@Main), $08, ISR_RING_0);
|
||||||
outb($64, $20);
|
outb($64, $20);
|
||||||
status:= inb($64);
|
status:= inb($64);
|
||||||
|
ak:= inb($64);
|
||||||
|
console.writebin8ln(status);
|
||||||
bm:= PBitMask(@status);
|
bm:= PBitMask(@status);
|
||||||
bm^.b1:= true;
|
bm^.b1:= true;
|
||||||
bm^.b5:= false;
|
bm^.b5:= false;
|
||||||
|
console.writebin8ln(status);
|
||||||
|
//while true do begin end;
|
||||||
outb($64, $60);
|
outb($64, $60);
|
||||||
|
ak:= inb($64);
|
||||||
outb($60, status);
|
outb($60, status);
|
||||||
|
ak:= inb($60);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure hook(hook_method : uint32);
|
procedure hook(hook_method : uint32);
|
||||||
|
@ -69,6 +69,7 @@ begin
|
|||||||
console.writestringlnex('GDT: LOAD FAIL.', console.combinecolors(Red, Black));
|
console.writestringlnex('GDT: LOAD FAIL.', console.combinecolors(Red, Black));
|
||||||
halt_and_catch_fire;
|
halt_and_catch_fire;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
idt.init();
|
idt.init();
|
||||||
isr.init();
|
isr.init();
|
||||||
irq.init();
|
irq.init();
|
||||||
@ -79,7 +80,6 @@ begin
|
|||||||
scheduler.init();
|
scheduler.init();
|
||||||
|
|
||||||
//asm INT 13 end;
|
//asm INT 13 end;
|
||||||
|
|
||||||
STI;
|
STI;
|
||||||
isr32.hook(uint32(@bios_data_area.tick_update));
|
isr32.hook(uint32(@bios_data_area.tick_update));
|
||||||
|
|
||||||
|
@ -66,10 +66,13 @@ type
|
|||||||
UBit30 = 0..(1 shl 30) - 1;
|
UBit30 = 0..(1 shl 30) - 1;
|
||||||
|
|
||||||
TBitMask = bitpacked record
|
TBitMask = bitpacked record
|
||||||
b7,b6,b5,b4,b3,b2,b1,b0 : Boolean;
|
b0,b1,b2,b3,b4,b5,b6,b7 : Boolean;
|
||||||
end;
|
end;
|
||||||
PBitMask = ^TBitMask;
|
PBitMask = ^TBitMask;
|
||||||
|
|
||||||
|
TMask = bitpacked array[0..7] of Boolean;
|
||||||
|
PMask = ^TMask;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user