SVGA question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mr0b

SVGA question

Post by mr0b »

Well, all is well when i set the 800x600x16bit mode. Linear framebuffer offset is extracted and i got access to the whole 800x600 pixels.

Problems arrise when i switch to 800x600x32bit mode. I only got access to the first half of the 800x600 pixels(although the framebuffer offset is the same as in 16bit mode). Is the framebuffer segmented in some way,while in this mode?

Well, in either case, theres always bank switching *shurg*

Cheers, mr0b
bluecode

Re:SVGA question

Post by bluecode »

Well, I don't think that the linear framebuffer is segmented ;) But in 800x600x16 mode the framebuffer is half the size of the framebuffer in 800x600x32 mode... So I guess you perhaps calculated the offset into the framebuffer wrong...
Dex4u

Re:SVGA question

Post by Dex4u »

If the botom half is black, this can mean you need to enable A20, or if already set up that the A20 code does not work on that PC.
mr0b

Re:SVGA question

Post by mr0b »

bluecode wrote: Well, I don't think that the linear framebuffer is segmented ;) But in 800x600x16 mode the framebuffer is half the size of the framebuffer in 800x600x32 mode... So I guess you perhaps calculated the offset into the framebuffer wrong...
The framebuffer offset isn't calculated at all, its extracted from the structure BIOS provides. In 1024x768x32bit while writing to the framebuffer(in my case, located at 0xf0000000) you can access the first and last thirds of the screen(whilst sequentially writing to the buffer).

Heh :-|
mr0b

Re:SVGA question

Post by mr0b »

Dex wrote: If the botom half is black, this can mean you need to enable A20, or if already set up that the A20 code does not work on that PC.
You were right Dex :D

A20 was the problem. Me and my OS owe you eternal gratitude :)

Cheers!
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:SVGA question

Post by Pype.Clicker »

@Dex: i first thought "what a weird suggestion" and then remembered the A20 gate doesn't wrap all addresses into 1MB but rather merely hard-wire the 20th address bit to zero ... so indeed 0xF000000 is mapped to 0xF000000 and 0xF0200000 goes to 0xF020000 but 0xF0100000 is mapped to 0xF0000000 rather than 0xF0100000

...
bkilgore

Re:SVGA question

Post by bkilgore »

Pype.Clicker wrote: @Dex: i first thought "what a weird suggestion" and then remembered the A20 gate doesn't wrap all addresses into 1MB but rather merely hard-wire the 20th address bit to zero
What a strange hack... They force you to jump through hoops to enable one address line when all of the higher ones work without hassle. I mean, historically, I understand why it ended up like this, but it's still strange.
mystran

Re:SVGA question

Post by mystran »

No. All the higher onces don't work without the hassle.

While 0xF0100000 maps to 0xF0000000, 0xF0300000 would map to 0xF0200000. So you can't have any address where the bit 20 is 1.
JAAman

Re:SVGA question

Post by JAAman »

im certain bkilgore meant the higher address lines, not the higher addresses

btw:
on power-up, all computers have a20 line enabled -- the boot code start address has a20=1:
FFFF_FFF0 -- the 21st address line is 1 -- just an interesting note, not really of any value, i guess
Midas
Member
Member
Posts: 140
Joined: Sat Jun 24, 2006 4:40 pm
Location: Falkirk, Scotland
Contact:

Re:SVGA question

Post by Midas »

JAAman wrote:on power-up, all computers have a20 line enabled -- the boot code start address has a20=1:
I noticed that in the Intel docs - it says that the A20 line can be disabled for 8086 compatibility. Presumably the BIOS disables it?
Regards,
Angus [Óengus] 'Midas' Lepper
JAAman

Re:SVGA question

Post by JAAman »

it can be disabled? at the CPU level? thats new to me... i was under the impression that it is simply masked (not disabled) by an external chip (the keyboard controller)
Presumably the BIOS disables it?
must be since all CPUs since the 386 start executing at top of memory -- which means that the A20 address line must be enabled -- its not controlled by the CPU, so it wouldn't know the difference, but the ROM chips are mapped to the top of memory (just below the 4GB mark, unless thats changed to the 64GB mark? though nothing in the intel docs indicate that) so for the ROM chips to be addressed, the A20 line must be enabled

the BIOS must disable it -- prob at the same time it switches into RMode to transfer control to the OS
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:SVGA question

Post by Candy »

JAAman wrote: it can be disabled? at the CPU level? thats new to me... i was under the impression that it is simply masked (not disabled) by an external chip (the keyboard controller)
That's a terminological difference, whether it's disabled at the keyboard controller or on the cpu - you wouldn't notice the difference. I personally expect it to be at the keyboard controller (still), which doesn't mean much nowadays since it's integrated into the north bridge, which also does a load of other things.
ti_mo_n

Re:SVGA question

Post by ti_mo_n »

afaik, it's called "A20M" and is CPU-controlled. I don't know how, though. But in practice it makes no difference.
Post Reply