git-svn-id: https://spexeah.com:8443/svn/Asuro@494 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
4b1596675c
commit
2d061d834c
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
Binary file not shown.
BIN
lib/E1000.ppu
BIN
lib/E1000.ppu
Binary file not shown.
BIN
lib/IDE.ppu
BIN
lib/IDE.ppu
Binary file not shown.
Binary file not shown.
BIN
lib/ipv4.ppu
BIN
lib/ipv4.ppu
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.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.
BIN
lib/terminal.ppu
BIN
lib/terminal.ppu
Binary file not shown.
BIN
lib/util.ppu
BIN
lib/util.ppu
Binary file not shown.
@ -44,6 +44,7 @@ var
|
||||
History : PHistory;
|
||||
bIndex : uint32 = 0;
|
||||
Commands : array[0..65534] of TCommand;
|
||||
Working_Directory : PChar = '/';
|
||||
|
||||
procedure run;
|
||||
procedure init;
|
||||
@ -51,9 +52,23 @@ procedure registerCommand(command : pchar; method : TCommandMethod; description
|
||||
function getParams(buf : TCommandBuffer) : PParamList;
|
||||
function paramCount(params : PParamList) : uint32;
|
||||
function getParam(index : uint32; params : PParamList) : pchar;
|
||||
procedure setWorkingDirectory(str : pchar);
|
||||
function getWorkingDirectory : pchar;
|
||||
|
||||
implementation
|
||||
|
||||
function getWorkingDirectory : pchar;
|
||||
begin
|
||||
getWorkingDirectory:= Working_Directory;
|
||||
end;
|
||||
|
||||
procedure setWorkingDirectory(str : pchar);
|
||||
begin
|
||||
if str <> nil then begin
|
||||
Working_Directory:= stringCopy(str);
|
||||
end;
|
||||
end;
|
||||
|
||||
function paramCount(params : PParamList) : uint32;
|
||||
var
|
||||
current : PParamList;
|
||||
@ -257,7 +272,9 @@ begin
|
||||
end;
|
||||
|
||||
{ Reset the terminal ready for the next command }
|
||||
console.writestring('Asuro#> ');
|
||||
console.writestring('Asuro#');
|
||||
console.writestring(Working_Directory);
|
||||
console.writestring('> ');
|
||||
bIndex:= 0;
|
||||
memset(uint32(@buffer[0]), 0, 1024);
|
||||
|
||||
@ -285,6 +302,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure change_dir(Params : PParamList);
|
||||
begin
|
||||
if paramCount(Params) > 0 then begin
|
||||
setWorkingDirectory(getParam(0, Params));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
console.writestringln('TERMINAL: INIT BEGIN.');
|
||||
@ -296,6 +320,7 @@ begin
|
||||
registerCommand('ECHO', @echo, 'Echo''s text to the terminal.');
|
||||
registerCommand('TESTPARAMS', @testParams, 'Tests param parsing.');
|
||||
registerCommand('TEST', @test, 'Command for testing.');
|
||||
registerCommand('CD', @change_dir, 'Change Directory test');
|
||||
console.writestringln('TERMINAL: INIT END.');
|
||||
end;
|
||||
|
||||
@ -303,7 +328,9 @@ procedure run;
|
||||
begin
|
||||
keyboard.hook(@key_event);
|
||||
console.clear();
|
||||
console.writestring('Asuro#> ');
|
||||
console.writestring('Asuro#');
|
||||
console.writestring(Working_Directory);
|
||||
console.writestring('> ');
|
||||
end;
|
||||
|
||||
end.
|
Loading…
x
Reference in New Issue
Block a user