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.
vesa mode problem on real h/w
-
- Member
- Posts: 116
- Joined: Wed Oct 22, 2008 2:21 am
- Location: Roma,Italy
Re: vesa mode problem on real h/w
Just in case you are using 4 before the mode number eg: 0x4115
or you will get banked not LFB.
or you will get banked not LFB.
Re: vesa mode problem on real h/w
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
Should that not be
Code: Select all
[VBE_PITCH]
Re: vesa mode problem on real h/w
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.
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.
-
- Member
- Posts: 116
- Joined: Wed Oct 22, 2008 2:21 am
- Location: Roma,Italy
Re: vesa mode problem on real h/w
For get mode info CX = 115h not 4115Hjohnsa 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
johnsa wrote:; Get VidMem Ptr
xor eax,eax
mov es,eax
mov es,ax
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.
Re: vesa mode problem on real h/w
Sorry forgot not all people use fasm or nasm , 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.
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
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.
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.