Code Monkey home page Code Monkey logo

aimv6's Introduction

AIMv6

Reimplementation and extension of the teaching operating system xv6 on multiple platforms.

Architectures (to be) included: ARM, MIPS64, i386 (the original xv6 implementation)

Our first goal is to port xv6 onto ARM and MIPS64 (Loongson 2H).

The guides to organize source codes can be found in each directory under FILE.

Remember to add license information on top of the source code :)

This repository supersedes xv6-Loongson3A, the code from which will be migrated there.

Please refer to the doc directory for documentations.

Toolchain

Ideally, the project should be compiled by the latest GCC (or cross-GCC if cross-compiling) toolchain available on Linux distro.

If prebuilt packages are not available, please use precompiled binaries and libraries provided by manufacturers.

If you're a determined, patient geek, you can build your own cross-compiler from source code, as illustrated below.

Fedora

Fedora ships cross-compiler packages since release 18, and there's really no reason to keep using unsupported old versions.

To install MIPS toolchain, execute (replace dnf with yum if you're running older release)

# dnf install gcc-mips64-linux-gnu

Installing ARM toolchain is similar:

# dnf install gcc-arm-linux-gnu

Debian (not tested)

Cross-compilers are provided in sid, or unstable branch in Debian.

Unfortunately, one should usually upgrade to unstable from testing, which, in turn, should be upgraded from stable.

If you don't want to risk your machine being "unstable" (though not unstable as it seems - Ubuntu is based on Debian unstable branch), or regard the whole process as troublesome, simply jump to the Third-party section.

Upgrading between branches is simply done by modifying /etc/apt/sources.list and changing sources from testing to unstable.

After upgrading, the toolchains could be installed by

$ sudo apt-get install gcc-4.9-arm-linux-gnueabi

if you're playing with ARM board, or

$ sudo apt-get install gcc-4.9-mipsel-linux-gnu

if you're hacking a Loongson box.

Replace 4.9 with 5 if you want to try GCC 5.

Ubuntu (not tested)

Awkwardly, Ubuntu ships gcc-4.9-arm-linux-gnueabi, but does not ship the MIPS equivalent.

For ARM developers, running

$ sudo apt-get install gcc-arm-linux-gnueabi

would do everything.

Obtaining MIPS toolchain is somewhat more complicated. First, you need to install gdebi:

$ sudo apt-get install gdebi

Download and install by gdebi the following .deb packages from Debian sid repository, in the order given:
binutils-mipsel-linux-gnu
cpp-4.9-mipsel-linux-gnu
gcc-4.9-mipsel-linux-gnu

Third-party

Loongson provided the compiler suite for building kernel here However, Loongson only supports GCC 4.4.0, which is quite obsolete compared to the now-popular version 4.9.x or 5.x.x.

Another good choice is Sourcery Codebench from Mentor Graphics. The MIPS toolchain archive could be downloaded here.

$PATH (and $LD_LIBRARY_PATH for Loongson's compiler) should be modified accordingly to contain the binaries and libraries provided. Read /etc/profile and put the paths into appropriate files and/or locations.

(TODO: add third-party ARM cross-compiler providers)

Build from source

(TODO: write source build instructions for ARM/IA32/MIPS)

aimv6's People

Contributors

barclayii avatar davidgao avatar leon001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aimv6's Issues

zed not booting

compiled the FSBL template, with verbose logs.
running perfect on jtag
no output when standalone booting
tried hand-written fsbl, no use.
configured MIO, no use.
packed boot.bin and wrote boot header by hand, no use.

got stuck.

anyway i can always skip this part and fake an MBR with uboot, so this should not be any problem.

Framework redesign?

After trying on MSIM I found my design... awful, as it's not very scalable.

I guess I'll change my framework some time after dynamic memory allocation implementation.

Burning BIOS

龙芯2H机箱的BIOS烧写比较麻烦。开发团队使用的是XELTEK烧录器,SUPERPRO系列,型号为580U。 然而

  1. Xeltek官网称580U已经停产,
  2. Xeltek官方的驱动不支持Linux系统。

现在需要确认的有龙芯机箱ROM的型号:看Logo似乎是Macronix的。简单过了一下Google和淘宝,型号应该是MX25L8006EPI,八脚,仍需要向龙芯官方确认。若有可能,需要使用别的支持该型号和Linux的烧录器。
目前Xeltek正在生产的几个烧录器在淘宝上价格最低的是SuperPRO 610P,支持前述型号,至少800,官网上没有看到报价。
@leon001

@davidgao 你这里的BIOS ROM是什么样的?烧起来有问题么

Suggestions

  1. Drivers for same types of devices MUST have ISA-independent interfaces, so we need some headers for them.
  2. We could possibly put interrupt controlling code in drivers directory.
  3. usr looks like /usr, and may possibly be misleading. We can just use user to indicate user space code.

misc ideas

we should probably always prefer cross-GCC even when not compiling for another platform.
as we want standalone binaries, is autotools any good for our project? or do we write makefiles by hand?
link against libgcc or not? hint: arm has no div or mod on its own, nor floating point operations, so we need some software implementation if we are to use them. btw, is libgcc safe for standalone application?
i should get gcc5 and build a new toolchain.
we should include documentation on how to build the desired toolchain, which can be TONS of problems for beginners...

Where should we put implementation of interprocessor stuff?

I guess it's self-evident that the interprocessor stuff, including IPI, getting CPU ID#, etc., should be put in machine-specific directory (arch/$(ARCH)/asm/mach-$(MACH)/mach), rather than drivers directory.

Just for confirming. Close this issue if there's no disagreement.

When and how do we load ELF-related code

Been doing some research and even simple validation and loading of ELF files CANNOT fit into 448-bit MBR code. Here are some possible solutions.

  1. preload such functions, x86 will have trouble but arm and mips should be fine.
  2. use "partition boot record"-like strategy, MBR loads a bigger raw image containing such functions, RECOMMENDED.
  3. manually optimize code size. ARM can utilize THUMB instruction set. NOT RECOMMENDED, too much work away from our goal.
  4. use other format (like raw binary) for the kernel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.