GithubHelp home page GithubHelp logo

deg4m4 / arunos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pykello/arunos

0.0 0.0 0.0 129 KB

A simple operating system for ARM processors

License: Other

C++ 0.42% C 86.79% Objective-C 3.33% Assembly 4.38% Makefile 4.90% GDB 0.17%

arunos's Introduction

Arunos

Arunos is a simple operating system for ARM processors. I started creating it to teach myself how operating systems work. Its design is based on the JOS operating system which is used in the labs of the 6.828 operating system engineering course at MIT. I will improve it as I continue studying this course.

Hardware Support

I test the operating system on ARM926 processor and Versatile Platform Baseboard using QEMU. The reason for choosing ARM926 and VersatilePB was QEMU's good support for this platform.

This operating system also works on raspberry pi. To install it on raspberry pi,

  • Run make arch=raspberrypi to create arunos.bin,
  • Assuming that you have already installed Raspbian on the raspberry pi's SD card, replace kernel.img on the SD card with arunos.bin.
  • Boot raspberry pi.

Current Status

Currently:

  • it boots,
  • has a simple shell with some utility commands for system information,
  • communicates with serial I/O port uart0,
  • uses the virtual memory hardware,
  • does some basic process management and can load user programs.

run "help" in the shell to see a list of available commands.

Compiling

You need to install the GNU tools for cross-compilation for arm-none-eabi target to be able to compile the code. To install these tools in Fedora 19, you can do:

sudo yum install arm-none-eabi-binutils-cs
sudo yum install arm-none-eabi-gcc-cs

In Ubuntu:

sudo apt install binutils-arm-none-eabi
sudo apt install gcc-arm-none-eabi

After installing these tools, you can run the following command to build the kernel:

make

After making, the OS image is created as a single "arunos.bin" binary file.

Emulating

To emulate the operating system, you need to install QEMU. To do this in Fedora 19, you can do:

sudo yum install qemu-system-arm

After qemu-system-arm is installed, run the following command to emulate the OS:

make qemu

To terminate the emulation, you can press Ctrl-A X key combination.

Debugging

The default GDB doesn't work with ARM binaries, so you need to compile GDB manually to be able to debug Arunos. To do this, you can download gdb, then configure it for arm-none-eabi target, and then make and install it:

wget http://ftp.gnu.org/gnu/gdb/gdb-7.7.tar.gz
tar -xzf gdb-7.7.tar.gz
cd gdb-7.7
./configure --target=arm-none-eabi
make
sudo make install

After installation finishes, open two terminal windows and set their current directories to the directory of Arunos. In terminal window 1, run:

make qemu-gdb

In terminal window 2, run:

arm-none-eabi-gdb

Then, you can use gdb commands to debug Arunos.

Note. You may need to add the following line to ~/.gdbinit:

set auto-load safe-path /

Coding Style

The coding style used in this project is based on [Linux kernel coding style] (https://www.kernel.org/doc/Documentation/CodingStyle). Here are some guidelines:

  • Use tabs for indentation,
  • Each tab is 8 characters wide,
  • Each line should be limited to 80 characters,
  • Use underscore delimited names for functions and variables,
  • Use camel case names for structs and enums,
  • Don't typedef structs and enums,
  • Open the braces in the same line, except for functions,
  • If a condition is multiple lines, open the braces in a separate line,
  • Don't use braces for single line blocks,
  • Don't indent "case" statements in a switch/case statement,
  • Separate functions by a single empty line,
  • Don't comment how something is done, but what is being done,
  • Short names for local variables are allowed unless they introduce confusion,
  • Use descriptive names for global variables and functions.

License

This software is BSD licensed. For more details, see the LICENSE file.

arunos's People

Contributors

pykello avatar

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.