rust-osdev/uefi-rs

Add function that removes a printed character from the screen.

Closed this issue · 6 comments

Add function that removes a printed character from the screen.

You can do this by printing a backspace character (numeric value of 8). Here's a simple example, which I tested in both a VM on a Lenovo Thinkpad X1 Carbon:

#![no_main]
#![no_std]

use uefi::prelude::*;
use uefi::print;

#[entry]
fn main() -> Status {
    uefi::helpers::init().unwrap();

    print!("abcdefghijklmnopqrstuvwxyz");

    for _ in 0..26 {
        // Pause briefly.
        boot::stall(500_000);

        // Print backspace character.
        print!("\x08");
    }

    Status::SUCCESS
}

This prints abcdefghijklmnopqrstuvwxyz, then slowly removes characters one at a time.

for me it does not work.

Maybe my bios does not implement special characters like backspace.

Checking a couple things:

  1. What specific machine are you testing on?
  2. Did you test exactly the code above, or some variation? (I want to make sure we're both testing the exact same thing.)

I used a ASUS M509 DA laptop with a AMD RYZEN 5 procesor.
I tested the same code.

Unfortunately I don't think there's anything we can do here. It sounds like the vendor's implementation just doesn't support this. As an alternative you could potentially use the GraphicsOutput protocol to fully replace the console output with manually-drawn text.