https://github.com/cyteon/catos
A small AMD64 kernel written in Rust.
https://github.com/cyteon/catos
amd64 kernel os rust x86-64
Last synced: about 1 month ago
JSON representation
A small AMD64 kernel written in Rust.
- Host: GitHub
- URL: https://github.com/cyteon/catos
- Owner: Cyteon
- License: gpl-3.0
- Created: 2024-09-09T19:12:08.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-11-17T11:15:17.000Z (7 months ago)
- Last Synced: 2025-04-03T14:21:28.958Z (about 2 months ago)
- Topics: amd64, kernel, os, rust, x86-64
- Language: Rust
- Homepage:
- Size: 64.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CatOS
A small AMD64 kernel written in Rust.> [!NOTE]
> This project is based off of https://os.phil-opp.com/, and as such, some aspects of the projects will be similar to it.# Accquiring CatOS
## From source
You'll need two things:
- Qemu (on Arch Linux as `qemu-system-full`)
- Rustboth of which are available in package managers. Along with this, you'll need to install
`bootimage` if you haven't already:
```sh
$ cd ~ # Super important. See rust-osdev/bootimage issue 64
$ sudo cargo install bootimage
# Also install llvm-tools-preview with 'rustup component add llvm-tools-preview', if not done
# already.
```### Compilation
```sh
# Cloning the repository
$ git clone https://github.com/Cyteon/catos
$ cd catos
# Here is where you'll install llvm-tools-preview. See above
$ cargo build
```
The output file is in `target/x86_64-cat_os/debug`.## The Tests
CatOS comes with its own test suite. You can use
```
$ cargo test
```to run the tests. You *will* need to have qemu for this.
# Running CatOS
## Real Hardware
The kernel is a floppy disk image, so you can follow [this](https://wiki.osdev.org/Bootable_CD). To make
the 1.44 MB floppy, you can
```sh
# Generate a 1.44 mb empty disk image
$ dd if=/dev/zero of=flp.img bs=512 count=2880
# Copy the kernel image
$ cp target/x86_64-cat_os/debug/bootimage-cat_os.bin kernel.elf
$ dd if=flp.img of=kernel.elf conv=notrunc
```## QEMU (with Cargo)
```bash
$ cargo run
```