Skip to content

Lulkafe/xv6_rpi_port

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is based on xv6_rpi_port kernel, which is a ported version of xv6.
The kernel works on Raspberry Pi but Pi 2, because of differences between RPi ad RPi2 
such as hardware components. The purpose of this repo is to modify the kernel, and make 
it runnable on RPi2. The goal is to pass all test cases by "usertests" command.

The current progress is that the modified OS can run on RPi2, but cannot pass all test cases yet.
The following shows what part is mainly modified:

1. Initialization code for the MMU (entry.s, mmu.c)
2. Base address for I/O (from 0x2000000 to 0x3f000000)
3. Memory barriers and cache maitenance operations in some files (e.g. vm.c, entry.s, or mailbox.c)

and also, synchronize.c/h are added to use the maintenance operations


The following functions are not properly working in the current version:
1. gpuputc()
2. drawpixel()
3. Builtin cache maintenance operations defined in entry.s such as flush_dcache_all()


Any improvements or poiting out my initialization mistakes would be welcomed.
Thanks, 


Seimei Matsusaki 
(smatsusaki@dons.usfca.edu)


The following is from the original README file.

---------------

xv6_rpi_port is based on MIT xv6 (http://pdos.csail.mit.edu/6.828/2012/v6.html).
It is ported from x86 to armv6 in Raspberry Pi (RPI). The rpi port follows
the coding style of xv6 as much as possible to hide the architectural
differences between x86 and armv6. The port is not for multiprocessor yet
as RPI has only a single processor.

ACKNOWLEDGEMENTS

xv6_rpi_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.

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

Building xv6_rpi_port:

Suppose you have checked out the source with:

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

On an RPI installed with Raspbian, type 'make' to make 'kernel.img'.

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

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

Reboot the machine.

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

cd uprogs
make initcode 
make fs.img

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


About

An xv6 port to Raspberry Pi 2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Assembly 80.1%
  • C 19.0%
  • Other 0.9%