0

If we call the INT 10h and set its parameters via assembly language, and then compile this code into a binary and write it into the boot sector of the floppy disk, we can output a string on the bare metal(or virutal machine without OS) screen.

...
; INT 10h
; When AH = 13h
; ES:BP = Offset of string
; CX = length of string
; AL = Write mode
; BH = Page Number, BL = Color
; DL = Column
mov ax, BootMessage
mov bp, ax
mov cx, 12
mov ax, 01301h
mov bx, 000ch
mov dl, 0
int 10h
jmp $           ; while (true)
BootMessage: db "Hello World!"
...

output a string on the bare metal screen

I am wondering how does the BIOS control the glyph of each character? On some computers, why the "A" on the screen is similar to the "A" in Sans-serif font, not Courier? But on other computers, it may be another font.

Are there some 0-1 matrices built into the BIOS or a certain ROM? For example, the 0-1 matrix in the picture below corresponds to the character A.

0-1 matrix for letter A

1 Answer 1

2

Before the OS loads, the BIOS controls how text is written. The BIOS itself has instructions to print basic text to the screen. It needs this in order to draw its own BIOS screen. Whatever font was hardcoded in the BIOS, is what is being used lateron.

When you send this code to the BIOS, it translates this into changing the color of certain pixels. While you would expect that it only prints the forecolor, it will actually also print the backcolor. Otherwise text would overlap creating a mess.

It does indeed follow a matrix for each letter based on a fixed size, and it is possible to change the character romset during runtime.

This is how textmode-based games were made on the C64. The programmer often changed the font to be able to draw nice graphics. Sometimes it was just as simple as placing the player sprite inside a character, and move that around.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .