/xv6_rpi2_port

This is an xv6 port on Raspberry Pi 2 and 3

Primary LanguageCOtherNOASSERTION

xv6_rpi2_port is based on MIT xv6 (http://pdos.csail.mit.edu/6.828/2012/v6.html).
It is ported from x86 to armv6 and then to armv7 in Raspberry Pi (RPI2/3). 
The rpi port follows the coding style of xv6 as much as possible to hide the architectural
differences between x86 and armv6/armv7. The port is not for multiprocessor yet
though RPI2/3 has four cores.

ACKNOWLEDGEMENTS

xv6_rpi2_port is inspired by MIT xv6 and Alex Chadwick's Baking Pi 
Tutorials (http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/).
Most architecture-independent code is directly from MIT xv6 though sometimes
minor adjustments were done to explicitly initialize data structures.
Some C code such as the GPU driver is based on the understanding of 
Alex Chadwick's assembly code. 

Some code for mmu and trap handling is based on the understanding of the
Plan 9 bcm port (http://plan9.bell-labs.com/sources/plan9/sys/src/9/bcm/),
though the assembly code was completely rewritten. 
David Welch's RPI code (https://github.com/dwelch67/raspberrypi) is also
inspiring for trap handling and uart driver.

Mahdi Amiri Kordestany (mahdi@cs.otago.ac.nz) ported xv6 from RPI1 to
RPI2/3.

If you spot errors or suggest improvements, please send email to
Zhiyi Huang (hzy@cs.otago.ac.nz).

Building xv6_rpi2_port:

Suppose you have checked out the source with:

$ git clone https://github.com/zhiyihuang/xv6_rpi2_port.git

On an RPI2/3 installed with Raspbian, type 'make loader' to make 'kernel7.img'.

Copy 'kernel7.img' to /boot with a different name:
# cp kernel7.img /boot/kernel-xv6.img

Comment out the old entry 'kernel=' and add a new entry
'kernel=kernel-xv6.img' to /boot/config.txt.

Add the following into /boot/config.txt:

kernel_old=1
disable_commandline_tags=1
enable_uart=1


Reboot the machine.

The USB keyboard is not working yet. The only way to input into
the console is to use the mini UART (serial port). You can use a 
USB to TTL Serial Cable to connect the mini UART to a virtual terminal.
You may use minicom or CoolTerm to create the virtual terminal.
You have to open the lid to connect the cable to the GPIO pins (14 and 15) 
of the Pi. 

Building xv6 user programs and FS (You don't need this step if you
don't change the user programs):

cd uprogs
make 

copy 'initcode' and 'fs.img' to the directory 'source'