anna c66b05216d | 3 years ago | |
---|---|---|
.idea | 3 years ago | |
.vscode | 3 years ago | |
arch/x86 | 3 years ago | |
cmake | 3 years ago | |
doc/i386 | 3 years ago | |
include | 3 years ago | |
kernel | 3 years ago | |
lib | 3 years ago | |
.editorconfig | 3 years ago | |
.gitignore | 3 years ago | |
CMakeLists.txt | 3 years ago | |
COPYRIGHT | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago |
README.md
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.