0
|
1 xv6_rpi2_port is based on MIT xv6 (http://pdos.csail.mit.edu/6.828/2012/v6.html).
|
|
2 It is ported from x86 to armv6 and then to armv7 in Raspberry Pi (RPI2/3).
|
|
3 The rpi port follows the coding style of xv6 as much as possible to hide the architectural
|
|
4 differences between x86 and armv6/armv7. The port is not for multiprocessor yet
|
|
5 though RPI2/3 has four cores.
|
|
6
|
|
7 ACKNOWLEDGEMENTS
|
|
8
|
|
9 xv6_rpi2_port is inspired by MIT xv6 and Alex Chadwick's Baking Pi
|
|
10 Tutorials (http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/).
|
|
11 Most architecture-independent code is directly from MIT xv6 though sometimes
|
|
12 minor adjustments were done to explicitly initialize data structures.
|
|
13 Some C code such as the GPU driver is based on the understanding of
|
|
14 Alex Chadwick's assembly code.
|
|
15
|
|
16 Some code for mmu and trap handling is based on the understanding of the
|
|
17 Plan 9 bcm port (http://plan9.bell-labs.com/sources/plan9/sys/src/9/bcm/),
|
|
18 though the assembly code was completely rewritten.
|
|
19 David Welch's RPI code (https://github.com/dwelch67/raspberrypi) is also
|
|
20 inspiring for trap handling and uart driver.
|
|
21
|
|
22 Mahdi Amiri Kordestany (mahdi@cs.otago.ac.nz) ported xv6 from RPI1 to
|
|
23 RPI2/3.
|
|
24
|
|
25 If you spot errors or suggest improvements, please send email to
|
|
26 Zhiyi Huang (hzy@cs.otago.ac.nz).
|
|
27
|
|
28 Building xv6_rpi2_port:
|
|
29
|
|
30 Suppose you have checked out the source with:
|
|
31
|
|
32 $ git clone https://github.com/zhiyihuang/xv6_rpi2_port.git
|
|
33
|
|
34 On an RPI2/3 installed with Raspbian, type 'make loader' to make 'kernel7.img'.
|
|
35
|
|
36 Copy 'kernel7.img' to /boot with a different name:
|
|
37 # cp kernel7.img /boot/kernel-xv6.img
|
|
38
|
|
39 Comment out the old entry 'kernel=' and add a new entry
|
|
40 'kernel=kernel-xv6.img' to /boot/config.txt.
|
|
41
|
|
42 Add the following into /boot/config.txt:
|
|
43
|
|
44 kernel_old=1
|
|
45 disable_commandline_tags=1
|
|
46 enable_uart=1
|
|
47
|
|
48
|
|
49 Reboot the machine.
|
|
50
|
|
51 The USB keyboard is not working yet. The only way to input into
|
|
52 the console is to use the mini UART (serial port). You can use a
|
|
53 USB to TTL Serial Cable to connect the mini UART to a virtual terminal.
|
|
54 You may use minicom or CoolTerm to create the virtual terminal.
|
|
55 You have to open the lid to connect the cable to the GPIO pins (14 and 15)
|
|
56 of the Pi.
|
|
57
|
|
58 Building xv6 user programs and FS (You don't need this step if you
|
|
59 don't change the user programs):
|
|
60
|
|
61 cd uprogs
|
|
62 make
|
|
63
|
|
64 copy 'initcode' and 'fs.img' to the directory 'source'
|
|
65
|