Skip to main content

Module boot_progress

Module boot_progress 

Source
Expand description

Pastel boot-progress bar drawn along the bottom of the framebuffer.

Each boot milestone calls render with its ordinal; the bar fills proportionally and shows the current stage label. If the boot freezes, the bar simply stops growing at the last completed stage : a zero-cost visual β€œwhere did it hang” on hardware with no serial port (the target X13 case).

All drawing goes through the guarded VGA primitives, so every call made before the framebuffer console is up : or under console.mode=serial : is a silent no-op. No allocation, no locks of our own: safe at any boot stage.

Re-exportsΒ§

use super::api; πŸ”’
use crate::framebuffer::RgbColor; πŸ”’
use core::sync::atomic::AtomicUsize; πŸ”’
use core::sync::atomic::Ordering; πŸ”’

StructsΒ§

Layout
Shared HUD geometry: the writer reserves exactly this band and the bar draws into it, so the console text and the bar can never overlap.

ConstantsΒ§

BORDER πŸ”’
Thin border around the track: muted grey.
FILL πŸ”’
Completed part: pastel mint green.
LABEL_BG πŸ”’
LABEL_FG πŸ”’
Label text: muted slate on a near-white strip.
TOTAL
Total number of boot milestones. Must match the highest ordinal passed by the call sites in kernel_main / init_apic_subsystem.
TRACK πŸ”’
Empty part of the track: soft lavender grey.

StaticsΒ§

HAS_LAST πŸ”’
LAST_LABEL πŸ”’
LAST_STEP πŸ”’

FunctionsΒ§

band_height
Reserved pixel height of the HUD band: label strip + gap + bar + padding.
fmt_prefix πŸ”’
Writes "[step/total] " into buf, returning the number of bytes written.
last_render πŸ”’
Copy the last drawn milestone into buf and return it.
layout
Computes the HUD band layout for a wΓ—h framebuffer.
push πŸ”’
push_usize πŸ”’
remember πŸ”’
Remember the last drawn milestone so clear_with() can repaint it.
render
Draws the bar at step/TOTAL with a short stage label.