Hi !
I'm a beginner to kernel development and I use the vga text mode.
I would like to print the character μ but I don't know how do that. I found on http://en.wikipedia.org/wiki/Code_page_437 this character exist but I don't know how to find it in vga-card.
I'm requesting your help for indicate me the easier way to do that.
Thank you
printing 'μ' character
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: printing 'μ' character
If that character is embedded on the VGA, it will also be in the text mode font since it's a copy of the same thing. Basically the only thing you need to do to get a µ on screen is to do the equivalent of
where E6 is the glyph index for µ and 0F is white-on-black, which is exactly the same as for drawing any other character to the screen.
What might be a problem however is that µ isn't part of ASCII, and has varying indexes in different text encodings, being E6 in VGA, B5 in ISO-8859-1 and windows, and 03BC (amongst others) in Unicode, so if you actually typed an µ in your text editor, chances are likely it's not stored as E6.
Code: Select all
mov word [0xB8000], 0x0FE6
What might be a problem however is that µ isn't part of ASCII, and has varying indexes in different text encodings, being E6 in VGA, B5 in ISO-8859-1 and windows, and 03BC (amongst others) in Unicode, so if you actually typed an µ in your text editor, chances are likely it's not stored as E6.
Re: printing 'μ' character
It works !
Thank you very very very much
Thank you very very very much