Page 2 of 2
Re: Graphics
Posted: Sun Aug 09, 2009 6:41 pm
by tera4d
Yes i have enabled the A20 gate so i was quite surprised that it wouldnt work.
I mean i can draw in the whole width. but on the lengt (768..) i can only draw about 32 pixels from the top of the screen.
Re: Graphics
Posted: Mon Aug 10, 2009 8:16 am
by Dex
Here some things to try:
1. First make sure you have the 4 in the mode number.
2. Make sure the A20 code works, as some snips of code, do not work on some PC.
This code works on most
Code: Select all
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;
; enable A20 line ;
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;
enable_A20:
pusha
cli ; Disable all irqs
cld
mov al,255 ; Mask all irqs
out 0xa1,al
out 0x21,al
l.5: in al,0x64 ; Enable A20
test al,2 ; Test the buffer full flag
jnz l.5 ; Loop until buffer is empty
mov al,0xD1 ; Keyboard: write to output port
out 0x64,al ; Output command to keyboard
l.6: in al,0x64
test al,2
jnz l.6 ; Wait 'till buffer is empty again
mov al,0xDF ; keyboard: set A20
out 0x60,al ; Send it to the keyboard controller
mov cx,14h
l.7: ; this is approx. a 25uS delay to wait
out 0edh,ax ; for the kb controler to execute our
loop l.7 ; command.
;sti
popa
ret
To test if it is the A20 code not working, set it to a lower res say 800x600 and see if this write to more of the screen.
Ps : Call the A20 function in realmode.
Re: Graphics
Posted: Tue Aug 11, 2009 4:37 am
by Combuster
The pixels you can see looks equivalent to 64K of data (1024x768, 16 colors, 32 rows 1024*2*32=65536) - looks like you are using banking and neglect to *change* banks? Have you properly gotten the LFB offset, and set a LFB mode?
Re: Graphics
Posted: Tue Aug 11, 2009 12:00 pm
by tera4d
@Dex:
I will try that but i really did enable the a20 later on instead of the bootloader though.
So ill replace my current one with this one and ill see what happens.
@Combuster:
Well to be honest
I really do not know what i am using hehe
This is my first try at a graphical video mode (vesa) so i dont know how or what could you please explain that banking to me? And then a question right away if i use banking and later on (maybe *not going to happen xD*) have a window manager how would i draw to the whole screen? if i have to change between banks with a window while dragging it that would take up to much cpu right? But what about banking? Now i write to the video memory at 0xA0000
So how could i switch to another part? That banking is really vague to me could you please clarify it?
Re: Graphics
Posted: Tue Aug 11, 2009 12:26 pm
by Combuster