Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
bootloader-x86_64-common = { version = "0.11.17", path = "common" }
bootloader-boot-config = { version = "0.11.17", path = "common/config" }
bootloader-x86_64-bios-common = { version = "0.11.17", path = "bios/common" }
noto-sans-mono-bitmap = { version = "0.4.0", default-features = false }

[features]
default = ["bios", "uefi"]
Expand Down Expand Up @@ -103,7 +104,7 @@
overflow-checks = true

[build-dependencies]
llvm-tools = "0.1.1"

Check warning on line 107 in Cargo.toml

View workflow job for this annotation

GitHub Actions / Check

unused dependency `llvm-tools`

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs_dummy_build"]
Expand Down
9 changes: 9 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
(e.g., via the SIMPLE_TEXT_OUTPUT_PROTOCOL) is no longer replicated to the
serial device. The bootloader's own logger now takes full ownership of the
serial device, ensuring safe and reliable logging.
- The framebuffer log output uses `noto-sans-mono-bitmap` 0.4, which renders
the mono font the standard way, like terminals and editors: characters are
sharper, share a common baseline, and are no longer cut off. To keep the
text about as large as before, it uses a 20 px instead of a 16 px raster
height (a 14.7 px instead of a 14 px font) without extra spacing between
lines. The UEFI bootloader and BIOS stage 4 are about 10% smaller.
- BIOS stage 3 uses `noto-sans-mono-bitmap` 0.4 instead of 0.1 and only
compiles the one font variant it uses. This speeds up clean builds of the
`bootloader` crate by about 25% and makes BIOS stage 3 about 14% smaller.

# 0.11.17 - 2026-07-27

Expand Down
10 changes: 9 additions & 1 deletion bios/stage-3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ description = "Third BIOS stage of the `bootloader` crate"

[dependencies]
bootloader-x86_64-bios-common = { workspace = true }
noto-sans-mono-bitmap = "0.1.5"

[dependencies.noto-sans-mono-bitmap]
workspace = true
features = [
"regular",
"size_20",
"unicode-basic-latin",
"unicode-latin-1-supplement",
]

# This currently causes a cargo warning, but it is required for publishing to crates.io.
# See https://github.com/rust-lang/cargo/issues/8264 for details.
Expand Down
12 changes: 7 additions & 5 deletions bios/stage-3/src/screen.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use bootloader_x86_64_bios_common::{BiosFramebufferInfo, PixelFormat, racy_cell::RacyCell};
use core::{fmt, ptr};
use noto_sans_mono_bitmap::{BitmapChar, BitmapHeight, FontWeight, get_bitmap};
use noto_sans_mono_bitmap::{FontWeight, RasterHeight, RasterizedChar, get_raster};

const RASTER_HEIGHT: RasterHeight = RasterHeight::Size20;

static WRITER: RacyCell<Option<ScreenWriter>> = RacyCell::new(None);
pub struct Writer;
Expand Down Expand Up @@ -46,7 +48,7 @@ impl ScreenWriter {
}

fn newline(&mut self) {
self.y_pos += 14 + LINE_SPACING;
self.y_pos += RASTER_HEIGHT.val() + LINE_SPACING;
self.carriage_return()
}

Expand Down Expand Up @@ -74,7 +76,7 @@ impl ScreenWriter {
'\n' => self.newline(),
'\r' => self.carriage_return(),
c => {
let bitmap_char = get_bitmap(c, FontWeight::Regular, BitmapHeight::Size14).unwrap();
let bitmap_char = get_raster(c, FontWeight::Regular, RASTER_HEIGHT).unwrap();
if self.x_pos + bitmap_char.width() > self.width() {
self.newline();
}
Expand All @@ -86,8 +88,8 @@ impl ScreenWriter {
}
}

fn write_rendered_char(&mut self, rendered_char: BitmapChar) {
for (y, row) in rendered_char.bitmap().iter().enumerate() {
fn write_rendered_char(&mut self, rendered_char: RasterizedChar) {
for (y, row) in rendered_char.rows().enumerate() {
for (x, byte) in row.iter().enumerate() {
self.write_pixel(self.x_pos + x, self.y_pos + y, *byte);
}
Expand Down
5 changes: 2 additions & 3 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ uart_16550 = "0.8.0"
log = "0.4.17"

[dependencies.noto-sans-mono-bitmap]
version = "0.2.0"
default-features = false
workspace = true
features = [
"regular",
"size_16",
"size_20",
"unicode-basic-latin",
# required for the fallback char '�'
"unicode-specials",
Expand Down
8 changes: 4 additions & 4 deletions common/src/framebuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use noto_sans_mono_bitmap::{
};

/// Additional vertical space between lines
const LINE_SPACING: usize = 2;
const LINE_SPACING: usize = 0;
/// Additional horizontal space between characters.
const LETTER_SPACING: usize = 0;

Expand All @@ -17,9 +17,9 @@ const BORDER_PADDING: usize = 1;
mod font_constants {
use super::*;

/// Height of each char raster. The font size is ~0.84% of this. Thus, this is the line height that
/// Height of each char raster. The font size is ~73% of this. Thus, this is the line height that
/// enables multiple characters to be side-by-side and appear optically in one line in a natural way.
pub const CHAR_RASTER_HEIGHT: RasterHeight = RasterHeight::Size16;
pub const CHAR_RASTER_HEIGHT: RasterHeight = RasterHeight::Size20;

/// The width of each single symbol of the mono space font.
pub const CHAR_RASTER_WIDTH: usize = get_raster_width(FontWeight::Regular, CHAR_RASTER_HEIGHT);
Expand Down Expand Up @@ -112,7 +112,7 @@ impl FrameBufferWriter {
/// Prints a rendered char into the framebuffer.
/// Updates `self.x_pos`.
fn write_rendered_char(&mut self, rendered_char: RasterizedChar) {
for (y, row) in rendered_char.raster().iter().enumerate() {
for (y, row) in rendered_char.rows().enumerate() {
for (x, byte) in row.iter().enumerate() {
self.write_pixel(self.x_pos + x, self.y_pos + y, *byte);
}
Expand Down
Loading