Coder Social home page Coder Social logo

chaff's Introduction

Chaff OS

This is some crazy OS project I've been working on, on and off for some time now.

This is a 32-bit Unix-like OS which some day may become POSIX compliant. Currently it has many of the core parts including a memory manager, scheduler, process and signal management and general interrupts and exceptions.

Currently it doesn't actually run anything yet...

Compiling

Compiling Chaff requires:

  • unix environment
  • clang OR gcc (for elf-i386)
  • binutils (for elf-i386)
  • make
  • nasm
  • doxygen (only needed to generate documentation)

For Linux, everything except nasm should already be installed on most distributions.

For Windows, you need a unix environment to compile the code in. If you've installed msysgit (which I highly reccomend you do), you can use the "Git Bash" provided. All the other files nessesary for Windows can be found in the windows_tools.zip download. Extract this somewhere and put the bin folder in your system path.

Once you've done all this, go to the chaff source and type

make

This should build the chaff image and place it in the file bin/chaff.elf

On linux, you may want to build it using GCC, to do that use

make CC=gcc

To build the documentation, you need to install doxygen and type

doxygen

This should create the html documentation of all the chaff functions in doc/html

Creating an Image

Before debugging, you need to create a bootable image containing GRUB and the chaff kernel. To do this, download grub.img.zip from the downloads section. This is a floppy image containing a blank version of GRUB which can boot Chaff. You then need to mount the image as a volume.

On Linux, create a new directory to mount the image to and then type (as root):

mount -t vfat -o loop grub.img <new directory>

On Windows, there are various tools to mount images. My favourite is ImDisk and the installer is included in the windows_tools file. Open ImDisk and mount the grub.img file as a floppy disk to get a new drive.

After mounting the image, copy the generated chaff.elf file to the root of the image.

Debugging

Now that you have a bootable image, you can start debugging it. Currently there are no debugging tools in the kernel itself so it cannot be debugged on real hardware but it can be debugged using an emulator. You first need qemu (included in windows_tool) which contains a remote gdb server that allows you to debug the kernel from another program. When you are ready run qemu like this:

qemu -s -fda <image>

The -s allows remote debugging. The image can either be the grub.img file or an actual drive (eg A: for Windows or /dev/fd0 for Linux)

You also need a GUI which can interface with GDB - I generally use Eclipse (download the C version). If you are using Eclipse, open the Chaff project (use import projects to workspace if you don't have it) and create a new remote debug configuration. It should connect to a gdb server on port 1234 on localhost. If you are not using eclipse, you may have to specify the symbol file as the chaff.elf file.

Once connected, you should be able to debug the kernel and set breakpoints etc in Eclipse.

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.