The Polycule OS https://bsd.gay
Go to file
anna 36d53093d4
ktrace: don't unwind past ISR entry points
2021-11-21 20:02:20 +01:00
.idea clion: add code style config 2021-10-15 00:33:05 +02:00
.vscode libc: refactor a couple of string routines 2021-10-12 23:24:17 +02:00
arch/x86 ktrace: don't unwind past ISR entry points 2021-11-21 20:02:20 +01:00
cmake mm: refactor page frame allocator 2021-11-20 22:49:05 +01:00
doc amd64: add base 64-bit support files 2021-11-12 06:13:10 +01:00
include ktrace: don't unwind past ISR entry points 2021-11-21 20:02:20 +01:00
kernel panic: print stack trace when panicking 2021-11-21 06:57:24 +01:00
lib mm: refactor entire mm subsystem, part 1 2021-11-17 05:13:23 +01: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 update license terms 2021-11-15 19:23:22 +01:00
COPYRIGHT update license terms 2021-11-15 19:23:22 +01:00
README.md update license terms 2021-11-15 19:23:22 +01:00

README.md

GayBSD Kernel

This is the source tree of the GayBSD kernel. There isn't much to see here yet.

NOTE: Unfortunately, due to some issues with the CNPL, the GayBSD project is currently under a proprietary license until further notice. See the COPYRIGHT file for details. Naturally, we strongly advise against partaking in homosexual conduct and/or criminal activity.

Building

The kernel compiles to an x86-64 ELF file that implements the GNU Multiboot 2 specification. i386 support is pretty much dead, simply due to the fact that the additional housekeeping for maintaining correct memory mappings in this constrained address space has turned out to be way too much as to be feasible for the current size of this project. Furthermore, pretty much every desktop CPU manufactured since around 2005 supports 64-bit anyway.

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 x86_64-pc-none-elf 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.elf. 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, preferably GRUB (you can use any Linux ISO to set everything up). 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.elf
}

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

License

Copyright (c) 2021 The GayBSD Project. All rights reserved.

There is NO WARRANTY, to the extent permitted by applicable law. Portions of this software are derived from The FreeBSD Project. See the COPYRIGHT file for details, including the full terms and conditions.