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.
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:
- Youtube: https://www.youtube.com/watch?v=hB6vcdnRUc0
- Bilibili: https://www.bilibili.com/video/BV1Kv4y1X7Uk/?spm_id_from=333.999.0.0&vd_source=a46a785ab89c09f0998d1f3ad010a333
I write a tool for initializing toolchains of JackOS by one-click: init.sh
.
init.sh
is a simple command line tool and easy to use.
Run
bash init.sh -h
and you will see:
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 ofinit.sh
to change installation path.
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 ofinit.sh
to change installation path as well as compile flags.
This may take a few minutes.
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
Run init.sh
, so that add <PREFIX>/tools/bin
into PATH
source init.sh
which i686-elf-gcc
After compiling and installing cross-compile tools, run make run-no-gdb
to compile the kernel and start bochs.
make run-no-gdb
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
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:
- Intel 64 and IA-32 Architecture Software Developer's Manual (Full Volume Bundle)
- IBM PC/AT Technical Reference
- IBM VGA/XGA Technical Reference
- Serial ATA - Advanced Host Controller Interface (AHCI), Revision 1.3.1
- Serial ATA: High Speed Serialized AT Attachment, Revision 3.2
- ATA/ATAPI Command Set - 3 (ACS-3)
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:
Other:
- Linux Manual
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.