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;
|
History : PHistory;
|
||||||
bIndex : uint32 = 0;
|
bIndex : uint32 = 0;
|
||||||
Commands : array[0..65534] of TCommand;
|
Commands : array[0..65534] of TCommand;
|
||||||
|
Working_Directory : PChar = '/';
|
||||||
|
|
||||||
procedure run;
|
procedure run;
|
||||||
procedure init;
|
procedure init;
|
||||||
@ -51,9 +52,23 @@ procedure registerCommand(command : pchar; method : TCommandMethod; description
|
|||||||
function getParams(buf : TCommandBuffer) : PParamList;
|
function getParams(buf : TCommandBuffer) : PParamList;
|
||||||
function paramCount(params : PParamList) : uint32;
|
function paramCount(params : PParamList) : uint32;
|
||||||
function getParam(index : uint32; params : PParamList) : pchar;
|
function getParam(index : uint32; params : PParamList) : pchar;
|
||||||
|
procedure setWorkingDirectory(str : pchar);
|
||||||
|
function getWorkingDirectory : pchar;
|
||||||
|
|
||||||
implementation
|
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;
|
function paramCount(params : PParamList) : uint32;
|
||||||
var
|
var
|
||||||
current : PParamList;
|
current : PParamList;
|
||||||
@ -257,7 +272,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Reset the terminal ready for the next command }
|
{ Reset the terminal ready for the next command }
|
||||||
console.writestring('Asuro#> ');
|
console.writestring('Asuro#');
|
||||||
|
console.writestring(Working_Directory);
|
||||||
|
console.writestring('> ');
|
||||||
bIndex:= 0;
|
bIndex:= 0;
|
||||||
memset(uint32(@buffer[0]), 0, 1024);
|
memset(uint32(@buffer[0]), 0, 1024);
|
||||||
|
|
||||||
@ -285,6 +302,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure change_dir(Params : PParamList);
|
||||||
|
begin
|
||||||
|
if paramCount(Params) > 0 then begin
|
||||||
|
setWorkingDirectory(getParam(0, Params));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure init;
|
procedure init;
|
||||||
begin
|
begin
|
||||||
console.writestringln('TERMINAL: INIT BEGIN.');
|
console.writestringln('TERMINAL: INIT BEGIN.');
|
||||||
@ -296,6 +320,7 @@ begin
|
|||||||
registerCommand('ECHO', @echo, 'Echo''s text to the terminal.');
|
registerCommand('ECHO', @echo, 'Echo''s text to the terminal.');
|
||||||
registerCommand('TESTPARAMS', @testParams, 'Tests param parsing.');
|
registerCommand('TESTPARAMS', @testParams, 'Tests param parsing.');
|
||||||
registerCommand('TEST', @test, 'Command for testing.');
|
registerCommand('TEST', @test, 'Command for testing.');
|
||||||
|
registerCommand('CD', @change_dir, 'Change Directory test');
|
||||||
console.writestringln('TERMINAL: INIT END.');
|
console.writestringln('TERMINAL: INIT END.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -303,7 +328,9 @@ procedure run;
|
|||||||
begin
|
begin
|
||||||
keyboard.hook(@key_event);
|
keyboard.hook(@key_event);
|
||||||
console.clear();
|
console.clear();
|
||||||
console.writestring('Asuro#> ');
|
console.writestring('Asuro#');
|
||||||
|
console.writestring(Working_Directory);
|
||||||
|
console.writestring('> ');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
Loading…
x
Reference in New Issue
Block a user