Giter Site home page Giter Site logo

jackos's Introduction

JackOS

JackOS

JackOS: A simple Operating System written by Shihong(Jack) Wang, for study and practice OS only.

JackOS is a simple kernel that explains how a real Operating System runs. It's so simple that less that 7000 line of codes, but have all components that a real kernel has. By learning and hacking JackOS, you will get a deeper understanding of Operating System.

I'm a junor student majoring in Computer Science. JackOS is written when I take CS537 in UW-Madison because I want to challenge myself and dive deeper into Operating System :).

I hope this repository can also help those who want to learn more, those who are NOT satisfied with concepts of Operating System taught from class, those who want to read, write real Operating System Code.

Reading a real kernel source code like Linux is tooooo hard. Some powerful components like slab and vfs greatly increase the complexity, making the kenrel toooooo hard to understand. The design concept of JackOS is the simple, the best, so the JackOS implements any components in the simplest way, in order to make it easy to understand.

image-20221221110318213

Features

JackOS has following features:

  • run under 32-bit Protect Modes, with secondary page table
  • console works in text mode
  • round-robbin scheduler
  • has a ext2-like file system
  • 32-bit ELF executable user program support

Demo Vides:

Quick Run

1. Prepare toolchain: Cross Compiler and Simulator

I write a tool for initializing toolchains of JackOS by one-click: init.sh.

A. bash init.sh -h: Print help message

init.sh is a simple command line tool and easy to use.

Run

bash init.sh -h

and you will see:

image-20221221092357030

B. bash init.sh -d: Download toolchain

Run following command, toolchain will download cross-compile toolchains for you.

bash init.sh -d

Note: by default, cross-compile toolchain source code will be download at <ProjectBaseDir>/tools/src. You can change first few lines of init.sh to change installation path.

image-20221221093112528

C. bash init.sh -c: Compile and install toolchain

After download, run following command to compile and install cross-compile toolchains:

bash init.sh -c

Note: Compiled cross-compile tools will be installed at <ProjectBaseDir>/tools/bin. You can change first few lines of init.sh to change installation path as well as compile flags.

This may take a few minutes.

image-20221221093218068

image-20221221104518709

image-20221221105118058

D. source init.sh: install in PATH

After compile and install, tools can be found in <PREFIX>/tools/bin, by default, <PREFIX> is set to the parent directory of init.sh

ls tools/bin

image-20221221105513297

Run init.sh, so that add <PREFIX>/tools/bin into PATH

source init.sh
which i686-elf-gcc

image-20221221105630037

2. Run JackOS

A. One step method: make run-no-gdb

After compiling and installing cross-compile tools, run make run-no-gdb to compile the kernel and start bochs.

make run-no-gdb

image-20221221105848459

B. Two step method: make no-gdb and bochs -f bochs

Besides make run-no-gdb, first running make no-gdb and then bochs -f bochs are exactly the same .

make no-gdb
bochs -f bochsrc

image-20221221110212469

Reference

Resources (blog / video / paper / book, etc.) and people listed below help a lot to this project. Thanks to their time, energy and selfless dedication of sharing their knowledge.

Here's the reference list:

Manual/Reference:

Books:

  • Operating Systems: Three Easy Pieces (Remzi, A & Andrea A.)
  • Computer System - A Programmer's Perspective Third Edition (CS:APP) (Bryant, R & O'Hallaron, D)
  • Modern Operating System (Tanenbaum, A)
  • X86/x64 Architecture: Exploration and Programming (Zhi, D)
  • Operating System: Truth Restoration (Gang, Z)
  • Professional Linux Kernel Architecture (Wolfgang, M)
  • A Heavily Commented Linux Kernel Source Code Linux Version 0.11, (Jiong, Z)

Websites:

  • OSDev - Some ancient resources。
  • FreeVGA - Resources about VGA programming。

Other:

  • Linux Manual

Acknowledgement

This repository is finished when I participate VISP (Visiting International Student Program) in UW-Madision.

In detail, I took CS537: Operating System. This course taught me the basic knowledge of the operating system and inspired me to write the operating system.

Thanks for TAs teams when I ask some detailed api problem. Thanks professor Remzi for giving visionary suggestions at every important moment or JackOS won't be finished within the semester.

jackos's People

Contributors

jackwang0108 avatar jackwang0107 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.