First this code in asm (i do not use C) for geting into vesa 640x480x256.
Code:
mov ax,4f02h? ;set vesa 1.0 screen mode
mov bx,101h? ;640*480*256
int 10h
mov dx,0xa000
mov ds,dx? ? ? ? ? ? ? ;sets up registers
call window
rain:
xor dx,dx? ? ? ;(pages-1)
mouse:
push dx
call window
xor bx,bx
mov al, 0cch
call dog
pop dx
cmp dx,4
je rain
inc dx
mov ah,01h
int 16h
jz mouse
mov ax,0003h
int 10h
mov ax,4c00h? ? ? ; This is just
int 21h? ? ? ? ? ? ? ? ; for test ,take it out in your OS
window:
mov ax,4f05h? ? ;vesa 1 window select
mov bx,0
int 10h? ? ? ? ;dx is? the reqired window
xor bx,bx
ret
dog:? ? ? ? ;(4*2^16)+45056 pixels
mov [bx],al
inc bx
cmp bx,$00000
jne dog
ret
This is for vesa 1 (banking)i can give you the code for vesa 2 linear if you want ,But this is good to start with.
You set vesa up in real mode,I have herad that people hack into to grub code to do this,But I do not use grubs, so i do not know how.
In my OS i set VESA in real mode befor go to pmode,i will swich back to unreal mode to change modes.
May be with grubs you can swich to unreal mode,these lots of tut's to do this:
http://www.karig.net/0004.htmlI use "bootprog" for my loader you can get it here:
http://alexfru.chat.ru/epm.htmlThe zip to get is call "bootprog.zip".
ASHLEY4.