The Polycule OS https://bsd.gay
Find a file
fef c36b03d97c
mutex: avoid wait queue lock if possible
This also tidies up the atomic operations a little
and adds a new atom_cmp_xchg() as well as the same
APIs for longs and pointers.
2021-10-28 17:01:13 +02: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 mutex: avoid wait queue lock if possible 2021-10-28 17:01:13 +02:00
cmake clist: add better debugging facilities 2021-10-24 21:55:54 +02:00
doc/i386 x86: begin preparations for amd64 support 2021-10-21 05:27:42 +02:00
include mutex: avoid wait queue lock if possible 2021-10-28 17:01:13 +02:00
kernel mutex: avoid wait queue lock if possible 2021-10-28 17:01:13 +02:00
lib x86: begin preparations for amd64 support 2021-10-21 05:27:42 +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 fix build yet again 2021-10-13 18:00:22 +02:00
COPYRIGHT libc: port FreeBSD string library routines 2021-10-10 05:41:16 +02:00
LICENSE initial commit uwu 2021-09-13 18:51:51 +02:00
README.md x86: begin preparations for amd64 support 2021-10-21 05:27:42 +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. amd64 support is currently being implemented, and will be the main focus for further development. 32-bit platforms are likely to be abandoned all together in the near future, 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.

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!

License

Copyright (c) 2021 The GayBSD Project.

GayBSD is nonviolent software: you may only use, redistribute, and/or modify it under the terms of the Cooperative Nonviolent Public License (CNPL) as found in the LICENSE file in the source code root directory or at https://git.pixie.town/thufie/npl-builder; either version 7 of the license, or (at your option) any later version.

GayBSD comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. See the CNPL for details.

Parts of GayBSD contain software derived from The FreeBSD Project. All required license stances are retained in the COPYRIGHT file, and the individual files containing the adapted portions of code have the license stances intact. Every file containing source code originating from The FreeBSD Project contains the text $FreeBSD$, in order to make searching for them easier.