JSLK is a simple 32-bit hobby kernel designed to run on the x86 architecture (although portability has been taken into consideration). It was started in August 2017 with the objective of learning how a computer operating system works and to improve the coding skills of the main developer. The kernel is mostly written in C with some bits of assembly and has partial compatibility with C++ (a runtime is provided). Some of its features are: extensive HAL API, System V ABI compatibility, memory management, interrupt handling, VGA driver, timers and delays, some synchronization primitives, a growing home-made C library, etc. You can test the current kernel online here.
The official documentation can be found here.
crt: C/C++ Runtime.
docs: Some documentation (writing in progress, thus incomplete).
iso: Filesystem used to build ISO image.
initrd: Files used to build the initrd.
hal: Hardware Abstraction Layer and API.
include: Public kernel headers.
kernel: Main kernel.
lib: Kernel Libraries.
target: Target build recipes.
- x86 (
- x86_64 (
Note: JSLK is not fully ported to x86_64 architecture yet, if you want to check out the latest features build for x86 instead.
- Raspberry Pi 1/2/zero (coming soon) (
Building for x86_64
These instructions will help you build JSLK Kernel for the x86 platform.
JSLK can be built on any UNIX like system, such as any Linux distribution, FreeBSD or macOS. Windows can also be used with the WSL enabled. To build the kernel you first need to install some dependencies and the toolchain.
$ sudo apt-get install nasm wget git qemu xorriso # Change apt-get install for whatever package manager you are using. $ wget https://github.com/sofferjacob/edison-toolchain/releases/download/1.0.0/sierra_toolchain_linux_x86_64_v.1.0.0.tar.gz
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew install nasm $ brew install wget $ brew install qemu $ brew install xorriso $ wget https://github.com/sofferjacob/edison-toolchain/releases/download/1.0.0/sierra_toolchain_mac_v.1.0.0.zip
On other operating systems the packages:
- i386-elf toolchain (can be built using the scripts here)
Can be built from source or installed from other sources.
Note: GRUB must be re-compiled with the i386-elf architecture as a target on any OS. You can find instructions on how to do so here.
To build JSLK from source copy and paste the following commands in a terminal prompt:
$ git clone https://github.com/sofferjacob/jslk.git $ cd jslk $ export TARGET=x64common # You can change this for whichever target you want $ make
Note: For this to work, your toolchain must be in your path (you can change this in the Makefile).
To clean the source tree:
$ make clean
And to build an ISO image:
$ make floppy
You can also pass the target as an argument to make instead of defining it as a variable:
$ make TARGET=x64common clean all floppy run
To build the initird:
$ ./make_initrd file1 file1 file2 file2 ... file5 file5
Note: The included utility only works in macOS. Recompile the utility for your host OS using:
$ gcc initrd/make_initrd.c -o make_initrd
Although JSLK can be tested on real hardware, it is not recommended, since a bug in the kernel can brick your system. Besides installation to a hard drive is not currently supported, thus testing on a Virtual Machine is recommended.
Testing on a VM
Build the kernel and a floppy image, then:
$ make run
You may find the documentation for the project here.
JSLK is licensed under the GNU General Public License v3.0 - see the LICENSE file for details. An original copy of the documentation of this product should be included with every derivative work or redistributions of this project.