diff --git a/Asuro.iso b/Asuro.iso index 5b8ae6b2..7d624aed 100644 Binary files a/Asuro.iso and b/Asuro.iso differ diff --git a/bin/kernel.bin b/bin/kernel.bin index 624bd8e9..96d9b239 100755 Binary files a/bin/kernel.bin and b/bin/kernel.bin differ diff --git a/checksums.md5 b/checksums.md5 index dec6d2dc..4e02fb57 100644 --- a/checksums.md5 +++ b/checksums.md5 @@ -54,7 +54,7 @@ afd15dca933f082c73f48aba1059a04e src/include/lists.pas fcbd8be162a75e1a971fbc58318e077c src/include/strings.pas 01e4c69601c664fff8922f4a0d96c02d src/include/system.pas 6103928fbe8c413929cde49df82f5a1f src/include/types.pas -6e06bfa650488c1f9e328fd99717ecae src/include/util.pas +177a03d217eba976acf0ead9e70d14c0 src/include/util.pas be084ee5d65fdc85182ff87a3f09c831 src/driver/storage/AHCI_OLD.pas e9c1a0807931287779b0295a88faec30 src/driver/storage/AHCI.pas ff442b1dc417a277c68b2890740ea5a2 src/driver/storage/asfs.pas @@ -62,10 +62,10 @@ ff442b1dc417a277c68b2890740ea5a2 src/driver/storage/asfs.pas 15e714c6bf0f6805f95cac019a8ef3ff src/driver/storage/ATA_OLD.pas 631b160eab56da3ce6df8a76b1577452 src/driver/storage/fat32_OLD.pas 0dbc9a5453191d47edbe85a90177e4ca src/driver/storage/fat32.pas -9af5fc15d58531ee6040f2b8d42869b5 src/driver/storage/IDE.pas +7e41b1d061d5ffebd887b5fc65fe655f src/driver/storage/IDE.pas 0843fb9b9ca537d4c595cafc88eac993 src/driver/storage/partitiontable.pas 3437aa5ff213f37f5088ceb690e78d3d src/driver/storage/storagemanagement.pas -55bcf502cfd3623ca39048738a8d0917 src/driver/interface/serial.pas +2b3d1b9259cd2e80a8849515250998be src/driver/interface/serial.pas 24bbc994c12729d6b85026f0881c2ab9 src/driver/exp/testdriver.pas ec93c6fc2b22ac56da6fec164a5da32a src/driver/hid/keyboard.pas 71c5ec91a9f0a148472b21cb7554205d src/driver/hid/mouse.pas diff --git a/iso/boot/asuro.bin b/iso/boot/asuro.bin index 624bd8e9..96d9b239 100755 Binary files a/iso/boot/asuro.bin and b/iso/boot/asuro.bin differ diff --git a/lib/IDE.ppu b/lib/IDE.ppu index ac2db7c0..749921d0 100644 Binary files a/lib/IDE.ppu and b/lib/IDE.ppu differ diff --git a/lib/asuro.ppu b/lib/asuro.ppu index 37c0c494..e8222662 100644 Binary files a/lib/asuro.ppu and b/lib/asuro.ppu differ diff --git a/lib/console.ppu b/lib/console.ppu index af030b0d..e53b75a2 100644 Binary files a/lib/console.ppu and b/lib/console.ppu differ diff --git a/lib/fat32.ppu b/lib/fat32.ppu index 1cf7385d..3c3581a6 100644 Binary files a/lib/fat32.ppu and b/lib/fat32.ppu differ diff --git a/lib/kernel.ppu b/lib/kernel.ppu index 3a10d0ab..cfc10df9 100644 Binary files a/lib/kernel.ppu and b/lib/kernel.ppu differ diff --git a/lib/libpconsole.a b/lib/libpconsole.a index dfee3b42..77032591 100644 Binary files a/lib/libpconsole.a and b/lib/libpconsole.a differ diff --git a/lib/libpmultiboot.a b/lib/libpmultiboot.a index 844bc141..051b471e 100644 Binary files a/lib/libpmultiboot.a and b/lib/libpmultiboot.a differ diff --git a/lib/libpsystem.a b/lib/libpsystem.a index 51afcd6b..2c37d469 100644 Binary files a/lib/libpsystem.a and b/lib/libpsystem.a differ diff --git a/lib/serial.ppu b/lib/serial.ppu index 353f0830..dd4caf8a 100644 Binary files a/lib/serial.ppu and b/lib/serial.ppu differ diff --git a/lib/shell.ppu b/lib/shell.ppu index c9495226..fadc8471 100644 Binary files a/lib/shell.ppu and b/lib/shell.ppu differ diff --git a/lib/terminal.ppu b/lib/terminal.ppu index 17ba431b..ea3d73a1 100644 Binary files a/lib/terminal.ppu and b/lib/terminal.ppu differ diff --git a/lib/tracer.ppu b/lib/tracer.ppu index f754e04b..055936f9 100644 Binary files a/lib/tracer.ppu and b/lib/tracer.ppu differ diff --git a/lib/util.ppu b/lib/util.ppu index 7f4b25c8..2e571bbe 100644 Binary files a/lib/util.ppu and b/lib/util.ppu differ diff --git a/src/driver/interface/serial.pas b/src/driver/interface/serial.pas index ac239799..a184d6cf 100644 --- a/src/driver/interface/serial.pas +++ b/src/driver/interface/serial.pas @@ -20,12 +20,43 @@ procedure init(); function receive(PORT : uint16; timeout : uint32) : uint8; function send(PORT : uint16; data : uint8; timeout : uint32) : boolean; function sendString(str : pchar) : boolean; +function sendHex(i : uint32) : boolean; +procedure soutb(port : uint16; val : uint8); +function sinb(port : uint16) : uint8; implementation uses console; +procedure soutb(port : uint16; val : uint8); +begin + asm + PUSH EAX + PUSH EDX + MOV DX, port + MOV AL, val + OUT DX, AL + POP EDX + POP EAX + end; + io_wait; +end; + +function sinb(port : uint16) : uint8; +begin + asm + PUSH EAX + PUSH EDX + MOV DX, port + IN AL, DX + MOV sinb, AL + POP EDX + POP EAX + end; + io_wait; +end; + procedure IRQ_Hook(); begin @@ -33,13 +64,13 @@ end; procedure initPort(PORT : uint16); begin - outb(PORT + 1, $00); - outb(PORT + 3, $80); - outb(PORT + 0, $03); - outb(PORT + 1, $00); - outb(PORT + 3, $03); - outb(PORT + 2, $C7); - outb(PORT + 4, $0B); + soutb(PORT + 1, $00); + soutb(PORT + 3, $80); + soutb(PORT + 0, $03); + soutb(PORT + 1, $00); + soutb(PORT + 3, $03); + soutb(PORT + 2, $C7); + soutb(PORT + 4, $0B); end; procedure init(); @@ -52,12 +83,12 @@ end; function serial_received(PORT : uint16) : uint32; begin - serial_received:= inb(PORT + 5) AND 1; + serial_received:= sinb(PORT + 5) AND 1; end; function is_transmit_empty(PORT : uint16) : uint32; begin - is_transmit_empty:= inb(PORT + 5) AND $20; + is_transmit_empty:= sinb(PORT + 5) AND $20; end; function receive(PORT : uint16; timeout : uint32) : uint8; @@ -71,7 +102,7 @@ begin dec(_timeout); end; if _timeout <> 0 then begin - receive:= inb(PORT); + receive:= sinb(PORT); end; end; @@ -86,7 +117,7 @@ begin dec(_timeout); end; if _timeout <> 0 then begin - outb(PORT, data); + soutb(PORT, data); send:= true; end; end; @@ -104,4 +135,54 @@ begin sendString:= sendString AND send(COM1, uint8(10), 10000); end; +function sendHex(i : uint32) : boolean; +var + Hex : Array[0..7] of Byte; + Res : DWORD; + Rem : DWORD; + c : Integer; + +begin + for c:=0 to 7 do begin + Hex[c]:= 0; + end; + c:=0; + Res:= i; + Rem:= Res mod 16; + while Res > 0 do begin + Hex[c]:= Rem; + Res:= Res div 16; + Rem:= Res mod 16; + c:=c+1; + end; + send(COM1, uint8('0'), 10000); + send(COM1, uint8('x'), 10000); + for c:=7 downto 0 do begin + if Hex[c] <> 255 then begin + case Hex[c] of + 0:send(COM1, uint8('0'), 10000); + 1:send(COM1, uint8('1'), 10000); + 2:send(COM1, uint8('2'), 10000); + 3:send(COM1, uint8('3'), 10000); + 4:send(COM1, uint8('4'), 10000); + 5:send(COM1, uint8('5'), 10000); + 6:send(COM1, uint8('6'), 10000); + 7:send(COM1, uint8('7'), 10000); + 8:send(COM1, uint8('8'), 10000); + 9:send(COM1, uint8('9'), 10000); + 10:send(COM1, uint8('A'), 10000); + 11:send(COM1, uint8('B'), 10000); + 12:send(COM1, uint8('C'), 10000); + 13:send(COM1, uint8('D'), 10000); + 14:send(COM1, uint8('E'), 10000); + 15:send(COM1, uint8('F'), 10000); + else send(COM1,uint8('?'), 10000); + end; + end; + end; + send(COM1, uint8(13), 10000); + send(COM1, uint8(10), 10000); + sendHex:= true; +end; + end. \ No newline at end of file diff --git a/src/include/util.pas b/src/include/util.pas index e67223d5..f9ad8038 100644 --- a/src/include/util.pas +++ b/src/include/util.pas @@ -68,7 +68,7 @@ var implementation uses - console, RTC, cpu; + console, RTC, cpu, serial, strings; function MsSinceSystemBoot : uint64; begin @@ -272,6 +272,9 @@ end; procedure outl(port : uint16; val : uint32); [public, alias: 'util_outl']; begin + //serial.sendString('[outl]'); + //serial.sendHex(port); + //serial.sendHex(val); asm PUSH EAX PUSH EDX @@ -286,6 +289,9 @@ end; procedure outw(port : uint16; val : uint16); [public, alias: 'util_outw']; begin + //serial.sendString('[outw]'); + //serial.sendHex(port); + //serial.sendHex(val); asm PUSH EAX PUSH EDX @@ -300,6 +306,9 @@ end; procedure outb(port : uint16; val : uint8); [public, alias: 'util_outb']; begin + //serial.sendString('[outb]'); + //serial.sendHex(port); + //serial.sendHex(val); asm PUSH EAX PUSH EDX @@ -328,6 +337,8 @@ end; function inl(port : uint16) : uint32; [public, alias: 'util_inl']; begin + //serial.sendString('[inl]'); + //serial.sendHex(port); asm PUSH EAX PUSH EDX @@ -342,6 +353,8 @@ end; function inw(port : uint16) : uint16; [public, alias: 'util_inw']; begin + //serial.sendString('[inw]'); + //serial.sendHex(port); asm PUSH EAX PUSH EDX @@ -356,6 +369,8 @@ end; function inb(port : uint16) : uint8; [public, alias: 'util_inb']; begin + //serial.sendString('[inb]'); + //serial.sendHex(port); asm PUSH EAX PUSH EDX