vesa mode problem on real h/w

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.
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: vesa mode problem on real h/w

Post by djmauretto »

ok ready,
note that this simply boot example assume mode 115h is 800x600 32bit
without check, enable mode fill the screen with blu color and print a message.
Here there is a floppy image.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: vesa mode problem on real h/w

Post by Dex »

Just in case you are using 4 before the mode number eg: 0x4115
or you will get banked not LFB.
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: vesa mode problem on real h/w

Post by johnsa »

Ok so I tested your boot example and it works perfectly.. so good news is my vesa bios works :) bad news is my code must be wonky... here is a cut--out with the mode hard-coded (tried that too.. same prob).. maybe you can see something silly I'm missing:

Code: Select all


; Get Mode Info ... for this test we KNOW that 115h has LFB/800x600/32bit/direct colour etc..
mov ax,4f01h
mov cx,4115h
mov di,offset ModeInfo
push ds
pop es
int 10h
cmp ax,4fh
jne noVBEBoot

; Determine Pitch
cmp VBE_VERSION,30h
jl OldPitch
mov edi,offset ModeInfo
xor eax,eax
mov ax,(ModeInfoBlock PTR ds:[edi]).LinBytesPerScanLine
mov VBE_PITCH,eax
jmp GotPitch
OldPitch:
mov edi,offset ModeInfo
xor eax,eax
mov ax,(ModeInfoBlock PTR ds:[edi]).BytesPerScanLine
mov VBE_PITCH,eax
GotPitch:

;Set Mode with LFB
mov ax,4f02h
mov bx,4115h
mov di,offset CRTInfo
push ds
pop es
int 10h
cmp ax,4fh
jne noVBEBoot

; Get VidMem Ptr
xor eax,eax
mov es,eax
mov edi,offset ModeInfo
mov edi,(ModeInfoBlock PTR ds:[edi]).PhysBasePtr

; Draw test pattern
mov ebp,300
fill0:
mov ecx,400
mov eax,00ff0000h
fill1:
mov es:[edi],eax
add edi,4    ;(32bits/8)
dec ecx
jnz short fill1
mov eax,VBE_PITCH
sub eax,(400*4)
add edi,eax
dec ebp
jnz short fill0

mov ebp,300
fill2:
mov ecx,400
mov eax,00ffffffh
fill3:
mov es:[edi],eax
add edi,4    ;(32bits/8)
dec ecx
jnz short fill3
mov eax,VBE_PITCH
sub eax,(400*4)
add edi,eax
dec ebp
jnz short fill2

User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: vesa mode problem on real h/w

Post by Dex »

Should that not be

Code: Select all

[VBE_PITCH]
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: vesa mode problem on real h/w

Post by johnsa »

no.. its tasm, using masm mode.. no ideal mode style brackets :)
don't even ask why i landed up using tasm for the boot code.. when the kernel is written using fasm... lol
in any event it does the job, everything else works, had to make a bunch of macros for opcodes that aren't supported by tasmtho.
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: vesa mode problem on real h/w

Post by djmauretto »

johnsa wrote:; Get Mode Info ... for this test we KNOW that 115h has LFB/800x600/32bit/direct colour etc..
mov ax,4f01h
mov cx,4115h
mov di,offset ModeInfo
push ds
pop es
int 10h
cmp ax,4fh
jne noVBEBoot
For get mode info CX = 115h not 4115H
johnsa wrote:; Get VidMem Ptr
xor eax,eax
mov es,eax
:?:
mov es,ax :wink:

maybe the problem is in your Unreal Mode setting...
learn my example below ,comments in English and Italian
Last edited by djmauretto on Wed Apr 01, 2009 4:24 am, edited 1 time in total.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: vesa mode problem on real h/w

Post by Dex »

Sorry forgot not all people use fasm or nasm :lol:, you can see my versa demo if it wil help.
http://dex4u.com/demos/VesaDemo.zip
But onething to remember is, if you using high res you will need to enable A20 or you will not see bottom of screen.
Most emulator enable it automaticly.
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: vesa mode problem on real h/w

Post by johnsa »

OMFG... what a putz I am... doh.. when i started writing the vesa code, i obviously needed to be in unreal mode, so I moved that code right up to near the beginning before my load gfx, vesa setup stuff.. but forgot to move the a20 enable code from where it originally was right after unreal setup.... which consequently is well after the vesa stuff... I am a complete fool and will now go and throw myself into the swimming pool at sub 5degrees....

it all works now... btw.... including my spiffy decompression code and background image etc... thanks for all the help guys! :)
so you don't need the db 67h, and either unreal setup code worked fine.. but djm's was a bit shorter.
Post Reply