diff --git a/README b/README index 5b711b1..ed8bba5 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ ACKNOWLEDGMENTS xv6 is inspired by John Lions's Commentary on UNIX 6th Edition (Peer to Peer Communications; ISBN: 1-57398-013-7; 1st edition (June 14, -2000)). See also https://pdos.csail.mit.edu/6.828/, which provides +2000)). See also https://pdos.csail.mit.edu/6.1810/, which provides pointers to on-line resources for v6. The following people have made contributions: Russ Cox (context switching, @@ -14,29 +14,31 @@ locking), Cliff Frey (MP), Xiao Yu (MP), Nickolai Zeldovich, and Austin Clements. We are also grateful for the bug reports and patches contributed by -Takahiro Aoyagi, Silas Boyd-Wickizer, Anton Burtsev, Ian Chen, Dan -Cross, Cody Cutler, Mike CAT, Tej Chajed, Asami Doi, eyalz800, Nelson -Elhage, Saar Ettinger, Alice Ferrazzi, Nathaniel Filardo, flespark, -Peter Froehlich, Yakir Goaron, Shivam Handa, Matt Harvey, Bryan Henry, -jaichenhengjie, Jim Huang, Matúš Jókay, Alexander Kapshuk, Anders -Kaseorg, kehao95, Wolfgang Keller, Jungwoo Kim, Jonathan Kimmitt, -Eddie Kohler, Vadim Kolontsov, Austin Liew, l0stman, Pavan -Maddamsetti, Imbar Marinescu, Yandong Mao, Matan Shabtay, Hitoshi -Mitake, Carmi Merimovich, Mark Morrissey, mtasm, Joel Nider, -OptimisticSide, Greg Price, Jude Rich, Ayan Shafqat, Eldar Sehayek, -Yongming Shen, Fumiya Shigemitsu, Cam Tenny, tyfkda, Warren Toomey, -Stephen Tu, Rafael Ubal, Amane Uehara, Pablo Ventura, Xi Wang, Keiichi -Watanabe, Nicolas Wolovick, wxdao, Grant Wu, Jindong Zhang, Icenowy -Zheng, ZhUyU1997, and Zou Chang Wei. +Takahiro Aoyagi, Silas Boyd-Wickizer, Anton Burtsev, carlclone, Ian +Chen, Dan Cross, Cody Cutler, Mike CAT, Tej Chajed, Asami Doi, +eyalz800, Nelson Elhage, Saar Ettinger, Alice Ferrazzi, Nathaniel +Filardo, flespark, Peter Froehlich, Yakir Goaron, Shivam Handa, Matt +Harvey, Bryan Henry, jaichenhengjie, Jim Huang, Matúš Jókay, John +Jolly, Alexander Kapshuk, Anders Kaseorg, kehao95, Wolfgang Keller, +Jungwoo Kim, Jonathan Kimmitt, Eddie Kohler, Vadim Kolontsov, Austin +Liew, l0stman, Pavan Maddamsetti, Imbar Marinescu, Yandong Mao, Matan +Shabtay, Hitoshi Mitake, Carmi Merimovich, Mark Morrissey, mtasm, Joel +Nider, Hayato Ohhashi, OptimisticSide, Harry Porter, Greg Price, Jude +Rich, segfault, Ayan Shafqat, Eldar Sehayek, Yongming Shen, Fumiya +Shigemitsu, Cam Tenny, tyfkda, Warren Toomey, Stephen Tu, Rafael Ubal, +Amane Uehara, Pablo Ventura, Xi Wang, WaheedHafez, Keiichi Watanabe, +Nicolas Wolovick, wxdao, Grant Wu, Jindong Zhang, Icenowy Zheng, +ZhUyU1997, and Zou Chang Wei. + The code in the files that constitute xv6 is -Copyright 2006-2020 Frans Kaashoek, Robert Morris, and Russ Cox. +Copyright 2006-2022 Frans Kaashoek, Robert Morris, and Russ Cox. ERROR REPORTS Please send errors and suggestions to Frans Kaashoek and Robert Morris (kaashoek,rtm@mit.edu). The main purpose of xv6 is as a teaching -operating system for MIT's 6.S081, so we are more interested in +operating system for MIT's 6.1810, so we are more interested in simplifications and clarifications than new features. BUILDING AND RUNNING XV6 diff --git a/kernel/sysproc.c b/kernel/sysproc.c index 1de184e..3b4d5bd 100644 --- a/kernel/sysproc.c +++ b/kernel/sysproc.c @@ -55,6 +55,8 @@ sys_sleep(void) uint ticks0; argint(0, &n); + if(n < 0) + n = 0; acquire(&tickslock); ticks0 = ticks; while(ticks - ticks0 < n){ diff --git a/user/cat.c b/user/cat.c index 598f005..520dc8b 100644 --- a/user/cat.c +++ b/user/cat.c @@ -1,5 +1,6 @@ #include "kernel/types.h" #include "kernel/stat.h" +#include "kernel/fcntl.h" #include "user/user.h" char buf[512]; @@ -32,7 +33,7 @@ main(int argc, char *argv[]) } for(i = 1; i < argc; i++){ - if((fd = open(argv[i], 0)) < 0){ + if((fd = open(argv[i], O_RDONLY)) < 0){ fprintf(2, "cat: cannot open %s\n", argv[i]); exit(1); } diff --git a/user/grep.c b/user/grep.c index 2315a0c..6c33766 100644 --- a/user/grep.c +++ b/user/grep.c @@ -2,6 +2,7 @@ #include "kernel/types.h" #include "kernel/stat.h" +#include "kernel/fcntl.h" #include "user/user.h" char buf[1024]; @@ -51,7 +52,7 @@ main(int argc, char *argv[]) } for(i = 2; i < argc; i++){ - if((fd = open(argv[i], 0)) < 0){ + if((fd = open(argv[i], O_RDONLY)) < 0){ printf("grep: cannot open %s\n", argv[i]); exit(1); } diff --git a/user/ls.c b/user/ls.c index c67b84b..b32c200 100644 --- a/user/ls.c +++ b/user/ls.c @@ -2,6 +2,7 @@ #include "kernel/stat.h" #include "user/user.h" #include "kernel/fs.h" +#include "kernel/fcntl.h" char* fmtname(char *path) @@ -30,7 +31,7 @@ ls(char *path) struct dirent de; struct stat st; - if((fd = open(path, 0)) < 0){ + if((fd = open(path, O_RDONLY)) < 0){ fprintf(2, "ls: cannot open %s\n", path); return; } diff --git a/user/wc.c b/user/wc.c index 6a851ca..d8f3b2a 100644 --- a/user/wc.c +++ b/user/wc.c @@ -1,5 +1,6 @@ #include "kernel/types.h" #include "kernel/stat.h" +#include "kernel/fcntl.h" #include "user/user.h" char buf[512]; @@ -43,7 +44,7 @@ main(int argc, char *argv[]) } for(i = 1; i < argc; i++){ - if((fd = open(argv[i], 0)) < 0){ + if((fd = open(argv[i], O_RDONLY)) < 0){ printf("wc: cannot open %s\n", argv[i]); exit(1); }