Use the major number defined in file.h. The minor number is ignored;
might as well use 0.
This commit is contained in:
		
							parent
							
								
									3c25112f38
								
							
						
					
					
						commit
						d4d487731a
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2,6 +2,10 @@
 | 
			
		|||
 | 
			
		||||
#include "kernel/types.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 "kernel/fcntl.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -13,7 +17,7 @@ main(void)
 | 
			
		|||
  int pid, wpid;
 | 
			
		||||
 | 
			
		||||
  if(open("console", O_RDWR) < 0){
 | 
			
		||||
    mknod("console", 1, 1);
 | 
			
		||||
    mknod("console", CONSOLE, 0);
 | 
			
		||||
    open("console", O_RDWR);
 | 
			
		||||
  }
 | 
			
		||||
  dup(0);  // stdout
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue