37 lines
477 B
C
37 lines
477 B
C
#include "syscall.h"
|
|
|
|
int
|
|
main ()
|
|
{
|
|
SpaceId newProc;
|
|
OpenFileId input = ConsoleInput;
|
|
OpenFileId output = ConsoleOutput;
|
|
char prompt[2], buffer[60];
|
|
int i;
|
|
|
|
prompt[0] = '$';
|
|
prompt[1] = ' ';
|
|
|
|
while (1)
|
|
{
|
|
Write (prompt, 2, output);
|
|
|
|
i = 0;
|
|
|
|
do
|
|
{
|
|
|
|
Read (&buffer[i], 1, input);
|
|
|
|
}
|
|
while (buffer[i++] != '\n');
|
|
|
|
buffer[--i] = '\0';
|
|
|
|
if (i > 0)
|
|
{
|
|
newProc = Exec (buffer);
|
|
Join (newProc);
|
|
}
|
|
}
|
|
}
|