diff options
| author | salmonik <salmonik@tuta.io> | 2026-07-31 02:58:31 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-07-31 02:58:31 +0200 |
| commit | 6a5c32fa6ae8ec34e3e5b44d7e5a78ded8fe729b (patch) | |
| tree | ed59a5bd59a94b3a731b28c68c507f18afc44b0b /rsnix | |
| parent | auto-version all strings from Cargo.toml via env!("CARGO_PKG_VERSION") (diff) | |
| download | rs-dos-6a5c32fa6ae8ec34e3e5b44d7e5a78ded8fe729b.tar.gz rs-dos-6a5c32fa6ae8ec34e3e5b44d7e5a78ded8fe729b.zip | |
restructure: rsnix kernel + shell crate + rsdos entry point
Architecture:
rs-dos/ (workspace root, was raisernics/)
├── rsnix/ — kernel lib crate (uefi, serial, gop, ps2, interrupts, memory)
├── shell/ — shell lib crate (prompt, commands, line input)
├── rsdos/ — binary crate (efi_main, init, panic handler)
└── rsboot/ — future git submodule
No functional changes — boots to shell prompt identically.
Version auto-pulled from Cargo.toml via env!("CARGO_PKG_VERSION").
Diffstat (limited to '')
| -rw-r--r-- | rsnix/Cargo.toml | 4 | ||||
| -rw-r--r-- | rsnix/build.rs (renamed from build.rs) | 0 | ||||
| -rw-r--r-- | rsnix/src/font.rs (renamed from src/font.rs) | 0 | ||||
| -rw-r--r-- | rsnix/src/gop.rs (renamed from src/gop.rs) | 0 | ||||
| -rw-r--r-- | rsnix/src/interrupts.rs (renamed from src/interrupts.rs) | 4 | ||||
| -rw-r--r-- | rsnix/src/lib.rs | 11 | ||||
| -rw-r--r-- | rsnix/src/memory.rs (renamed from src/memory.rs) | 2 | ||||
| -rw-r--r-- | rsnix/src/ps2.rs (renamed from src/ps2.rs) | 5 | ||||
| -rw-r--r-- | rsnix/src/serial.rs (renamed from src/serial.rs) | 0 | ||||
| -rw-r--r-- | rsnix/src/uefi.rs (renamed from src/uefi.rs) | 0 |
10 files changed, 20 insertions, 6 deletions
diff --git a/rsnix/Cargo.toml b/rsnix/Cargo.toml new file mode 100644 index 0000000..d8cd26b --- /dev/null +++ b/rsnix/Cargo.toml | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | [package] | ||
| 2 | name = "rsnix" | ||
| 3 | version.workspace = true | ||
| 4 | edition.workspace = true | ||
diff --git a/build.rs b/rsnix/build.rs index 35447e9..35447e9 100644 --- a/build.rs +++ b/rsnix/build.rs | |||
diff --git a/src/font.rs b/rsnix/src/font.rs index e188513..e188513 100644 --- a/src/font.rs +++ b/rsnix/src/font.rs | |||
diff --git a/src/gop.rs b/rsnix/src/gop.rs index 9645bb0..9645bb0 100644 --- a/src/gop.rs +++ b/rsnix/src/gop.rs | |||
diff --git a/src/interrupts.rs b/rsnix/src/interrupts.rs index 90d5bbb..8f2acd7 100644 --- a/src/interrupts.rs +++ b/rsnix/src/interrupts.rs | |||
| @@ -174,7 +174,7 @@ impl KeyBuf { | |||
| 174 | let h = self.head.load(Ordering::Acquire); | 174 | let h = self.head.load(Ordering::Acquire); |
| 175 | let next = t.wrapping_add(1); | 175 | let next = t.wrapping_add(1); |
| 176 | // Full if the distance between head and tail == capacity (256). | 176 | // Full if the distance between head and tail == capacity (256). |
| 177 | if next.wrapping_sub(h) as u16 > 255 { | 177 | if next.wrapping_sub(h) > 255 { |
| 178 | return; // drop — ring is full | 178 | return; // drop — ring is full |
| 179 | } | 179 | } |
| 180 | unsafe { | 180 | unsafe { |
| @@ -362,7 +362,7 @@ pub fn init() { | |||
| 362 | 362 | ||
| 363 | // Build the IDTR pseudo-descriptor. | 363 | // Build the IDTR pseudo-descriptor. |
| 364 | IDTR = [ | 364 | IDTR = [ |
| 365 | (256u16 * 16 - 1) as u16, // limit = 256*16 - 1 | 365 | ((256u16 * 16 - 1)), // limit = 256*16 - 1 |
| 366 | idt_ptr as u16, // base lo | 366 | idt_ptr as u16, // base lo |
| 367 | (idt_ptr as u64 >> 16) as u16, // base mid | 367 | (idt_ptr as u64 >> 16) as u16, // base mid |
| 368 | (idt_ptr as u64 >> 32) as u16, // base hi | 368 | (idt_ptr as u64 >> 32) as u16, // base hi |
diff --git a/rsnix/src/lib.rs b/rsnix/src/lib.rs new file mode 100644 index 0000000..6c7fb3c --- /dev/null +++ b/rsnix/src/lib.rs | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #![no_std] | ||
| 2 | |||
| 3 | extern crate alloc; | ||
| 4 | |||
| 5 | pub mod uefi; | ||
| 6 | pub mod serial; | ||
| 7 | pub mod gop; | ||
| 8 | pub mod font; | ||
| 9 | pub mod ps2; | ||
| 10 | pub mod interrupts; | ||
| 11 | pub mod memory; | ||
diff --git a/src/memory.rs b/rsnix/src/memory.rs index d223f69..39fd88d 100644 --- a/src/memory.rs +++ b/rsnix/src/memory.rs | |||
| @@ -85,7 +85,7 @@ pub fn capture_memory_map(bs: &BootServices) -> Result<usize, Status> { | |||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | // Round up to desc_size alignment | 87 | // Round up to desc_size alignment |
| 88 | let buf_size = (buf_size + desc_size - 1) / desc_size * desc_size; | 88 | let buf_size = buf_size.div_ceil(desc_size) * desc_size; |
| 89 | 89 | ||
| 90 | // If our static buffer is too small, fall back to pool (rare) | 90 | // If our static buffer is too small, fall back to pool (rare) |
| 91 | if buf_size > unsafe { MAP_WORK_BUF.len() } { | 91 | if buf_size > unsafe { MAP_WORK_BUF.len() } { |
diff --git a/src/ps2.rs b/rsnix/src/ps2.rs index 4ea8b7a..b83a4e0 100644 --- a/src/ps2.rs +++ b/rsnix/src/ps2.rs | |||
| @@ -346,11 +346,10 @@ fn update_modifiers(scancode: u8, pressed: bool, e0: bool) { | |||
| 346 | (0x1D, true) => set_mod(state, MOD_RCTRL, pressed), | 346 | (0x1D, true) => set_mod(state, MOD_RCTRL, pressed), |
| 347 | (0x38, false) => set_mod(state, MOD_LALT, pressed), | 347 | (0x38, false) => set_mod(state, MOD_LALT, pressed), |
| 348 | (0x38, true) => set_mod(state, MOD_RALT, pressed), | 348 | (0x38, true) => set_mod(state, MOD_RALT, pressed), |
| 349 | (0x3A, false) => { | 349 | (0x3A, false) |
| 350 | if pressed { | 350 | if pressed => { |
| 351 | state.modifiers ^= MOD_CAPS; | 351 | state.modifiers ^= MOD_CAPS; |
| 352 | } | 352 | } |
| 353 | } | ||
| 354 | _ => {} | 353 | _ => {} |
| 355 | } | 354 | } |
| 356 | } | 355 | } |
diff --git a/src/serial.rs b/rsnix/src/serial.rs index 03fa570..03fa570 100644 --- a/src/serial.rs +++ b/rsnix/src/serial.rs | |||
diff --git a/src/uefi.rs b/rsnix/src/uefi.rs index 2e3ed6b..2e3ed6b 100644 --- a/src/uefi.rs +++ b/rsnix/src/uefi.rs | |||
