flat assembler
Message board for the users of flat assembler.

Index > OS Construction > VGA 640x480x16 GUI

Author
Thread Post new topic Reply to topic
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 12 Mar 2011, 15:50
Hi, I'm writing real mode operating system like that in VGA 640x480x16 draw the window, and graphical cursor?

PS. Desirable means of BIOS
Post 12 Mar 2011, 15:50
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 12 Mar 2011, 16:41
Believe me - you don't want to mess with 16 colors modes. Smile
Better check VESA modes at minimum 256 colors.

About GUI - it is a long story. You have to make first some hardware layer - drivers for mouse, keyboard and video, that to allow at least minimal functionality.

Also, writing code - think about the future - real mode is simply compatibility mode of the modern processors. The native mode is protected mode and it is not so complex, as you can think.

Regards.
Post 12 Mar 2011, 16:41
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 12 Mar 2011, 17:59
For example kolibriOS or even Windows NT supports VGA 640x480x16 ... Well for example in sheltered how to do this GUI

but without VESA ... only pure VGA, well, and color and are not as important enough 16 colors
Post 12 Mar 2011, 17:59
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
roboman



Joined: 03 Dec 2006
Posts: 122
Location: USA
roboman 12 Mar 2011, 18:45
I'm in the middle of doing some sprite and blitter stuff for a game. Some good stuff here (not mine): http://www.nondot.org/sabre/graphpro/ it's mode 13, but it's clear what every thing does and should be easy to convert over. It's not a true blitter or sprite, in that you need to double buffer and keep an 'undamaged' copy of the background some where in memory.

The main problem with any thing less then 256 colors (except text modes) is that each 8 bit byte is more then one dot on the screen, so your SetPixel / PutPixel has to read the graphics card memory, change only the part of the byte that needs to be changed and then write the new byte to the video memory. It's just more work and slower.

I miss the Amiga with hardware sprites and a hardware blitter Smile
Post 12 Mar 2011, 18:45
View user's profile Send private message Visit poster's website Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 14 Mar 2011, 09:25
What are the functions of the BIOS draw Window? ah = 09H, 0aH, 13H int 10h? or another? show an example please. And how to display a graphical mouse cursor?
Post 14 Mar 2011, 09:25
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 14 Mar 2011, 10:10
BIOS does not provide window drawing functions, mouse cursors and graphical functions at all.
You have to do it yourself (by hand, manually, in your own code).
The other solution is to use some third party graphic library.

P.S. AFAIK, there are PutPixel and GetPixel, but the BIOS implementation is very, very slow. And you actually don't need pixel functions at all.

Regards
Post 14 Mar 2011, 10:10
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 14 Mar 2011, 11:17
And if no BIOS then it should be directly into video memory to draw?
Post 14 Mar 2011, 11:17
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 14 Mar 2011, 11:32
Are there any lessons to create a GUI in VGA or VESA? but only in real mode
Post 14 Mar 2011, 11:32
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
BOTOKILLER



Joined: 07 Jan 2011
Posts: 154
Location: Ukraine
BOTOKILLER 14 Mar 2011, 12:09
yes, thats good question, I found this
http://forum.osdev.org/viewtopic.php?f=1&t=6988
there a few links on page, (I willcheck those out too)
Post 14 Mar 2011, 12:09
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 14 Mar 2011, 12:10
just look the magic instructions there, for 1 bit per pixel only.
Code:
BT [vgamem],pixeladress   ;test a pixel
BTC [vgamem],pixeladress  ;complement a pixel
BTR [vgamem],pixeladress  ;reset a pixel
BTS [vgamem],pixeladress  ;set a pixel
    


for 4 bits per pixels, use 4 of them, to set the corresponding color.
then no need to read the video memory.
but needs at least 4 instrucitons, or a simple 4 times loop for pixel write
Post 14 Mar 2011, 12:10
View user's profile Send private message Visit poster's website Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 14 Mar 2011, 15:43
Are there any more tutorials for creating GUI or sources with a simple GUI?
Post 14 Mar 2011, 15:43
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 14 Mar 2011, 16:39
MegaCoder wrote:
Are there any more tutorials for creating GUI or sources with a simple GUI?


You can check some of the many assembly OSes out there:

MenuetOS
Menuet fork - KolibriOS
DexOS
SolarOS

Most of them are open source, except MenuetOS64, so you can download the sources.

Regards
Post 14 Mar 2011, 16:39
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 15 Mar 2011, 14:04
I can not understand how to draw a window just does not know where to start! Please show example how general can be to draw a window
Post 15 Mar 2011, 14:04
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 15 Mar 2011, 14:41
to draw a window, you need to draw the elements of the window.
a window is not an atom, it is an assembly of many elementary shapes.

rectangle, frames, pictures, some lines, some text, some things and others.

and all share a common data, the coordinates and color properties.

that's a window.
Post 15 Mar 2011, 14:41
View user's profile Send private message Visit poster's website Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 15 Mar 2011, 14:49
I wrote this code but I do not think that this is a GUI looks like:
Code:
call gui_window
call title_bar

proc title_bar
mov ah,6
mov al,0
mov bh,0110b
mov ch,4
mov cl,6
mov dh,4
mov dl,42
int 10h
ret
endp

proc gui_window
mov ah,6
mov al,0
mov bh,1111b
mov ch,4
mov cl,6
mov dh,20
mov dl,42
int 10h
ret
endp
    

but it is a bios interrupts
Post 15 Mar 2011, 14:49
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 15 Mar 2011, 15:21
click on my www to see what can be behind a gui in real mode.

or click here.
because apparentlly, this server works only the night.

http://board.flatassembler.net/topic.php?t=8645
Post 15 Mar 2011, 15:21
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 15 Mar 2011, 17:32
If you chose vesa in realmode you need to use bank switching, here is a example:
http://board.flatassembler.net/topic.php?t=10857
Post 15 Mar 2011, 17:32
View user's profile Send private message Reply with quote
MegaCoder



Joined: 31 Jan 2011
Posts: 13
Location: Russia
MegaCoder 19 Mar 2011, 16:42
Thanks...
Post 19 Mar 2011, 16:42
View user's profile Send private message Visit poster's website ICQ Number 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.