Use the major number defined in file.h. The minor number is ignored;

might as well use 0.
This commit is contained in:
Frans Kaashoek 2020-08-18 20:48:53 -04:00
parent 740d363736
commit b33574df38

View file

@ -2,6 +2,10 @@
#include "kernel/types.h" #include "kernel/types.h"
#include "kernel/stat.h" #include "kernel/stat.h"
#include "kernel/spinlock.h"
#include "kernel/sleeplock.h"
#include "kernel/fs.h"
#include "kernel/file.h"
#include "user/user.h" #include "user/user.h"
#include "kernel/fcntl.h" #include "kernel/fcntl.h"
@ -13,7 +17,7 @@ main(void)
int pid, wpid; int pid, wpid;
if(open("console", O_RDWR) < 0){ if(open("console", O_RDWR) < 0){
mknod("console", 1, 1); mknod("console", CONSOLE, 0);
open("console", O_RDWR); open("console", O_RDWR);
} }
dup(0); // stdout dup(0); // stdout