flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Fn 0x1100 int 0x10

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
Hello guys.

I use function 0x1100 int 0x10 to set up custom ascii codepage when load my code... but how can i restore previous (default) codepage?

thanks in advance
Post 18 Feb 2010, 09:13
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
simply try to set videomode again with original int 10h function. otherwise you can use a function to get original font before set your, then use it to restore.
Post 18 Feb 2010, 10:49
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
how can i get the original font? i didn't find any int 0x10 functions for this...
Post 18 Feb 2010, 12:52
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
You can read it from BIOS data area...
See Ralph Browns Interrupt List for all the cool stuff!
Post 18 Feb 2010, 13:08
View user's profile Send private message Reply with quote
asmmsa



Joined: 06 Feb 2010
Posts: 45
asmmsa
and how do he locate bios data area?
does x86 contain registers with those informations?
Post 18 Feb 2010, 14:26
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
Quote:

how can i get the original font? i didn't find any int 0x10 functions for this...

no need to get it. just try to simply set videomode with int 10h (say, mode 3): it has to reset font to default.
Code:
                mov     ax,3h
                int     10h
    

do not know if it is always correct or it is described somewhere directly - i just met such behavior with my code.
Post 18 Feb 2010, 14:53
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
yep, seems like setting video mode is enough. and, as always, i didn't think it could be so simple Smile thanks
Post 18 Feb 2010, 15:26
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
The BIOS stores pointer to where font is in memory.
I could be different depending on BIOS ver and desired video mode.
So you can access it via BIOS or just do it manually w/out BIOS.
Setting the mode back to 80*25 via BIOS is ok since BIOS reloads it.
Search for "Tauron VGA" to get some demo code on VGA font programming.
Post 18 Feb 2010, 20:29
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
asmmsa wrote:
and how do he locate bios data area?
does x86 contain registers with those informations?

BIOS Data Area is always present after power on. It's at address 0x40:0

bitshifter wrote:
Search for "Tauron VGA" to get some demo code on VGA font programming.

thanks. I'll check this out
Post 19 Feb 2010, 01:20
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Code:
Flat Memory Model Address      Description
0h - 399h                      IVT
400h - 499h                    BDA
    


Here's one person's map: http://stanislavs.org/helppc/bios_data_area.html
Post 19 Feb 2010, 01:33
View user's profile Send private message Reply with quote
asmmsa



Joined: 06 Feb 2010
Posts: 45
asmmsa
u mean those addreses are fixed?
when someone write bios, its his responsibility to map all things at fixed addreses? or device manufacturers must take care of that?
Post 19 Feb 2010, 09:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17667
Location: In your JS exploiting you and your system
revolution
None of the addresses are fixed. But it is a good idea to stick with them else you will have to code everything for yourself. Because no one else knows what data you have put where and their code won't work.
Post 19 Feb 2010, 09:43
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
zhak,

Subfunctions 01, 02 and 04 of int10/ah11 probably can be used to load default patterns for 8*14, 8*8 and 8*16 character cell sizes, respectively.

Current patterns could be retrieved, but this requires direct graphics controller (GC) programming via ports 3CE/3CF to access plane 2, where chargen is stored.
Post 19 Feb 2010, 11:38
View user's profile Send private message Reply with quote
asmmsa



Joined: 06 Feb 2010
Posts: 45
asmmsa
Quote:
None of the addresses are fixed. But it is a good idea to stick with them else you will have to code everything for yourself. Because no one else knows what data you have put where and their code won't work.

so what an idiot cane up with an idea of creating memory map?

how do i know where i have vga buffer, or how do i know where bios put my bootloader?
Post 19 Feb 2010, 12:14
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
revolution wrote:
None of the addresses are fixed. But it is a good idea to stick with them else you will have to code everything for yourself. Because no one else knows what data you have put where and their code won't work.

asmmsa wrote:

how do i know where i have vga buffer, or how do i know where bios put my bootloader?


why not fixed? it can be assumed a standard since all bioses do that. to load bootloader at 0:7c00, to put BIOS Data Area at 0:0400, segment A000 - is for video memory (B800 for text mode), etc.
Post 19 Feb 2010, 12:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17667
Location: In your JS exploiting you and your system
revolution
asmmsa wrote:
how do i know where i have vga buffer, or how do i know where bios put my bootloader?
You know because every BIOS writer follows the others. But that does not mean the addresses are fixed. A BIOS is free to put things wherever it wants to. Thankfully they don't just put stuff anywhere, or confusion would reign supreme.

Some hardware things are fixed in the sense that things like I/O port numbers can't be changed. But anything memory related can be moved. If it wanted to, the BIOS could set up PM mode and map things anywhere.
Post 19 Feb 2010, 12:48
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
baldr,

gosh! really, this is it! Fn 0x1104 to load default font stored in ROM.
Post 19 Feb 2010, 12:51
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
asmmsa wrote:
u mean those addreses are fixed?
when someone write bios, its his responsibility to map all things at fixed addreses? or device manufacturers must take care of that?

Fixed is realitive to the system manufacturer. But for the most part the majority of parameters within the BIOS Data Area are fixed. The Extended BIOS Data Area is a lot more difficult to get answers to. Each manufacturer sets up their system according to their own specifications. Most try to make them compatible so that OS' can use the information within these areas (along with CMOS etcetera). But, there is no real standard or one Rosetta Stone that you can rely on to get information for your OS. This is why you will see OEM versions of OS' and each one is tweaked to meet the needs of a particular platform (system).
Post 20 Feb 2010, 11:44
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
asmmsa wrote:
Quote:
None of the addresses are fixed. But it is a good idea to stick with them else you will have to code everything for yourself. Because no one else knows what data you have put where and their code won't work.

so what an idiot cane up with an idea of creating memory map?

how do i know where i have vga buffer, or how do i know where bios put my bootloader?


Why do you call people names? That is impolite!
Post 20 Feb 2010, 11:46
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
zhak wrote:
baldr,

gosh! really, this is it! Fn 0x1104 to load default font stored in ROM.
Yes, for the most part, but baldr is making it sound simple and the fact is it is not entirely that easy because not all systems will use fonts the same with a given screen size (x by y matrix). baldr eluded to the planes and CG but there is at least a disertations worth of information to understand in being able to successfully use different fonts on multiple platforms. If you are writing this for your system alone, you are probably ok since you will tweak it to meet your needs, but in order to make it coherent on "all" systems you'll want to write error checking routines that let you decide on and check installed fonts.
Post 20 Feb 2010, 11:52
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.