Problem setting vesa text mode
- gzaloprgm
- Member
- Posts: 141
- Joined: Sun Sep 23, 2007 4:53 pm
- Location: Buenos Aires, Argentina
- Contact:
Read Stevo14 post in this same threadand without bios?
Cheers,
Gonzalo
Visit https://gzalo.com : my web site with electronic circuits, articles, schematics, pcb, calculators, and other things related to electronics.
I am actually working on this right now. The code works fine in Bochs but Qemu and real hardware don't like it. (qemu won't change the font and real hardware does exactly what is in the picture)trolly wrote:i made like stevo14 but it has a problem,
when i put something to the screen, it look like if the both fonts (8x8 and 8x16) are drawed:
...image...
can you help me?
Maybe someone with more experience with VGA programming could help? All I did was move the values out of the array (and give them names based on some VGA documentation). I'm still learning what all of those values actually do.
It looks like you didn't set the correct planes enabled. When enabling all four planes (needed for writing the font to the memory, or at least plane 2) and forgetting to set it back to planes 0 and 1 only, this may be the result. However, Bochs also doesn't display it correctly in that case.Stevo14 wrote:I am actually working on this right now. (...) Maybe someone with more experience with VGA programming could help?trolly wrote:when i put something to the screen, it look like if the both fonts (8x8 and 8x16) are drawn
JAL
Good news: It works in Bochs and real hardware now!
I actually followed the link that AlexExtreme provided in this -> http://www.osdev.org/phpBB2/viewtopic.php?p=122751 <- thread. I made sure that all of the registers matched and that I was correctly saving and restoring the vga's state before and after changing the font.
I will update the code in my earlier post to reflect the changes... [done]
I actually followed the link that AlexExtreme provided in this -> http://www.osdev.org/phpBB2/viewtopic.php?p=122751 <- thread. I made sure that all of the registers matched and that I was correctly saving and restoring the vga's state before and after changing the font.
I will update the code in my earlier post to reflect the changes... [done]
Last edited by Stevo14 on Thu Mar 27, 2008 7:24 am, edited 1 time in total.
So what problems are you experiencing exactly? I really don't know what you and Stevo14 are trying to do. Take a look at the Video.cpp I attached in an earlier post, as that includes a working font set routine that does not use the BIOS.trolly wrote:sorry, but i get the same problem,it look like the 2 font are interlaced
JAL
exactly the problem is:
when i set the new font , i copy it to the address 0xa0000 and says the controler to use it.
with bochs, it work, but with real hardware, the controler display the both fonts (old and new) and the effect is that the both fonts are interlaced
iv read in the freevga site:
this is my code in macro asm:
[/code]
when i set the new font , i copy it to the address 0xa0000 and says the controler to use it.
with bochs, it work, but with real hardware, the controler display the both fonts (old and new) and the effect is that the both fonts are interlaced
iv read in the freevga site:
; so i think that i must stet the both character set select (A and B) to the same address bu i dont know howThe VGA's hardware provides for two banks of 256 character bitmaps to displayed simultaneously
this is my code in macro asm:
Code: Select all
SetFont:
outportb SEQ_ADDR, SEQ_I_MAPMASK
inportb SEQ_DATA
mov [old_mapmask],al
outportb SEQ_DATA, 0x4 ;// select plane 2 (font plane)
outportb SEQ_ADDR, SEQ_I_MEMMODE
inportb SEQ_DATA
mov [old_memmode],al
outportb SEQ_ADDR,0x6
outportb SEQ_ADDR, SEQ_I_CHARMAP
outportb SEQ_DATA,0x00 ;//font a and b are mapped to zero
outportb GFX_ADDR,GFX_I_MISC
inportb GFX_DATA
mov [old_gfx],al
outportb GFX_ADDR,GFX_I_MISC
outportb GFX_DATA, 0x00 ;//disable odd/even
mov [i],0x0
mov [buff],font_data
mov [vidmem0],0xa0000
.for_i:
cmp [i],256
jnb .next_i
copy_user_to_mem [buff],[vidmem0],line_height ;
add [vidmem0],32
add [buff],line_height
inc [i]
jmp .for_i
.next_i:
outportb SEQ_ADDR, SEQ_I_MEMMODE
outportb SEQ_DATA, [old_memmode]
outportb SEQ_ADDR, SEQ_I_MAPMASK
outportb SEQ_DATA, [old_mapmask]
outportb GFX_ADDR, GFX_I_MISC ;// restore old gfx misc settings
outportb GFX_DATA, [old_gfx]
outportb GFX_ADDR, GFX_I_MODE
outportb GFX_DATA, 0x10
outportb GFX_ADDR, GFX_I_BITMASK
outportb GFX_DATA, 0xff
ret
We were merely experiencing the same problem. My problem is fixed, trolly's isn't.jal wrote: I really don't know what you and Stevo14 are trying to do.
trolly: That asm stub will point character set a and b to the same address. Specifically this part:
Code: Select all
outportb SEQ_ADDR, SEQ_I_CHARMAP
outportb SEQ_DATA,0x00 ;//font a and b are mapped to zero
in this site , he says that :Stevo14 wrote:We were merely experiencing the same problem. My problem is fixed, trolly's isn't.jal wrote: I really don't know what you and Stevo14 are trying to do.
trolly: That asm stub will point character set a and b to the same address. Specifically this part:Go here http://www.osdever.net/FreeVGA/vga/seqreg.htm and find the register called "Character Map Select Register". This should make everything clearer.Code: Select all
outportb SEQ_ADDR, SEQ_I_CHARMAP outportb SEQ_DATA,0x00 ;//font a and b are mapped to zero
also why do you copy the font to 0xa0000 and not 0x0000?000b -- Select font residing at 0000h - 1FFFh
0xA0000 is the start of video memory AFAIK.trolly wrote: in this site , he says that :also why do you copy the font to 0xa0000 and not 0x0000?000b -- Select font residing at 0000h - 1FFFh
The values on that site are offsets from the beginning of video memory.
So by setting the "Character Map Select Register" to all zeros, you are telling the VGA card that both font A and B will start at (the beginning of video memory + the offset that we put in the register), which means they will start at 0xA0000.