Extracting font from BIOS?
-
- Posts: 8
- Joined: Tue Jan 26, 2010 4:46 pm
Extracting font from BIOS?
Is there any way to reliably read the BIOSes 8x8 font set?
I've looked into various mechanisms including interrupt vector 0x1F which is mentioned on RBIL, but I've had no luck.
Anybody know anything about this?
I've looked into various mechanisms including interrupt vector 0x1F which is mentioned on RBIL, but I've had no luck.
Anybody know anything about this?
- 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: Extracting font from BIOS?
The regular methods to do so are VGA-specific. You can probably use int 0x43 as it should point straight to the font.
For a portable solution: just get it from somewhere, then bundle it with your OS. The VGA font is void of copyright so nothing is preventing you from doing so. A shameless plug might help you even further.
For a portable solution: just get it from somewhere, then bundle it with your OS. The VGA font is void of copyright so nothing is preventing you from doing so. A shameless plug might help you even further.
-
- Posts: 8
- Joined: Tue Jan 26, 2010 4:46 pm
Re: Extracting font from BIOS?
Thanks for the int 0x43, looks like it's what I'm after.
Bundling the font isn't an option though, I need my code to fit in the bootsector so I need to try to conserve my bytes.
Bundling the font isn't an option though, I need my code to fit in the bootsector so I need to try to conserve my bytes.
- 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: Extracting font from BIOS?
In that case, why don't you use int 10 to have the video bios print the text for you instead of having to add custom code for it?
Re: Extracting font from BIOS?
The answer to your question is Int 10/AX=1130h/BH=6 (use RBIL for details). Will return a pointer to font bitmap in es:bp.
I use this code (query pointer and copy font from vga memory to a well known location):
I use this code (query pointer and copy font from vga memory to a well known location):
Code: Select all
mov ax, 1130h
mov bh, 6
int 10h
push es
pop ds
xor ax, ax
mov es, ax
mov si, bp
mov di, charmap
mov cx, 400h
repnz movsd
...
charmap: db 4096 dup 0
-
- Posts: 8
- Joined: Tue Jan 26, 2010 4:46 pm
Re: Extracting font from BIOS?
I'm going to be running in graphics modeCombuster wrote:In that case, why don't you use int 10 to have the video bios print the text for you instead of having to add custom code for it?
- 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: Extracting font from BIOS?
For what reason do you believe that to be relevant?charliesome wrote:I'm going to be running in graphics modeCombuster wrote:In that case, why don't you use int 10 to have the video bios print the text for you instead of having to add custom code for it?
-
- Posts: 8
- Joined: Tue Jan 26, 2010 4:46 pm
Re: Extracting font from BIOS?
Does the BIOS provide facilities for printing in graphics mode?Combuster wrote:For what reason do you believe that to be relevant?charliesome wrote:I'm going to be running in graphics modeCombuster wrote:In that case, why don't you use int 10 to have the video bios print the text for you instead of having to add custom code for it?
- 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: Extracting font from BIOS?
I would deeplink Ralph Brown for the whole set, but it's down ATMVGADoc wrote:----------1009-------------------------------
INT 10 - VIDEO - WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION
AH = 09h
AL = character to display
BH = page number (00h to number of pages - 1) (see AH=00h)
BL = attribute (text mode) or color (graphics mode)
if bit 7 set in graphics mode, character is xor'ed onto screen
CX = number of times to write character
Notes: all characters are displayed, including CR, LF, and BS
replication count in CX may produce an unpredictable result in graphics
modes if it is greater than the number of positions remaining in the
current row
Edit: Alternative source - You may also want to bookmark the entire set.
-
- Posts: 8
- Joined: Tue Jan 26, 2010 4:46 pm
Re: Extracting font from BIOS?
That's really cool - thanks