i’m currently exploring MINIX and OS development and i need a room to put my thoughts notes whatever the fuck

main resources

books

websites

osdev

making an os in rust blog

https://os.phil-opp.com/

OSes to study

MINIX

Microkernel written in C that separates kernel functionality into processes and sends messages between different layers of the OS. — repo: https://github.com/Stichting-MINIX-Research-Foundation/minix

Compiling without rebuilding the whole system

I’m pretty sure that this actually doesn’t even work…

alias minix-nbmake=$(git rev-parse --show-toplevel)/../obj.i386/tooldir.xyz/bin/nbmake-i386
alias minix-img=CREATE_IMAGE_ONLY=1 $(git rev-parse --show-toplevel)/releasetools/x86_cdimage.sh
# do this inside of the directory you want to recompile, they usually have a Makefile to recompile
minix-nbmake && minix-nbmake install
# create the image
minix-img

Linux

Monolithic kernel written in C. I think most people know this one — repo: https://github.com/torvalds/linux

Serenity

OS with a monolithic kernel written in C++ with a huge monorepo of different utilities. The window system, audio, image rendering, are all seperated into different ‘process servers.’ This description is most likely incorrect and begs for revision. — repo: https://github.com/SerenityOS/serenity

  • The creator’s YouTube channel, really informative and entertaining for something to watch when bored: https://www.youtube.com/c/AndreasKling/videos
    • I recommend sorting by oldest to see base parts being developed
    • I also recommend looking for videos with the title of Code Tour but some of the older implementation videos are also interesting

notes

TODO: scheduling

notes for cross compilation with clang / llvm

this assumes that you have a base from the OSdev Bare Bones OS. i just do this because clang is more convenient to use on macOS

  • CFLAGS for clang: --target=i686-elf -march=i686 -nostdlib -fno-builtin -ffreestanding
    clang --target=i686-elf -march=i686 -nostdlib -fno-builtin -ffreestanding -c kernel.c -o kernel.o
    
  • remove BLOCK from linker.ld, ALIGN performs basically the same with the LLVM linker. also don’t remove the :s from the file
  • invoke the LLVM linker like so:
    ld.lld -T path-to-linker.ld -o output.bin list-of-object-files.o
    

    if this needs better explanation, please advise