-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
117 lines (95 loc) · 5.65 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
################################################################################
xv6
################################################################################
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 x86-based multiprocessor using ANSI C.
################################################################################
Acknowledgements
################################################################################
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
http://pdos.csail.mit.edu/6.828/2016/xv6.html, which provides pointers to
on-line resources for v6.
xv6 borrows code from the following sources:
JOS (asm.h, elf.h, mmu.h, bootasm.S, ide.c, console.c, and others)
Plan 9 (entryother.S, mp.h, mp.c, lapic.c)
FreeBSD (ioapic.c)
NetBSD (console.c)
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 Silas
Boyd-Wickizer, Anton Burtsev, Cody Cutler, Mike CAT, Tej Chajed, Nelson Elhage,
Saar Ettinger, Alice Ferrazzi, Nathaniel Filardo, Peter Froehlich, Yakir Goaron,
Shivam Handa, Bryan Henry, Jim Huang, Alexander Kapshuk, Anders Kaseorg,
kehao95, Wolfgang Keller, Eddie Kohler, Austin Liew, Imbar Marinescu, Yandong
Mao, Hitoshi Mitake, Carmi Merimovich, Joel Nider, Greg Price, Ayan Shafqat,
Eldar Sehayek, Yongming Shen, Cam Tenny, Rafael Ubal, Warren Toomey, Stephen Tu,
Pablo Ventura, Xi Wang, Keiichi Watanabe, Nicolas Wolovick, Grant Wu, Jindong
Zhang, Icenowy Zheng, and Zou Chang Wei.
The code in the files that constitute xv6 is Copyright 2006-2016 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.828, so we are more interested in simplifications and
clarifications than new features.
For errors and suggestions concerning the modified code, please submit issues on
github.
################################################################################
Building and Running xv6
################################################################################
To build xv6 on an x86 ELF machine (like Linux or FreeBSD), run "make". On
non-x86 or non-ELF machines (like OS X, even on x86), you will need to install a
cross-compiler gcc suite capable of producing x86 ELF binaries. See
http://pdos.csail.mit.edu/6.828/2016/tools.html. Then run "make
TOOLPREFIX=i386-jos-elf-". Now install the QEMU PC simulator and run "make
qemu".
################################################################################
Modifications
################################################################################
xv6 now comes with user programs umt2umb, umbverif, umb2x86, and system call
sbrkx. It also comes with extended file size.
The added user programs are for manipulating sume32. They all take a single file
as input, and output to stdout.
Two programs are also provided to test sume32. These are fibtest and revtest.
These come with the files fib.umt and rev.umt.
To test the suite, do the following:
$ umt2umb fib.umt > fib.umb
$ umbverif fib.umb
$ umb2x86 fib.umb > fib.asm
$ fibtest fib.asm
The first step takes a sume32 text file as input and outputs a sume32 binary
file. You may notice that it is significantly more compact in the binary format.
The second step verifies the sume32 binary file and outputs either "verification
failed" or "verification succeeded" to stdout.
The third step compiles the sume32 binary file into raw position independent x86
machine code. Note that the x86 that is output is meant to be called with three
parameters: the heap pointer, heap size, and stack pointer.
fibtest takes a raw x86 binary and runs it on an array of integers, and outputs
the resulting integers. The fib.umt file describes a sume32 text program that
runs the recursive fibonacci algorithm on every integer in its heap.
You can similarly test rev.umt. The rev.umt file describes a sume32 program that
reverses the bytes in its heap. The revtest program loads a raw binary and runs
in on "\0!dlrow olleH" and outputs the result.
The extended file size was implemented by replacing the single indirect pointer
in the inodes with a double indirect pointer, increasing the maximum file size
to 2103296 bytes.
sbrkx takes a pointer and size and writes the information to pages before
switching them to executable. It then returns a pointer to the executable code.
################################################################################
sume32
################################################################################
sume32 is a loose subset of wasm. It contains most of the integer and control
flow instructions of wasm. It lacks floating point, memory resizing, and linking
instructions.
################################################################################
Performance
################################################################################
Currently, the translation, verification, and compilation take place in separate
passes. However, these could be combined into a single pass to increase
performance. Additionally, the compilation code could be significantly more
efficient by optimizing the provided sume32 binary.