Page 2 of 2
Re: VGA in Pmode Not Working
Posted: Wed Feb 11, 2009 5:59 pm
by purage
Here is my real mode GDT:
Code: Select all
gdt:
dw 0, 0, 0, 0
db 0xFF
db 0xFF
db 0x00
db 0x00
db 0x00
db 10011010b
db 0xCF
db 0x00
db 0xFF
db 0xFF
db 0x00
db 0x00
db 0x00
db 10010010b
db 0xCF
db 0x00
db 0xFF
db 0xFF
db 0x00
db 0x00
db 0x00
db 11111010b
db 0xCF
db 0x00
db 0xFF
db 0xFF
db 0x00
db 0x00
db 0x00
db 11110010b
db 0xCF
db 0x00
db 0x00
db 0x00
db 0x00
db 0x00
db 0x00
db 0; 10001001b
db 0; 01000000b
db 0x00
;; code segment for realmode
db 0xFF, 0xFF
db 0, 0, 0
db 0x9A
db 0x8F, 0
;; data segment for realmode
db 0xFF, 0xFF
db 0, 0, 0
db 0x92
db 0x8F, 0
gd_reg:
dw 8192 ;<-- (with paging, should this be 4096?)
dd gdt
Here is where cr0 gets set:
Code: Select all
cli
mov eax, cr0
or al, 1
mov cr0, eax
jmp 0x8: _protected ; switch to 32 bits
I hope this was what you were looking for. thank you.
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 3:57 am
by purage
I figured out what I should do. I will just enable 0x115 mode, enable paging, and map the LFB address to an address accessible to my kernel. I have a pretty good idea of what needs to be done and I already converted my loader to do the VESA mode switching part, so I am hoping that I can pull this off and start working with some prettier colors real soon. thanks anyway for looking at my code.
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 4:04 am
by Combuster
This is all like
"lets build the skyscraper because I couldn't be bothered to fix the fundament supporting it"
in other words: Bad Idea(tm)
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 8:16 am
by jal
Combuster wrote:This is all like "lets build the skyscraper because I couldn't be bothered to fix the fundament supporting it"
I thought it was more like "let's build a skyscraper because I failed to build a hut", but yeah, that
is a bad idea. Somehow, however, I think the OP cannot be bothered, and will start the thread "VESA in Pmode Not Working".
JAL
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 11:08 am
by Creature
Love4Boobies wrote:INDEX = (Y * 320 + X)
Are you sure that's correct? What about the colour depth?
PixelId = (Coord.Y * ScreenWidth + Coord.X) * ( ScreenBpp / 8 ))
Where ScreenBpp = Bits Per Pixel and PixelId is the index of the video buffer in bytes.
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 11:11 am
by eddyb
Creature wrote:Love4Boobies wrote:INDEX = (Y * 320 + X)
Are you sure that's correct? What about the colour depth?
PixelId = (Coord.Y * ScreenWidth + Coord.X) * ( ScreenBpp / 8 ))
Where ScreenBpp = Bits Per Pixel and PixelId is the index of the video buffer in bytes.
He assumed a 8 bit depth and the width 320. But you are right, that's how it can be calculated for different depths.
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 12:26 pm
by purage
Actually smart mouth, I could start a thread with "Vesa in Pmode is working!!" And, all I asked for was some help, and I didn't get it because your moderator was too focused on my posting technique rather than my question and no one else offered up any suggestions, so I researched my own way, found it, implemented it, and now I don't need any help; case closed. Have a nice day.
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 1:18 pm
by Zenith
purage wrote:so I researched my own way, found it, implemented it, and now I don't need any help; case closed. Have a nice day.
I thought you were supposed to do that BEFORE you post about your problems?
Oh well, congratulations - mind telling the forum what was wrong in your original code?
Re: VGA in Pmode Not Working
Posted: Thu Feb 12, 2009 2:33 pm
by jal
Zenith wrote:Oh well, congratulations - mind telling the forum what was wrong in your original code?
He probably won't, since instead of him looking cool (in his mind, for finding his problem) he'll look stupid (since no doubt it's a silly bug.
JAL
Re: VGA in Pmode Not Working
Posted: Fri Feb 13, 2009 1:45 am
by purage
Oh well, congratulations - mind telling the forum what was wrong in your original code?
Sure. It was a silly bug, my VESA driver didn't exist!
Re: VGA in Pmode Not Working
Posted: Fri Feb 13, 2009 3:09 am
by jal
purage wrote:Sure. It was a silly bug, my VESA driver didn't exist!
Must. Resist. Feeding. The. Troll.
JAL
Re: VGA in Pmode Not Working
Posted: Fri Feb 13, 2009 6:48 am
by Combuster
@purage:
In every post I have posted suggestions as to what might be causing the problem. I am also trying to make your posting be more productive in the ability to get a response (which includes stripping emotional sentences, including source code - full source code - leaving out details is exactly what makes us miss the problem).
What you decided to post afterwards is not helpful to anybody and only constitutes a fight, so be careful with that in the future.
@jal:
There are sometimes when your freudian skills are better left unspoken for the greater good (i.e. not to offend people).
Thread locked