diff --git a/Asuro.iso b/Asuro.iso index cb7e1877..9591480a 100644 Binary files a/Asuro.iso and b/Asuro.iso differ diff --git a/bin/kernel.bin b/bin/kernel.bin index e8adf5a5..1364d416 100755 Binary files a/bin/kernel.bin and b/bin/kernel.bin differ diff --git a/iso/boot/asuro.bin b/iso/boot/asuro.bin index e8adf5a5..1364d416 100755 Binary files a/iso/boot/asuro.bin and b/iso/boot/asuro.bin differ diff --git a/lib/kernel.ppu b/lib/kernel.ppu index 6beaa8be..440233c2 100644 Binary files a/lib/kernel.ppu and b/lib/kernel.ppu differ diff --git a/lib/libpconsole.a b/lib/libpconsole.a index 8fc8897e..2dc36c67 100644 Binary files a/lib/libpconsole.a and b/lib/libpconsole.a differ diff --git a/lib/libpmultiboot.a b/lib/libpmultiboot.a index 6a385612..d03623fc 100644 Binary files a/lib/libpmultiboot.a and b/lib/libpmultiboot.a differ diff --git a/lib/libpsystem.a b/lib/libpsystem.a index 285809cf..2382d5d8 100644 Binary files a/lib/libpsystem.a and b/lib/libpsystem.a differ diff --git a/src/terminal.pas b/src/terminal.pas index 6963d133..d0c88f79 100644 --- a/src/terminal.pas +++ b/src/terminal.pas @@ -4,27 +4,46 @@ interface uses console, - keyboard; + keyboard, + util; var - buffer : array[0..1024] of byte; + buffer : array[0..1023] of byte; bIndex : uint32 = 0; procedure run; implementation +function isCommand(command : pchar) : boolean; +var + i : uint32; + +begin + isCommand:= true; + for i:=0 to bIndex do begin + if char(buffer[i]) = ' ' then exit; + if char(buffer[i]) <> char(command[i]) then begin + isCommand:= false; + exit; + end; + end; +end; + procedure process_command; begin console.writecharln(' '); + //Process Here + if isCommand('version') then console.writestringln('Asuro v1.0'); console.writestring('Asuro#> '); bIndex:= 0; + memset(uint32(@buffer[0]), 0, 1024); end; procedure key_event(info : TKeyInfo); begin if (info.key_code >= 32) and (info.key_code <= 126) then begin - if bIndex <= 1024 then begin + if bIndex < 1024 then begin buffer[bIndex]:= info.key_code; inc(bIndex); console.writechar(char(info.key_code)); @@ -44,6 +63,7 @@ end; procedure run; begin + memset(uint32(@buffer[0]), 0, 1024); keyboard.hook(@key_event); console.clear(); console.writestring('Asuro#> ');