-
Notifications
You must be signed in to change notification settings - Fork 0
UNIX-like operating system for RISC-V in C
License
leoforney/xv6-risc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
xv6 is a re-implementation of Dennis Ritchie's and Ken Thompson's Unix Version 6 (v6). xv6 loosely follows the structure and style of v6, but is implemented for a modern RISC-V multiprocessor using ANSI C. 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 pointers to on-line resources for v6. The following people have made contributions: Russ Cox (context switching, 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. The code in the files that constitute xv6 is Copyright 2006-2020 Frans Kaashoek, Robert Morris, and Russ Cox. ERROR REPORTS Please send errors and suggestions to Frans Kaashoek and Robert Morris (kaashoek,[email protected]). The main purpose of xv6 is as a teaching operating system for MIT's 6.S081, so we are more interested in simplifications and clarifications than new features. BUILDING AND RUNNING XV6 You will need a RISC-V "newlib" tool chain from https://github.com/riscv/riscv-gnu-toolchain, and qemu compiled for riscv64-softmmu. Once they are installed, and in your shell search path, you can run "make qemu". ##1B FILES CREATED BY LEO FORNEY (I WORK SOLO) - Created kernel/pstat.h, contains information about running processes on system including nice val, pid, and inuse - Created user/nice.c, command that allows you to set the nice value of a specific program - Created user/pstat.c command that allows you to see the all available processes on system and the associated nice, pid, and inuse values FILES MODIFIED BY LEO FORNEY (I STILL WORK SOLO) - Modified kernel/proc.c added nice value initialization - Modified kernel/proc.h to add nice value in process table - Modified kernel/sysproc.c to add nice and getpstat system calls - Modified user/usys.pl and added entry for nice and getpstat system calls - Modified Makefile and added $U/_nice and $U/_pstat programs to be used in shell ##1C FILES MODIFIED BY LEO FORNEY (I WORK SOLO) - Created scheduler_rr() and scheduler_stride() in kernel/proc.c - Created qtable in kernel/proc.h - Created user/schedtest.c to test forking and the stride scheduler - Modified Makefile to include user/schedtest.c - Modified user/pstat.c to list all information about the processes including pass, runtime, and stride - Modified kernel/sysproc.c to add information in the new elements that are in kernel/pstat.h - Added SCHEDULER macro in kernel/param.h and added switch to choose scheduler in kernel/main.c - Modified kernel/defs.h and added roundrobin and stride scheduler calls Results for 3.4: $ schedtest Hi I'm the child1 My PID is: 4 Hi I'm the child2 My PID is: 5 Child 1 Run: 7, Pass: 173734, Stride: 22222 Child 2 Run: 3, Pass: 236358, Stride: 66666 Child 1 Run: 15, Pass: 351510, Stride: 22222 Child 2 Run: 5, Pass: 369690, Stride: 66666 Child 1 Run: 22, Pass: 507064, Stride: 22222 Child 2 Run: 8, Pass: 569688, Stride: 66666 Child 1 Run: 30, Pass: 684840, Stride: 22222 Child 2 Run: 10, Pass: 703020, Stride: 66666 Child 1 Run: 37, Pass: 840394, Stride: 22222 Child 2 Run: 13, Pass: 903018, Stride: 66666 Child 1 Run: 45, Pass: 1018170, Stride: 22222 Child 2 Run: 15, Pass: 1036350, Stride: 66666 Child 1 Run: 52, Pass: 1173724, Stride: 22222 Child 2 Run: 18, Pass: 1236348, Stride: 66666 Child 1 Run: 60, Pass: 1351500, Stride: 22222 Child 2 Run: 20, Pass: 1369680, Stride: 66666 Child 1 Run: 67, Pass: 1507054, Stride: 22222 Child 2 Run: 23, Pass: 1569678, Stride: 66666 Child 1 Run: 75, Pass: 1684830, Stride: 22222 Child 2 Run: 25, Pass: 1703010, Stride: 66666 In user/schedtest.c you can see that child 1 has a nice value of 14 while child 2 has a nice value of 19 Screenshot of console output: https://postimg.cc/k2pgTYkX
About
UNIX-like operating system for RISC-V in C
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published