Skip to content

Latest commit



74 lines (60 loc) · 2.89 KB

File metadata and controls

74 lines (60 loc) · 2.89 KB

xv6 GAIA port

xv6 port

This is a port of xv6 to GAIA, our own CPU architecture.
We did this at the student experiment at The University of Tokyo.
Rewriting xv6 is mainly done by @nullpo-head, @warelle and @m-hys.
Many improvements are also done by other team members.

To make xv6 work on GAIA, we did

  • Rewrite all x86 dependent codes such as booting, interrupt, peripherals or task switch.
    This was indeed heavy, but not as heavy as expected at first.
  • Support page coloring.
    To handle the cache coherency problem GAIA has at present.

About 1000 lines modifications are needed for these tasks.
For diff, see

There is an experimental online demo of xv6-gaia by Javascript. Try it!.

Original xv6

The original xv6 is a simple Unix like OS for education by MIT, which is targeted at x86.
For more detail, see

What we did for porting

Porting needs much more than just rewriting xv6. Here is what we did for porting.

Create toolchain

  • Create the almost C89 compatible compiler
    Maybe this is the biggest task. We made an almost C89 compatible compiler, UCC.
    This is done by @kw-udon, @b-inary and @wasabiz.
    The repository is at
  • Create the assembler
    We made a simple but powerful assembler by python. This is done by @b-inary.
  • Create the linker
    The linking is done by some ruby scripts and makefile. This is done by @nullpo-head

Create CPU simulator

A software CPU simulator is necessary to develop CPU.
@b-inary mainly made this.

Create CPU

  • Design CPU architecture
    @b-inary and @wasabiz designed GAIA architecture.
    @nullpo-head also joined for interruption and MMU.
  • Create CPU by VHDL
    GAIA is implemented on FPGA, Virtex-5.
    @wasabiz wrote all VHDL source by hisself.
    The repositroy is at


We also did some improvements.

  • Add user programs
    pwd, tiny vi clone, sl, 2048 and many user programs are added.
    Try sl at least once!!
  • Clean up the source codes
    We separated kernel and user programs into different directories.
    We also introduced a subset of standard libc. You can include '<stdio.h>', instead of '"user.h"'.

Team members

Xv6 porting is done in 4 months by