#include "type.h" #include "const.h" #include "protect.h" #include "string.h" #include "proc.h" #include "global.h" #include "proto.h" #include "stdio.h" int main(int arg, char *argv[]) { int stdin = open("dev_tty0", O_RDWR); int stdout = open("dev_tty0", O_RDWR); int stderr = open("dev_tty0", O_RDWR); char buf[1024]; int pid; int times = 0; printf("操作系统加载完成\n欢迎使用\n"); printf("\n"); while (1) { printf("试点班OS:/ $ "); if (gets(buf) && strlen(buf) != 0) { if (exec(buf) != 0) { printf("exec failed: file not found!\n"); continue; } } } }