BigOS/user/shell_chn.c
2023-01-15 16:10:09 +08:00

33 lines
591 B
C

#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;
}
}
}
}