Yes its me again i have another problem but with the same thing...
I was trying to find something on net but there is only in DJGPP , examples... Here is my little kernel I work on and I dont know what do next do have my own first putPixel procedure... What i should do with framebuffer adress and do i have to switch to pmode to be able to use it or not ?
Please help one more time...
org 0000h
initStack:
mov ax,07C0h
mov ss,ax
mov sp,03FEh
start:
call initTextMode
call welcomeText
call endl
call getChar
call check_VESA
call initGFXMode
main:
call putPixel
jmp main
reset:
mov bx,40h
mov ds,bx
mov word[ds:72h],1234h
jmp 0FFFFh:0000h
check_VESA:
mov ax,4F00h ; Is Vesa installed ?
mov di,VESA_Info ; This is the address of how info block.
int 10h
mov ax,4f01h ; Get Vesa Mode information.
mov cx,112h ; 4112h = 32/24bit ; 0x4101 = 256bit ;4111h = 65535bit (640*480)
int 10h
mov eax,dword[es:di + 40]
mov dword[offset],eax
;mode attr = mov ax,word[es:di]
;xres = mov ax,word[es:di + 18]
;yres = mov ax,word[es:di + 20]
;bits per pixel = mov al,byte[es:di + 25]
;LinearFrameBuffer addr = mov eax,dword[es:di + 40]
;OffScreenMemOffset = mov eax,dword[es:di + 44]
;OffScreenMemSize = mov ax,word[es:di + 48]
ret
initGFXMode:
mov ax,4F02h
mov bx,112h ;101h = 640x480x8 112h = 640x480x32 118h = 1024x768x32bit
or bx, 4000h ;enable frame buffer bit 14
int 10h
cmp ax,4Fh
je done
mov ax,info2
mov bl,2
call writeString
mov ax,info3
mov bl,2
call writeString
call getChar
jmp reset
done:
ret
putPixel:
;mov ebp,dword[offset]
;mov ecx,12500
;draw:
;mov dword[ebp],0FFFFFFFFh
;mov eax,0A000h
;mov es,eax
;mov ebx,dword[ds:offset]
;mov dword[es:ebx],0FFFFFFFFh
; inc ebp
; loop draw
;mov eax,0A000h
;mov es,eax
;mov bx,word[ds:offset]
;mov dword[es:bx],0FFFFFFFFh
mov ax,0A000h
mov es,ax
xor edi,edi ; We make shore edi 0.
mov edi,dword[offset] ; we can just as easy as writing to this address,as normal VGA mode 13h.
mov ecx,640*480 ; Size of screen
mov eax,0FFFFFFFFh ; This is for the color of one pixel(note: this could be 24bit or 32bit)
rep stosd
ret
;Gloabal varables
info0: db "FX Operating System Loaded",0
info1: db "Press any key to continue...",0
info2: db "VESA init failed...",0
info3: db "Press ESC to restart.",0
x dd 0,0
y dd 0,0
color dw 0,0,0,0
offset: dd 0,0,0,0
bank: dw 0,0,0,0
liczba: dw 0,0,0,0
_pisz_bufor: dw 0,0,0,0
wndPointer: dw 0,0