diff --git a/Cargo.toml b/Cargo.toml index 5987ecc..6eb2953 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" opt-level = "z" debug-assertions = false overflow-checks = false -strip = true +strip = false lto = true codegen-units = 1 diff --git a/build.rs b/build.rs index a48f0e5..83302a6 100644 --- a/build.rs +++ b/build.rs @@ -1,6 +1,7 @@ fn main() { let arch = std::env::var("LBOS_ARCH").unwrap_or("virt".to_string()); println!("cargo:rerun-if-env-changed=LBOS_ARCH"); + println!("cargo:rerun-if-env-changed=LBOS_FONT"); println!("cargo:rustc-cfg=feature=\"arch_{}\"", arch); println!("cargo:rerun-if-changed=src/arch/{}/asm", arch); diff --git a/src/arch/virt/mod.rs b/src/arch/virt/mod.rs index 2c694d1..30f6422 100644 --- a/src/arch/virt/mod.rs +++ b/src/arch/virt/mod.rs @@ -17,7 +17,7 @@ global_asm!(include_str!("asm/trap.s")); extern "C" fn eh_personality() {} #[panic_handler] -//#[cfg(feature = "debug_messages")] +#[cfg(feature = "debug_messages")] fn panic(info: &core::panic::PanicInfo) -> ! { use core::fmt::Write; let mut uart = UART::new(0x1000_0000); @@ -38,7 +38,6 @@ fn panic(info: &core::panic::PanicInfo) -> ! { } } } -/* #[panic_handler] #[cfg(not(feature = "debug_messages"))] fn panic(_info: &core::panic::PanicInfo) -> ! { @@ -52,7 +51,6 @@ fn panic(_info: &core::panic::PanicInfo) -> ! { } } } -*/ pub fn virt_rough_panic(errcode: [char; 3]) -> ! { let uart = UART::new(0x1000_0000); for c in b"PANIC".iter() { diff --git a/src/arch/virt/trap.rs b/src/arch/virt/trap.rs index 2a0483e..b5fdd3a 100644 --- a/src/arch/virt/trap.rs +++ b/src/arch/virt/trap.rs @@ -1,7 +1,7 @@ use crate::arch::virt::{plic, serial_port}; use crate::rough_panic; use crate::syscalls::usize2sc; -use crate::trafficcontrol::{TC, context_switch, handle_syscall, MAX_TASKS}; +use crate::trafficcontrol::{TC, context_switch, handle_syscall, MAX_TASKS, TrafficControl, Task}; use core::arch::asm; use crate::spinlock::Spinlock; diff --git a/src/dev/framebuffer/charset1.data b/src/dev/framebuffer/charset1.data new file mode 100644 index 0000000..d90ed76 Binary files /dev/null and b/src/dev/framebuffer/charset1.data differ diff --git a/src/dev/framebuffer/charset1.png b/src/dev/framebuffer/charset1.png new file mode 100644 index 0000000..92bb03a Binary files /dev/null and b/src/dev/framebuffer/charset1.png differ diff --git a/src/dev/framebuffer/mod.rs b/src/dev/framebuffer/mod.rs index 1717f24..28d462f 100644 --- a/src/dev/framebuffer/mod.rs +++ b/src/dev/framebuffer/mod.rs @@ -5,9 +5,10 @@ use core::sync::atomic::Ordering; pub mod console; -pub const VAPFONT: &[u8] = include_bytes!("./vapfont.data"); -pub const VAPFONT_W: usize = 256; -pub const VAPFONT_H: usize = 112; +pub const VAPFONT: &[u8] = include_bytes!(env!("LBOS_FONT")); +pub const VAPFONT_W: usize = 184; +pub const VAPFONT_H: usize = 84; +pub const CHAR_SIZE: usize = 12; pub struct FBColor { pub red: u8, @@ -43,15 +44,14 @@ pub fn fb_write_char_array(tc: &mut TrafficControl, mut x: usize, y: usize, char return; } let fbstride = FRAMEBUFFER_BPP.load(Ordering::Relaxed) * FRAMEBUFFER_WIDTH; - const CHAR_SIZE: usize = 16; for c in chars { let c = *c; if c == ' ' { x += CHAR_SIZE; } else if c as u8 > 32 { - let c = c as u8 - 32; - let cx = (c % 16) as usize * CHAR_SIZE; - let cy = (c / 16) as usize * CHAR_SIZE; + let c = c as u8 - b'!'; + let cx = (c % 15) as usize * CHAR_SIZE; + let cy = (c / 15) as usize * CHAR_SIZE; for row in 0..CHAR_SIZE { for col in 0..CHAR_SIZE { let coff = (VAPFONT_W * (cy + row)) + (cx + col); diff --git a/src/dev/framebuffer/vapfont.data b/src/dev/framebuffer/vapfont.data deleted file mode 100644 index 6d2b292..0000000 Binary files a/src/dev/framebuffer/vapfont.data and /dev/null differ diff --git a/src/dev/framebuffer/vapfont.png b/src/dev/framebuffer/vapfont.png deleted file mode 100644 index 892116d..0000000 Binary files a/src/dev/framebuffer/vapfont.png and /dev/null differ diff --git a/turntable/Cargo.toml b/turntable/Cargo.toml index 559c755..b7f25fc 100644 --- a/turntable/Cargo.toml +++ b/turntable/Cargo.toml @@ -17,6 +17,7 @@ panic = "abort" opt-level = "z" debug-assertions = false overflow-checks = false +strip = true lto = true codegen-units = 1