add README
parent
3d6258a06e
commit
66a1f8726e
@ -0,0 +1,61 @@
|
||||
# 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](https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html)
|
||||
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!
|
Loading…
Reference in New Issue