annotate README @ 2:77a5fa9bee07 default tip

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