UEFI text output

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

UEFI text output

Post by PeterX »

Sorry for the naive question, but:

There is ConOut etc. in the UEFI system table. And you can envoke OutputString(). But I think I've read somewhere that UEFI hasn't a text video mode. This seems to be a contradiction.

Can you explain that?

Greetings
Peter
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: UEFI text output

Post by Octocontrabass »

It uses a bitmap font to draw the text.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: UEFI text output

Post by kzinti »

You can use conout/conin until you call ExitBootServices(). After that, you are on your own.

I suppose the point is that you can use them to implement some simple menu to display options before booting your kernel.
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: UEFI text output

Post by bzt »

PeterX wrote:Sorry for the naive question, but:

There is ConOut etc. in the UEFI system table. And you can envoke OutputString(). But I think I've read somewhere that UEFI hasn't a text video mode. This seems to be a contradiction.
Under UEFI the console is not a real device. It's a meta device.
PeterX wrote:Can you explain that?
When the low-level devices are initialized, they register hooks in the console. For example it is pretty common that video drivers register a ConOut handler that prints bitmap fonts, but serial port drivers also register a function that can interpret ANSI escape sequences. For TianoCore this is the default, on real machines you usually have an option in the boot menu to add more devices to the console. It is possible to set up UEFI in a way that ConOut->OutputString() only prints to the serial port, but not on screen.

Similarly ConIn is a meta device too, PS/2 (if exists), USB HID and serial port registers hooks in run-time during boot to actually implement that. If it's configured, then you can use CSI codes over serial instead of a keyboard.

Cheers,
bzt
Post Reply