OSDev.org
https://forum.osdev.org/

Extracting font from BIOS?
https://forum.osdev.org/viewtopic.php?f=1&t=23544
Page 1 of 1

Author:  charliesome [ Thu May 05, 2011 6:28 am ]
Post subject:  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?

Author:  Combuster [ Thu May 05, 2011 6:37 am ]
Post subject:  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.

Author:  charliesome [ Thu May 05, 2011 6:51 am ]
Post subject:  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.

Author:  Combuster [ Thu May 05, 2011 7:03 am ]
Post subject:  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?

Author:  turdus [ Thu May 05, 2011 12:07 pm ]
Post subject:  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):
Code:
      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

Author:  charliesome [ Fri May 06, 2011 4:52 am ]
Post subject:  Re: Extracting font from BIOS?

Combuster 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?


I'm going to be running in graphics mode

Author:  Combuster [ Fri May 06, 2011 5:28 am ]
Post subject:  Re: Extracting font from BIOS?

charliesome wrote:
Combuster 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?
I'm going to be running in graphics mode

For what reason do you believe that to be relevant?

Author:  charliesome [ Fri May 06, 2011 5:32 am ]
Post subject:  Re: Extracting font from BIOS?

Combuster wrote:
charliesome wrote:
Combuster 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?
I'm going to be running in graphics mode

For what reason do you believe that to be relevant?


Does the BIOS provide facilities for printing in graphics mode?

Author:  Combuster [ Fri May 06, 2011 5:49 am ]
Post subject:  Re: Extracting font from BIOS?

VGADoc 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

I would deeplink Ralph Brown for the whole set, but it's down ATM :(


Edit: Alternative source - You may also want to bookmark the entire set.

Author:  charliesome [ Fri May 06, 2011 5:58 am ]
Post subject:  Re: Extracting font from BIOS?

That's really cool - thanks :)

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/