https://github.com/uglyoldbob/doors-os
A custom kernel
https://github.com/uglyoldbob/doors-os
kernel rust
Last synced: 3 months ago
JSON representation
A custom kernel
- Host: GitHub
- URL: https://github.com/uglyoldbob/doors-os
- Owner: uglyoldbob
- Created: 2015-08-10T18:15:29.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-11-02T14:40:38.000Z (8 months ago)
- Last Synced: 2026-04-05T17:44:22.206Z (3 months ago)
- Topics: kernel, rust
- Language: Rust
- Homepage:
- Size: 59.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**Doors OS kernel**
This is the repository for the Doors OS kernel. It is written in rust with a tiny amount of assembly where required.
Building has been tested on both windows and linux (ubuntu).
**Building**
*Requirements to build*
* Rust
* rustup toolchain add nightly
* rustup component add llvm-tools
* cargo install cargo-binutils
*Linux requirements to build
* xorriso
* mtools
* virtualbox-dkms
* python (to build the rust compiler)
* ninja-build (to build the rust compiler)
* libssl-dev (to build the rust compiler)
* (optional) libpcap-dev
* * rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
*Optional to build*
* cmake
*Optional for testing*
* qemu
* bochs
* virtualbox
* gdb
*Note: For the windows build, virtualbox is used to build the cd image*
**Builder**
Builder is a utility that creates cmake build files in order to build the operating system and kernel.
**Cmake targets when using builder**
* fmt - This runs cargo fmt on everything.
* stack - This performs stack analysis of the kernel, producing output in stack.txt.
* buildscript - This re-runs the command for building the cmake files.
* boot_disk - Builds the bootable image for the operating system.
* run - Runs the emulator if applicable
* debug - Runs the emulator with emulator debugging support, if possible
* debug2 - A second method of doing the debugging, if applicable
* gdb - Runs debugging in a slightly different way.
* kernel - Builds the kernel
* kernel_clippy - Runs cargo clippy on the kernel
* kernel_fmt - Runs cargo fmt on just the kernel
* kernel_expand - Runs cargo expand on the kernel, to an output file expanded.txt
* disassemble - Produces disassembly of the kernel to disassemble.txt
**Kernel varieties**
There are two kernel varieties currently. There is the plain kernel and a test version of the kernel. The test version of the kernel runs all of the test functions defined in the kernel to verify correct behavior of the kernel.
**Kernel config**
There is a kernel config file that is required to build the kernel, located at ./kernel/config.toml (assuming you are at the root of this repository). It will also be useful to look at ./kernel/.cargo/config.toml to check the value of [build].target.
Eventually there will be gui based and command line based programs to generate and modify this configuration. For now it must be generated by hand. Here is an example configuration that can be used to get started.
```
machine_name = "pc64"
acpi = false
gdbstub = true
```
**Windows**
*cmake*
* rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
*gdb*
These tips for windows to get gdb may be helpful.
* Get mingw installed
* pacman -Syu (until it is fully up to date)
* pacman -S gdb
* Add the (mingw path)/usr/bin to your environment variable PATH
**Building grub2**
* This will probably not work on windows, which is the reason for the prebuilt grub2 files in this repository.
* Obtain the grub2 source code `git clone https://git.savannah.gnu.org/git/grub.git`
* Navigate to the grub directory
* `./bootstrap`
* ``./configure --prefix=`pwd`/../grub-files``
* `make install`
* `../grub-files/bin/grub-mkimage -d ../grub-files/lib/grub/i386-pc -o ../grubcore.img -O i386-pc -p /boot/grub iso9660 biosdisk multiboot2 configfile`
* `mkdir ../iso`
* `cat ../grub-files/lib/grub/i386-pc/cdboot.img ../grubcore.img > ../iso/grub-eltorito.img`
* `make distclean`
* ``./configure --target=x86_64 --with-platform=efi --prefix=`pwd`/../grub-files``
* `make install`
* `cd ..`
* `tar -czvf prebuilt-grub2.12.tar.gz ./grub-files`