font
This commit is contained in:
parent
af5a366b59
commit
8c67690099
10 changed files with 12 additions and 12 deletions
|
|
@ -24,7 +24,7 @@ panic = "abort"
|
||||||
opt-level = "z"
|
opt-level = "z"
|
||||||
debug-assertions = false
|
debug-assertions = false
|
||||||
overflow-checks = false
|
overflow-checks = false
|
||||||
strip = true
|
strip = false
|
||||||
lto = true
|
lto = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
||||||
|
|
|
||||||
1
build.rs
1
build.rs
|
|
@ -1,6 +1,7 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let arch = std::env::var("LBOS_ARCH").unwrap_or("virt".to_string());
|
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_ARCH");
|
||||||
|
println!("cargo:rerun-if-env-changed=LBOS_FONT");
|
||||||
println!("cargo:rustc-cfg=feature=\"arch_{}\"", arch);
|
println!("cargo:rustc-cfg=feature=\"arch_{}\"", arch);
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=src/arch/{}/asm", arch);
|
println!("cargo:rerun-if-changed=src/arch/{}/asm", arch);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ global_asm!(include_str!("asm/trap.s"));
|
||||||
extern "C" fn eh_personality() {}
|
extern "C" fn eh_personality() {}
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
//#[cfg(feature = "debug_messages")]
|
#[cfg(feature = "debug_messages")]
|
||||||
fn panic(info: &core::panic::PanicInfo) -> ! {
|
fn panic(info: &core::panic::PanicInfo) -> ! {
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
let mut uart = UART::new(0x1000_0000);
|
let mut uart = UART::new(0x1000_0000);
|
||||||
|
|
@ -38,7 +38,6 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
#[cfg(not(feature = "debug_messages"))]
|
#[cfg(not(feature = "debug_messages"))]
|
||||||
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||||
|
|
@ -52,7 +51,6 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
pub fn virt_rough_panic(errcode: [char; 3]) -> ! {
|
pub fn virt_rough_panic(errcode: [char; 3]) -> ! {
|
||||||
let uart = UART::new(0x1000_0000);
|
let uart = UART::new(0x1000_0000);
|
||||||
for c in b"PANIC".iter() {
|
for c in b"PANIC".iter() {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::arch::virt::{plic, serial_port};
|
use crate::arch::virt::{plic, serial_port};
|
||||||
use crate::rough_panic;
|
use crate::rough_panic;
|
||||||
use crate::syscalls::usize2sc;
|
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 core::arch::asm;
|
||||||
use crate::spinlock::Spinlock;
|
use crate::spinlock::Spinlock;
|
||||||
|
|
||||||
|
|
|
||||||
BIN
src/dev/framebuffer/charset1.data
Normal file
BIN
src/dev/framebuffer/charset1.data
Normal file
Binary file not shown.
BIN
src/dev/framebuffer/charset1.png
Normal file
BIN
src/dev/framebuffer/charset1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -5,9 +5,10 @@ use core::sync::atomic::Ordering;
|
||||||
|
|
||||||
pub mod console;
|
pub mod console;
|
||||||
|
|
||||||
pub const VAPFONT: &[u8] = include_bytes!("./vapfont.data");
|
pub const VAPFONT: &[u8] = include_bytes!(env!("LBOS_FONT"));
|
||||||
pub const VAPFONT_W: usize = 256;
|
pub const VAPFONT_W: usize = 184;
|
||||||
pub const VAPFONT_H: usize = 112;
|
pub const VAPFONT_H: usize = 84;
|
||||||
|
pub const CHAR_SIZE: usize = 12;
|
||||||
|
|
||||||
pub struct FBColor {
|
pub struct FBColor {
|
||||||
pub red: u8,
|
pub red: u8,
|
||||||
|
|
@ -43,15 +44,14 @@ pub fn fb_write_char_array(tc: &mut TrafficControl, mut x: usize, y: usize, char
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let fbstride = FRAMEBUFFER_BPP.load(Ordering::Relaxed) * FRAMEBUFFER_WIDTH;
|
let fbstride = FRAMEBUFFER_BPP.load(Ordering::Relaxed) * FRAMEBUFFER_WIDTH;
|
||||||
const CHAR_SIZE: usize = 16;
|
|
||||||
for c in chars {
|
for c in chars {
|
||||||
let c = *c;
|
let c = *c;
|
||||||
if c == ' ' {
|
if c == ' ' {
|
||||||
x += CHAR_SIZE;
|
x += CHAR_SIZE;
|
||||||
} else if c as u8 > 32 {
|
} else if c as u8 > 32 {
|
||||||
let c = c as u8 - 32;
|
let c = c as u8 - b'!';
|
||||||
let cx = (c % 16) as usize * CHAR_SIZE;
|
let cx = (c % 15) as usize * CHAR_SIZE;
|
||||||
let cy = (c / 16) as usize * CHAR_SIZE;
|
let cy = (c / 15) as usize * CHAR_SIZE;
|
||||||
for row in 0..CHAR_SIZE {
|
for row in 0..CHAR_SIZE {
|
||||||
for col in 0..CHAR_SIZE {
|
for col in 0..CHAR_SIZE {
|
||||||
let coff = (VAPFONT_W * (cy + row)) + (cx + col);
|
let coff = (VAPFONT_W * (cy + row)) + (cx + col);
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
|
|
@ -17,6 +17,7 @@ panic = "abort"
|
||||||
opt-level = "z"
|
opt-level = "z"
|
||||||
debug-assertions = false
|
debug-assertions = false
|
||||||
overflow-checks = false
|
overflow-checks = false
|
||||||
|
strip = true
|
||||||
lto = true
|
lto = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue