The Polycule OS https://bsd.gay
Find a file
2021-10-04 05:55:03 +02:00
.idea clion: add project configuration files 2021-10-02 03:22:16 +02:00
.vscode vscode: update c config and add settings 2021-09-19 04:15:48 +02:00
arch/x86 x86: refactor traps, add register dump support 2021-10-04 05:55:03 +02:00
cmake kmalloc: add actual memory allocator 2021-09-29 01:10:41 +02:00
include x86: refactor traps, add register dump support 2021-10-04 05:55:03 +02:00
kernel kprintf: minor refactor, fix stupid offset bugs 2021-10-03 18:59:06 +02:00
lib libc: add string operations for libc 2021-09-19 04:48:20 +02:00
.editorconfig initial commit uwu 2021-09-13 18:51:51 +02:00
.gitignore boot: add basic multiboot support 2021-09-18 16:48:46 +02:00
CMakeLists.txt cmake: "fix" compiler stuff 2021-10-03 04:21:21 +02:00
LICENSE initial commit uwu 2021-09-13 18:51:51 +02:00
README.md add README 2021-09-23 21:00:43 +02:00

GayBSD Kernel

This is the source tree of the GayBSD kernel. There isn't much to see here yet -- only the most basic boot routine is implemented at the moment.

Building

The kernel compiles to a binary i686 image that implements the GNU Multiboot 2 specification.

Required Tools

  • A POSIX operating system (use WSL if you find yourself in the unfortunate situation of running Windows)
  • CMake >= 3.14
  • clang, with support for the i686-none target
    • You probably won't need to recompile clang as it has cross compiling capabilities built in, at least it works fine on my Arch Linux machine
    • GCC should work in theory, but this isn't tested at all and you'll most likely need to compile it manually to make it spit out i686 ELFs
  • A linker that is able to work with GNU LinkerScripts (clang, GNU ld should work too but as already stated you should avoid GNU stuff if possible)
  • Git

Actually Compiling the Thing

cmake -B build -S .
cmake --build build

The compiled kernel image will be in ./build/gaybsd_image. You may want to tweak come configuration values in build/CMakeCache.txt, either using a plain text editor or cmake-gui(1). See cmake/config.cmake for all configuration options.

Running

In its current state, GayBSD is barely more than a simple program writing stuff to the BIOS character framebuffer, so you probably don't want to be running it on bare metal. Seriously, please don't do this, i have virtually no experience with x86 and no idea if what i'm doing could damage your hardware. Instead, you are way better off using QEMU or something similar. You will need a Multiboot 2 compliant bootloader, preferrably GRUB (you can use a 32-bit Linux ISO to set everything up, like Arch Linux 32). Install GRUB for the i386-pc target, and add the following entry to grub.cfg:

menuentry 'GayBSD' {
        insmod part_gpt
        search --no-floppy --fs-uuid --set=root <root partition uuid>

        multiboot2 /boot/gaybsd_image
}

Copy ./build/gaybsd_image to /boot/gaybsd_image on the virtual disk that you are booting off of. After that, you should be ready to go!