Page 2 of 2

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 8:58 am
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.

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 11:12 am
by Dex
Just in case you are using 4 before the mode number eg: 0x4115
or you will get banked not LFB.

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 12:36 pm
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


Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 12:48 pm
by Dex
Should that not be

Code: Select all

[VBE_PITCH]

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 12:56 pm
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.

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 1:20 pm
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

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 1:24 pm
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.

Re: vesa mode problem on real h/w

Posted: Tue Mar 31, 2009 1:47 pm
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.