does anyone know where in ram i could find the bios fonts data, i think they are in bios rom and they are loaded somewhere in ram during the boot...

i found some 8x8 fonts somewhere near the end of the 1st meg i think, but dunno if its standard on all pcs,if there are other locations, other fonts, etc.

any help or links to info on this would be nice...

Posted on 2004-03-22 04:28:26 by HeLLoWorld
Here's some uncommented 16bit asm taken from an inline-asm pascal snippet. I used it back in the 16bit days, and it worked great - more reliable than various bios calls or direct-memory access stuff.

I wouldn't even think about accessing this stuff from a pmode access, rather grab it with a dos app and include the font in your executable.
Posted on 2004-03-22 08:48:35 by f0dder
uncommented is the word!
almost a disassembly!
no names for constants, no comments...

it seems to be messing with the vga controller though, and i dont know this one well.
thanx anyway.

i would have wanted a physical constant address where to fetch the fonts without doing anything before...

if i would hardcode it in my exe, i could as well use my own font :)
(256*(8*8))/8=2Kb i think
not that it takes that much space, but...dunno.
Posted on 2004-03-22 10:11:21 by HeLLoWorld
Well, if you're making a DOS application, then you should just read the font using the way prescribed by f0dder. (the latter part should be modified in a way appropriate to the graphic mode you will be using)
Posted on 2004-03-22 11:11:21 by Sephiroth3
but what does it do??

doing some OUTs, copying some vram, doing some OUTs, doing an int...


cant i read a font at a fixed physical standard address somewhere in bios rom or video bios rom? (or shadowed)
Posted on 2004-03-22 11:44:36 by HeLLoWorld
I once wrote a DOS program for editing and applying fonts (8x16 fonts only)... I have no idea if I've still got the source or not, it would take some digging to find it....

I used INT 10h functions in the prog... Don't remember using any constants, though... I don't know offhand, but I'd suspect that different BIOSes and different versions might store the data at different locations. The BIOS function INT10h can be used to locate the table, you just need to know what table you're looking for. Something like this:

mov ax, 1130h ; (Get font information)
mov bh, 06h ; 8x16 font (vga/mcga)
int 10h ; Do it.

This will return the segment:offset of the 8x16 character table in ES:BP. The machine I'm sitting at right now returns C000:3920. This will vary (as will the particular font) depending on video mode.

Don't know if that's any help to you or not, but there it is.
Posted on 2004-03-22 12:53:05 by Volponi
I'm sorry about the very uncommented state, especially for something as fancy as port I/O, but it's a code snippet I found elsewhere, and "it's been a while" - the datestring in the .pas file says 1997/06/24 :).

if i would hardcode it in my exe, i could as well use my own font :)

Which is what you should do for 32bit apps. I would even include a .fnt with my app if I needed a rom bios font in a 16bit app, to be 100% sure I grab the font data I want (and that it works at all :P).

I'll dig around a bit and see if I can find some comments for the code snippet. I took the posted piece of code for my age-old 8x16 font editor. The original must have come from the SourceWare Archival Group, one really good resource for pascal programmers (there's still some useful info left, I guess) - http://www.gdsoft.com/swag/ .

The int 10h BIOS method was unreliable for me back in the days. Sorry that I can't remember the details, but it's 7+ years, and I don't have fond memories of the limitations of the DOS days. Another method to get the font data would be through the interrupt table, a couple of entries are hardcoded ROM BIOS font vectors rather than interrupt handlers - this method wasn't 100% reliable, either.
Posted on 2004-03-22 13:26:03 by f0dder
The 8x8 font is at F000:FA6Eh (seg:offs) but that's only the first 128 characters. Use interrupt 1Fh to get the rest. Interrupt vector 43h references the EGA/VGA font table which is where you will probably find the other fonts.
Posted on 2004-03-24 15:18:45 by iblis