Skip to content

HexRabbit/osc2021

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osc2021 kernel

A toy kernel I made while taking Operating System Capstone in NCTU.

Kernel Features

  • Supporting async UART I/O
  • Buddy allocator / Custom kmem_cache implementation
  • User / Kernel preemption
  • Wait Queues
  • Filesystems: tmpfs / VFS / FAT32 filesystem
  • MMU enabled
  • ELF loader
  • Page fault handler, Demand paging

Prerequisite

# if you need to cross-compile
apt install make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu

# or native compile on aarch64
apt install make gcc binutils

# tools to pack cpio & modify fat32 filesystem without mounting
apt install cpio dosfstools mtools

How to build

For real Rpi3

make rpi3

For Qemu

make

How to run

For real Rpi3

# first of all, manually flash `build/flash/sdcard.img` into sdcard,
dd if=build/flash/sdcard.img of=/path/to/sdcard bs=1M

# connect rpi3 to serial port, upload kernel8.img to device
# (edit the python script to match your serial device name)
python3 scripts/load_kernel.py

# connect to rpi3 (you must config minicom first)
minicom

For Qemu

make run

About

My OSC toy kernel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.8%
  • Assembly 2.5%
  • Makefile 1.5%
  • Python 1.1%
  • Shell 0.1%