flat assembler
Message board for the users of flat assembler.

Index > OS Construction > UEFI how to string in different colors

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 27 May 2016, 19:12
UEFI standard tells about control sequences that can be used with OutputString function of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. It seems I've tried all possible variants of escape sequences to apply different colors within one string. None worked.

Maybe anybody knows if it's possible (and how) to apply different colors within one string?
Thanks in advance
Post 27 May 2016, 19:12
View user's profile Send private message Reply with quote
Feryno



Joined: 23 Mar 2005
Posts: 514
Location: Czech republic, Slovak republic
Feryno 28 May 2016, 13:27
Hi, the only one way to change the background and foreground colors for OutputString() is by:
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
SetAttribute()
http://wiki.phoenix.com/wiki/index.php/EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL#SetAttribute.28.29
I've never heard about control sequences used to change colors, but I did only small work in uefi and it was few years ago.
Post 28 May 2016, 13:27
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MrFox



Joined: 17 Aug 2016
Posts: 52
Location: Russia
MrFox 11 Nov 2016, 10:40
Yes, SetAttribute works. EFI color constants are defined in the spec.
I'm soon going to make another tutorial on Simple Text Output to print a colored string centered on the screen (to show usage of ClearScreen, GetMode, SetAttribute, SetCursorPos,OutputString).
Different colors within one string require a sequence of SetAttribute-OutputString's. I've heard about escape sequences (also defined in the Spec) but never tried them.
Post 11 Nov 2016, 10:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.