forked from salewski/xv6-minix2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NOTES
87 lines (68 loc) · 3.41 KB
/
NOTES
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
Introduction
------------
xv is a minimalist Unix-like operating system, inspired by 6th Edition Unix
and the Lions Commentary on 6th Edition Unix. xv6's purpose is to teach
students about the workings of an operating system.
Website: https://pdos.csail.mit.edu/6.828/2014/xv6.html
xv is purposefully pared down from a real Unix-like system.
It only has these system calls:
chdir close dup exec exit fork fstat getpid kill
link lseek mkdir mknod open pipe read sbrk sleep
unlink uptime wait write
Among the many things missing from xv6 are:
- no users, every user is effectively root
- no file permissions
- no signals, job control, networking
Project Aim
-----------
The aim of this project is to give xv6 as much of a Unix library and run-time
environment as possible without altering the kernel source code. Examples:
- add in ANSI C functions: strings, memory functions, malloc etc.
- add in a Stdio library: fopen, fclose, printf etc.
- regexps
- simulate some syscalls calls with existing syscalls,
or write dummy syscalls
- port existing programs to provide a run-time environment
So far I (Warren Toomey) have taken much of the Minix 2.0 header files,
library code and a few commands and made them compile on the system.
To Do
-----
In no particular order:
- Get the xv6 kernel to compile with the Minix headers, to ensure that
the kernel and libraries use consistent values
==> No, on second thoughts, we should not do this. The xv6 folk will
still want to print their book of code. We should align the xv6 files
and the library code, but not force the xv6 code to include the Minix
headers
- Modify the library code to correctly use the xv6 system calls
- Write missing library functionality, e.g. opendir (DONE), more to do
- Write dummy library functions
- Compile more of the Minix commands
- Test everything to ensure that it works
- DONE: Write a more functional mkfs so that a multi-level filesystem
can be built, one that has /etc, /bin and friends
Sunday 17 July 21:21:21 AEST 2016 - Warren
-------------------------------------------
A reasonably successful weekend. I changed mkfs to create subdirs and got
it to build a filesystem image by cloning a local directory and its
subdirectories. Then I changed the shell to look in /bin for binaries. I
changed init to live in /etc and to start /bin/sh. Now we have a filesystem
which looks vaguely Unix-like.
I wrote a new ls whose output better resembles a Unix ls, with -d, -a and -l
flags. I got ed to compile and run. I finally got cp to work, and in doing
so I'm using the stdio functions, so they seem to work as well.
The next task is to bring in more of the simple Minix commands. I'm
struggling with getting grep to compile and link against the regexp
library functions.
I also need to go back and remove some of my changes to kern/* and
include/xv6/*, to get them back to a format which the MIT people can print.
Monday 18 July 17:28:22 AEST 2016 - Warren
-------------------------------------------
I have reverted some of the xv6 file changes, so the code can be printed
again and it doesn't refer to any of the Minix header files.
Sunday 24 July 10:30:13 AEST 2016 - Warren
-------------------------------------------
I've got a few big programs up and running: less, levee (a vi clone) and
my wish shell. I've written a few more system call replacements. I've
increased the filesystem block size to 1K, and I've also added exit
values to the kernel.