#include "syscall.h" /* * Compare strings. */ int strcmp(s1, s2) register const char *s1, *s2; { while (*s1 == *s2++) if (*s1++ == 0) return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); } int main() { SpaceId newProc; OpenFileId input = ConsoleInput; OpenFileId output = ConsoleOutput; char prompt[2], ch, 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 ( strcmp( buffer, "exit" ) == 0 ) Exit( 0 ); if( i > 0 ) { newProc = Exec(buffer); Join(newProc); } } }