summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-31 02:28:10 +0200
committersalmonik <salmonik@tuta.io>2026-07-31 02:28:10 +0200
commitaf8d5aa4538ac71f11a5418ef94ae478868a0484 (patch)
treec235d89cbdd1486dd2239d08abc750be2e5a88d2 /build.rs
parentInitial commit: raisernics toy kernel (diff)
downloadrs-dos-af8d5aa4538ac71f11a5418ef94ae478868a0484.tar.gz
rs-dos-af8d5aa4538ac71f11a5418ef94ae478868a0484.zip
interrupts: IDT, PIC remap, PIT timer, PS/2 keyboard IRQ
- IDT with 256 entries, loaded via lidt (CS read from current context) - PIC 8259A remapped to vectors 32-47, timer+keyboard IRQs unmasked - PIT channel 0 at ~100 Hz (mode 2, rate generator) - PS/2 keyboard IRQ (IRQ1 → vector 33): reads port 0x60, pushes byte to lock-free SPSC ring buffer - Timer IRQ (IRQ0 → vector 32): sends EOI, increments tick counter - ps2::poll_key() now reads from ring buffer with cli/sti+hlt for race-free sleep (instead of busy-polling the data port) - build.rs: use idiomatic Result<_, Box<dyn Error>> return type - tools/qemu.sh: fix SC2207 shellcheck warning
Diffstat (limited to '')
-rw-r--r--build.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/build.rs b/build.rs
index 44e6344..35447e9 100644
--- a/build.rs
+++ b/build.rs
@@ -26,8 +26,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
26 return Err("not a PSF2 font".into()); 26 return Err("not a PSF2 font".into());
27 } 27 }
28 28
29 let hdr_size = u32::from_le_bytes(raw[8..12].try_into()?) as usize; 29 let hdr_size = u32::from_le_bytes(raw[8..12].try_into()?) as usize;
30 let num_glyphs = u32::from_le_bytes(raw[16..20].try_into()?) as usize; 30 let num_glyphs = u32::from_le_bytes(raw[16..20].try_into()?) as usize;
31 let bytes_per_glyph = u32::from_le_bytes(raw[20..24].try_into()?) as usize; 31 let bytes_per_glyph = u32::from_le_bytes(raw[20..24].try_into()?) as usize;
32 32
33 if num_glyphs != 256 { 33 if num_glyphs != 256 {