Excuse my idiotic question, but I can't seem to find even one satisfying answer from the internet. I mean we can see character 'X' displayed on the screen right from the PC's start screen. But how would the computer know that the bit patterns is translated to 'x'? Who gives such definitions? Is it the BIOS, the OS, the CPU or the display driver or the apps?
-
Why do you ask? What for? On which OS? – Basile Starynkevitch Nov 02 '14 at 14:13
-
Please *edit your question* to *improve it*. Your question is not clear. What kind of software do you want to code (an OS kernel, a graphical application, then for what operating system)? – Basile Starynkevitch Nov 02 '14 at 14:22
-
I ask this because I am confuse, regardless of OS. I mean computer only knows bits and bytes. They don't understand things like 'A' or anything. So when it comes to things like ASCII or UTF, I am completely lost on how things got translated and by whom. – royalfinest Nov 02 '14 at 14:24
-
You should in practice not care. You will code for a given OS, and that OS will provide you an API to draw some text somewhere. – Basile Starynkevitch Nov 02 '14 at 14:30
-
But there is "Loading Operating System..." during the start up. AFAIK, OS isn't there yet. That means there is a Character Set exists somewhere even before the OS takes over. I am confuse. – royalfinest Nov 02 '14 at 14:33
-
This is the BIOS, or the boot loader, doing VGA things. – Basile Starynkevitch Nov 02 '14 at 14:33
-
That means BIOS does maintain a temporary character table (ASCII minimal). Is it not? Where is it maintained? is it in the video ROM or in the BIOS ROM? – royalfinest Nov 02 '14 at 14:39
-
1I answerered that VGA cards had some ROM with a font inside. But IIRC it is only used by the BIOS and at early boot time. But in practice you are coding for some operating system, which provides you some abstraction (some service) to display things. Lower-level details matter only if you are coding an OS kernel and are system & hardware specific. – Basile Starynkevitch Nov 02 '14 at 14:41
-
Ok. I take it that the earliest ASCII character set is maintained in VGA ROM. That is starting to makes sense. So the first thing that makes the CPU 'understands' A,B,C... are the VGA ROM. – royalfinest Nov 02 '14 at 14:46
-
Again, you should edit your question to improve it. Either you are coding -e.g. an OS kernel- on the bare metal (and then you should dive into hardware specifications), or you are using some OS, then that OS gives you an API to display things. – Basile Starynkevitch Nov 02 '14 at 14:48
-
Ok thanks for the answers. Sorry for the trouble. I can't vote you up. My reps are quite low. Next time. – royalfinest Nov 02 '14 at 14:50
-
Please take time to follow the many links I gave you. – Basile Starynkevitch Nov 02 '14 at 14:53
-
1@royalfinest Actually, on PCs, ASCII has never been a primary character set. Video card ROMs had a font for [IBM437](http://en.wikipedia.org/wiki/Code_page_437) or similar, which was the primary character set used by PC-DOS and MS-DOS, too. – Tom Blodget Nov 02 '14 at 23:53
1 Answers
It depends at which moment, and with which operating system, and on which hardware. For Linux on a current x86 PC desktop:
At early boot time, it uses the VGA driver (and the BIOS also has some limited display functions). IIRC, the original VGA cards had some ROM containing a fixed width font, and that is still used (in some compatibility mode).
IIRC, graphics cards have a ROM for the BIOS and for their initial VGA font. But this is only used at BIOS time or during the early boot process.
But most of the time, a Linux desktop uses its X11 server Xorg. The server manages fonts, and display them using the graphics video card (which often has a GPU), probably by copying appropriate bitmaps. The X11 protocol knows about fonts, but today most applications use the client side Xft.
The future Wayland architecture would have fonts on the client side.
You might look on OsDev, it has several related pages.
Low-level graphics libraries like libSDL or OpenGL (or Xlib) have functions to draw text in an arbitrary font, e.g. XDrawText originally, or XftDrawString
with Xft.
High-level graphical user interface toolkits like Qt or Gtk provide widgets with text display, generally around their event loop.
In the gory details, things are complex and hardware specific (and sadly, some graphics cards manufacturers -e.g. Nvidia- don't publish the specification of their hardware - so it needs to be reverse engineered). This is why you use an operating system which will provide you some abstraction to code on.

- 223,805
- 18
- 296
- 547
-
that means the video maintain a table for character set translations at all times? – royalfinest Nov 02 '14 at 14:10
-
-
I assume then that the OS will take over the parsing (or whatever it is called) tasks after that? That means for most of the time, until I switch it off, the OS will provide the translation service right? – royalfinest Nov 02 '14 at 14:14
-
I don't understand what you mean by "translation service". It is just an API, e.g. a set of library functions, to display text. – Basile Starynkevitch Nov 02 '14 at 14:16
-
Sorry, I don't really know how to put this clearly. You are expecting too high for my question. I take it that things like BIOS will provide such bit-to-char translations and display it on the screen. Then the OS will take over and will provide the same 'service' or anything like that. Is it correct? – royalfinest Nov 02 '14 at 14:20
-
You really should explain why you are asking? Are you coding an OS kernel, or do you simply want to code a GUI application? For which platform? – Basile Starynkevitch Nov 02 '14 at 14:21