|
-
Dec 18th, 2001, 10:56 AM
#1
Protected mode VGA
Im writing external VGA routines in assembly to be used with gcc, I know how to plot a pixel in real mode vga, but how do i do it in protected mode in external assembly? Im using nasm by the way.
-
Dec 29th, 2001, 09:21 PM
#2
Junior Member
This is how I did it in nasm, but on its own (without gcc).
For 320*200 I set GS base=0x00A0000, limit=320*200-1 then go
mov gs:[x+320*y],colour
I'm assuming you're in PM already cause of gcc
-
Dec 30th, 2001, 12:00 AM
#3
Ok i messed around with it for a little while, and when i use gs, i get a general protection fault. Could you do a quick example please.
You talk about setting the base and limit of gs. Is this a PM thing cuz ive never heard of it while using real mode before.
-
Jan 4th, 2002, 07:34 PM
#4
Junior Member
Here's a bootloader that goes into protected mode with paging. You know about real mode stuff. Just ignore the paging, I don't think that gcc uses it, although Win32 does.
RM: ds:bx = ds*16+bx (segment)
PM: ds:ebx = ds.base+ebx (selector)
Therefore, if ds.base=0x000A0000 and ebx=(320*y+x), then
mov [ds:ebx],al
sets (x,y) to al
Also you have selector limits for your own protection. If you go over that limit then you get a GPF. e.g. if ds.limit=1000 and you go
mov [ds:1001],al
then you get GPF.
Grab some good files off that operating systems site www.nondot.org/sabre/os/articles
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|