Add Syscall: Exit, PutChar, GetCar, PutString, GetString
This commit is contained in:
parent
6f405265a5
commit
80fc250109
15 changed files with 359 additions and 17 deletions
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "utility.h"
|
||||
#include "system.h"
|
||||
|
||||
#ifdef USER_PROGRAM
|
||||
#include "progtest.h"
|
||||
#endif
|
||||
|
@ -118,6 +117,7 @@ main (int argc, char **argv)
|
|||
if (!strcmp (*argv, "-x"))
|
||||
{ // run a user program
|
||||
ASSERT (argc > 1);
|
||||
consoledriver = new ConsoleDriver(NULL,NULL);
|
||||
StartProcess (*(argv + 1));
|
||||
argCount = 2;
|
||||
}
|
||||
|
@ -132,6 +132,19 @@ main (int argc, char **argv)
|
|||
argCount = 3;
|
||||
}
|
||||
}
|
||||
#ifdef CHANGED
|
||||
else if (!strcmp (*argv, "-sc"))
|
||||
{ // test the consoledriver
|
||||
if (argc == 1)
|
||||
ConsoleDriverTest (NULL, NULL);
|
||||
else
|
||||
{
|
||||
ASSERT (argc > 2);
|
||||
ConsoleDriverTest (*(argv + 1), *(argv + 2));
|
||||
argCount = 3;
|
||||
}
|
||||
}
|
||||
#endif // CHANGE
|
||||
#endif // USER_PROGRAM
|
||||
#ifdef FILESYS
|
||||
if (!strcmp (*argv, "-cp"))
|
||||
|
|
|
@ -33,7 +33,12 @@ SynchDisk *synchDisk;
|
|||
|
||||
#ifdef USER_PROGRAM // requires either FILESYS or FILESYS_STUB
|
||||
Machine *machine; // user program memory and registers
|
||||
#endif
|
||||
|
||||
#ifdef CHANGED // Define our consoledriver Object
|
||||
ConsoleDriver *consoledriver;
|
||||
#endif // CHANGED
|
||||
|
||||
#endif // USER_PROGRAM
|
||||
|
||||
#ifdef NETWORK
|
||||
PostOffice *postOffice;
|
||||
|
@ -230,6 +235,12 @@ Cleanup ()
|
|||
delete machine;
|
||||
machine = NULL;
|
||||
}
|
||||
#ifdef CHANGED
|
||||
if (consoledriver) {
|
||||
delete consoledriver;
|
||||
consoledriver = NULL;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef FILESYS_NEEDED
|
||||
|
|
|
@ -32,6 +32,13 @@ extern Timer *timer; // the hardware alarm clock
|
|||
#ifdef USER_PROGRAM
|
||||
#include "machine.h"
|
||||
extern Machine *machine; // user program memory and registers
|
||||
|
||||
#ifdef CHANGED
|
||||
#define MAX_STRING_SIZE 8
|
||||
#include "consoledriver.h"
|
||||
extern ConsoleDriver *consoledriver; // add console driver
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef FILESYS_NEEDED // FILESYS or FILESYS_STUB
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue