flat assembler
Message board for the users of flat assembler.

Index > Main > VGA text modes

Author
Thread Post new topic Reply to topic
flash



Joined: 11 Mar 2006
Posts: 55
Location: Cuba
flash
Hi guys:
I am trying to write a little OS kernel that can be used whith a very simple but practical (like Linux Wink ) shell. I want not to use this 80x25 obscene text mode. As far as I know (SuSE is the best example I can show) SVGA can manage 130x50 text modes and so. Can someone tel me what I need to code? Because all the bibliography I could find on the Internet, and some books on my disposal tell that:
Code:
mov     AX,4F02h
mov     BX,10Ch
int     10h
    

will set the 10Ch text mode but it do not works to me. I test Windows, DOS and Linux. NO WAY Evil or Very Mad .
Please what is missed...
Thanks

_________________
i don't hate goto
Post 07 Dec 2006, 20:44
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
I don't know if you have this or not, but this PDF is what helped me. Look at Function 02h, it should explain it enough to help you. Also, check out http://www.ctyme.com/intr/rb-0275.htm if you haven't already. Hope this helps!


Description:
Download
Filename: vbe3.pdf
Filesize: 271.58 KB
Downloaded: 197 Time(s)

Post 07 Dec 2006, 21:07
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Bah, Win XP is screwy, so no promises that it works there, but in DOSBOX 0.65 (at least, and probably real DOS too), this should go to 80x50 (better than nothing, at least, although I personally ain't comfortable with text that small):

Code:
; set 80x50 text mode
org 100h

mov ax,1112h
xor bx,bx
int 10h 

ret
    


Last edited by rugxulo on 07 Dec 2006, 21:37; edited 1 time in total
Post 07 Dec 2006, 21:08
View user's profile Send private message Visit poster's website Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Rugxulo - Do you think WinXP is "protecting" people from accessing that mode? I'm trying it and it's not working.
Post 07 Dec 2006, 21:20
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Win XP does weird things in the name of DOS compatibility (e.g., if you run a DOS program, the prompt (assuming $p$g) will change to SFN instead of LFN). I think they also restrict DOS programs to (mostly?) only 80x25 or 80x50 (nothing exotic). Someone else probably knows more details about this than me (revolution, Dex, Tomasz, pretty much anybody really Razz).

<EDIT>
flash, all that does for me if make the DOS window full-screen (Win XP Home SP2). In DOSBOX 0.65, it does nothing noticeable (it returns 0000_014Fh in EAX w/ no carry set, if that helps).
</EDIT>


Last edited by rugxulo on 08 Dec 2006, 03:40; edited 1 time in total
Post 07 Dec 2006, 21:32
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I use that mode for DexOS CLI, also i used it for DexOS editor, but it's not good on the eye's, so i am making a 80x25 ver of the editor, i must be getting old Laughing .

http://www.dex4u.com/editor.htm
Post 07 Dec 2006, 22:43
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Here's a few:

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ScreenMode160x64 - Change screen size if machine is capable.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ScreenMode160x64:

    pusha

    mov ax,4F02h                    ; VESA Call
    mov bx,6Bh                      ; 160 x 64 screen size
    int 10h                         ; Call the interrupt
    
    cmp al,4Fh                      ; Compare to check if call is supported
    jne .Done                       ; If not supported, head out
    
    cmp ah,1                        ; Compare to see if the call was successful
    jne .Done                       ; If not successful, head out
                                    ; If successful, update BIOS
    push es                         ; Save ES
    mov ax,0                        ; Place 0 into AX
    mov es,ax                       ; Put 0 into ES
    mov ax,160                      ; Place number of columns in AX
    mov [es:44Ah],ax                ; Set number of columns in BDA
    mov al,63                       ; Place number of columns in AL
    mov [es:484h],al                ; Set number of rows - 1 in BDA
    pop es                          ; Restore original ES   
    
.Done:
        
    popa

    ret
    


Now instead of 6Bh in BX, you can change that to the following:

22h - 100x37
108h - 80x60
109h - 132x25
10Ah - 132x43
10Bh - 132x50
10Ch - 132x60

CAUTION: Use 100x37 and 164x60 at your own risk. I can not get them to work consistently and haven't had time to investigate why. Also, it is wise to update the BIOS Data Area to reflect the changes you've made, otherwise things can get screwed up.
Post 07 Dec 2006, 23:07
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth
Regretably there is no guarantee that VESA text modes 108h-10Ch are implemented.

If you have to be sure, you must restrict yourself to VGA compatibility.

The best that any VGA can offer are 480 scan lines, that is, if you use a font with 8x8 character size, you can get 60 lines. With a 14 pixel font, you can get 34 lines at best.

You might need to program the CRT and sequencer directly to get these resolutions.
Post 08 Dec 2006, 16:24
View user's profile Send private message Visit poster's website Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
Hello Flash!

Quote:

will set the 10Ch text mode but it do not works to me. I test Windows, DOS and Linux. NO WAY.
Please what is missed...


Have you made sure that your current video card actually supports the modes you try to set up?. Many video cards do not support certain (text)modes.
You can use eg. whatvga program to test your video card. Just Google it and you should find it.

regards,
Mac2004
Post 08 Dec 2006, 21:05
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Japheth wrote:
Regretably there is no guarantee that VESA text modes 108h-10Ch are implemented.

If you have to be sure, you must restrict yourself to VGA compatibility.


You can test them, as I have above, no need to limit yourself if you don't have too. Also, you could program the ports as you mentioned, but that is a lot more difficult that testing VESA any day.
Post 09 Dec 2006, 05:09
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Mac2004 wrote:
You can use eg. whatvga program to test your video card. Just Google it and you should find it.

regards,
Mac2004


There's also a program out there name VMODE.EXE and it has ASM source. It is under one of the DOS utilities sites.
Post 09 Dec 2006, 05:12
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth
smiddy wrote:
Japheth wrote:
Regretably there is no guarantee that VESA text modes 108h-10Ch are implemented.

If you have to be sure, you must restrict yourself to VGA compatibility.


You can test them, as I have above, no need to limit yourself if you don't have too. Also, you could program the ports as you mentioned, but that is a lot more difficult that testing VESA any day.


There's a lot of cards which don't implement support for extended VESA text modes (nvidea for example).

OTOH, reprogramming the VGA registers is not that difficult. In DOS - not in a DOS Box - I often use a 100x37 text mode resolution with Volkov Commander, which is based on a 800x600 pixel resolution and looks pretty good. Setting the mode is done by a small self-written tool. Is is attached, but is not written with FASM.


Description:
Download
Filename: SETM37.ZIP
Filesize: 3.98 KB
Downloaded: 195 Time(s)

Post 09 Dec 2006, 15:22
View user's profile Send private message Visit poster's website Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Japheth wrote:
smiddy wrote:
Japheth wrote:
Regretably there is no guarantee that VESA text modes 108h-10Ch are implemented.

If you have to be sure, you must restrict yourself to VGA compatibility.


You can test them, as I have above, no need to limit yourself if you don't have too. Also, you could program the ports as you mentioned, but that is a lot more difficult that testing VESA any day.


There's a lot of cards which don't implement support for extended VESA text modes (nvidea for example).


I don't disagree, but for ease of use, the BIOS seems to be easier than programming the VGA ports.

Japheth wrote:
OTOH, reprogramming the VGA registers is not that difficult. In DOS - not in a DOS Box - I often use a 100x37 text mode resolution with Volkov Commander, which is based on a 800x600 pixel resolution and looks pretty good. Setting the mode is done by a small self-written tool. Is is attached, but is not written with FASM.


A cursory look seems quite nice. Once I get the opportunity I'll give it a further critical look. I personally don't know how/when to program the ports or what all the registers are for VGA (SVGA, XVGA, etcetera). Understanding how to implement it would go a long way into understand what has to be done to get what one wants from the VGA ports.
Post 09 Dec 2006, 16:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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.