Skip to content

Commit 9cfb3e5

Browse files
authored
New stable release
## Changelog - Bashkar: refactoring and new UI - Fixed clippy lints over all the code! - hyperdriver: Fixed `Send`/`Sync` implementations - kernel: scheduler now supports events and thread sleeping 🎉 - new mprotect syscall - improved core locals implementation - map kernel/framebuffer/ramdisk as global pages
2 parents ed92bcd + f878541 commit 9cfb3e5

98 files changed

Lines changed: 3485 additions & 816 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/heavy.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ jobs:
8080
targets: x86_64-unknown-none, x86_64-unknown-uefi
8181
components: clippy, rustfmt, llvm-tools-preview, rust-src
8282

83-
# The project isn't advanced enough to have clippy fail
84-
# on warnings over the kernel.
8583
- name: Run Clippy
8684
run: |
8785
cargo clippy --package beskar-core -- -D warnings
@@ -93,10 +91,10 @@ jobs:
9391
cargo clippy --package holonet -- -D warnings
9492
cargo clippy --package video -- -D warnings
9593
cargo clippy --package bashkar -- -D warnings
96-
cargo clippy --package acpi
97-
cargo clippy --package pci
98-
cargo clippy --package storage
99-
cargo clippy --package kernel
94+
cargo clippy --package acpi -- -D warnings
95+
cargo clippy --package pci -- -D warnings
96+
cargo clippy --package storage -- -D warnings
97+
cargo clippy --package kernel -- -D warnings
10098
10199
- name: Run Rustfmt
102100
run: cargo fmt --verbose --all -- --check

Cargo.lock

Lines changed: 31 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# BeskarOS
44

55
![GitHub Repo stars](https://img.shields.io/github/stars/mathisbot/beskar-os?style=flat)
6-
![](https://tokei.rs/b1/github/mathisbot/beskar-os?category=code&style=flat)
76

87
This repository contains the Beskar hobby OS: a very basic x86_64 hobby OS written in pure Rust that boots on UEFI 2 and has support for SMP.
98
It is named after the alloy used to forge Mandalorian armors, which cannot rust.
@@ -31,6 +30,7 @@ I have many milestones ideas for the OS:
3130

3231
- Bootloader: Custom UEFI 2 bootloader
3332
- Kernel: Modern 64-bit kernel with SMP support
33+
- Heaperion: Heap module
3434
- Hyperdrive: Bare metal utility module for the OS
3535
- Beskar Core: Structs and traits common to all modules
3636
- Beskar HAL: Hardware Abstraction Layer
@@ -52,22 +52,12 @@ For example, usage of SIMD registers is currently a to-do.
5252
The OS can be built using `cargo build [--release]`.
5353
The result of the building process lies inside the `efi_disk` directory.
5454

55-
You can optimize the built files for your specific target CPU. To do so, add the following lines in `.cargo/cargo.toml` :
56-
57-
```toml
58-
[build]
59-
rustflags = ["-C", "target-cpu=<CPU>"]
60-
```
61-
62-
Replace `<CPU>` with any of the CPU listed by `rustc --print target-cpus`.
63-
A great choice for most of modern CPUs is `x86_64-v3` (`v4` if it is very modern), but it is best to set it to the exact architecture you have!
64-
6555
### Running on QEMU
6656

6757
If you want to run the OS on a testing virtual machine on QEMU, you can do so by running the following command :
6858

6959
```powershell
70-
qemu-system-x86_64.exe -drive if=pflash,format=raw,readonly=on,file=<x86_64-OVMF> -drive format=raw,file=fat:rw:efi_disk -smp <NB_CORES> -m <RAM_SIZE> -cpu <CPU_ARCH> -accel <ACCEL_BACKEND> -serial stdio -device qemu-xhci -M q35
60+
qemu-system-x86_64.exe -drive if=pflash,format=raw,readonly=on,file=<x86_64-OVMF> -drive format=raw,file=fat:rw:efi_disk -smp <NB_CORES> -m <RAM_SIZE> -cpu <CPU_ARCH> -accel <ACCEL_BACKEND> -serial stdio -M q35
7161
```
7262

7363
Where:
@@ -80,6 +70,7 @@ Where:
8070
Other useful parameters:
8171
- `-nic user,model=e1000e`: Add a network card to the emulated computer.
8272
- `-device nvme,serial=<anything>`: Add a NVMe controller to the emulated computer.
73+
- `-device qemu-xhci`: Add an XHCI controller to the emulated computer.
8374
- `-device usb-kbd`: Add a USB keyboard (currently not recognized). This will disable QEMU's PS/2 emulated keyboard.
8475
- `-device virtio-vga -display <BACKEND>,gl=on`: If having a fixed 2560x1600 resolution bothers you, you can use a better-fitting framebuffer with these options. Replace `<BACKEND>` with either `sdl` or `gtk`.
8576

@@ -121,13 +112,15 @@ Debugging isn't currently supported through debuggers.
121112

122113
Debugging can be done using `beskar_lib::println!` which writes text on the screen and on the serial port (which is your host's console if you're using QEMU).
123114

115+
The kernel also prints the whole state of the CPU when it receives a breakpoint exception (`int3`).
116+
124117
## Screenshots
125118

126119
The following screenshots showcase the normal operating of the OS
127120

128121
### Bootloader
129122

130-
Before trying anything, the bootloader checks the firmware version as well as available features. This early process is logged into COM1.
123+
Before trying anything, the [bootloader](bootloader/README.md) checks the firmware version as well as available features. This early process is logged into COM1.
131124

132125
![Bootloader COM1 output](docs/images/bootloader_serial.webp)
133126

@@ -137,20 +130,16 @@ After video is enabled, the bootloader sets up a comfortable environment for the
137130

138131
### Kernel
139132

140-
On startup, the kernel initializes itself with the help of information provided by the bootloader.
133+
On startup, the [kernel](kernel/README.md) initializes itself with the help of information provided by the bootloader.
141134
After initialization, it starts a process to initialize drivers as well as a user-space process for each binary in the ramdisk.
142135

143136
![Kernel Initialization](docs/images/kernel_boot.webp)
144137

145-
When something goes unfortunately wrong, the faulty process gets killed. On unrecoverable kernel errors, the faulty core sends an NMI to other cores to stop further processing.
146-
147-
![Kernel Panic](docs/images/kernel_panic.webp)
148-
149138
### Userspace
150139

151140
### Bashkar
152141

153-
Bashkar is a wanna-be shell. It shows the terrific BeskarOS banner.
142+
[Bashkar](userspace/bashkar/README.md) is a wanna-be shell. It shows the terrific BeskarOS banner.
154143

155144
![Bashkar](docs/images/bashkar.webp)
156145

@@ -167,3 +156,7 @@ Unfortunately, the resolution is currently fixed at a small 340x200.
167156
My warmest thanks to all the [OSDev](https://wiki.osdev.org/) contributors, without whom it would have been impossible to acquire all the information needed to write such code.
168157

169158
Special thanks to Philipp Oppermann, for his [BlogOS ed.3](https://github.com/phil-opp/blog_os) series and for his [bootloader](https://github.com/rust-osdev/bootloader) crate, which enabled me to start from scratch with clear, easy-to-understand explanations.
159+
160+
## Disclaimer
161+
162+
While this project contains a few subtle references to the Star Wars universe for artistic purposes, it is an independent operating system and is not affiliated with or endorsed by Disney or Lucasfilm.

beskar-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
noto-sans-mono-bitmap = { version = "0.3.1", default-features = false, features = [
7+
noto-sans-mono-bitmap = { version = "0.3.2", default-features = false, features = [
88
"font_weights_default",
99
"size_20",
1010
"unicode_ranges_default",
1111
] }
12-
num_enum = { version = "0.7.4", default-features = false }
12+
num_enum = { version = "0.7.5", default-features = false }
1313
thiserror = { workspace = true }

0 commit comments

Comments
 (0)