Page 2 of 3

Posted: Wed Mar 26, 2008 5:50 pm
by trolly
and without bios?

Posted: Wed Mar 26, 2008 7:45 pm
by gzaloprgm
and without bios?
Read Stevo14 post in this same thread :P

Cheers,
Gonzalo

Posted: Wed Mar 26, 2008 9:51 pm
by trolly
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?

Posted: Thu Mar 27, 2008 12:35 am
by Stevo14
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?
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)

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. :?

Posted: Thu Mar 27, 2008 2:15 am
by xyzzy
trolly: Go back to your other thread, and READ what I posted.

Posted: Thu Mar 27, 2008 5:13 am
by jal
Stevo14 wrote:
trolly wrote:when i put something to the screen, it look like if the both fonts (8x8 and 8x16) are drawn
I am actually working on this right now. (...) Maybe someone with more experience with VGA programming could help?
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.


JAL

Posted: Thu Mar 27, 2008 7:16 am
by Stevo14
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]

Posted: Thu Mar 27, 2008 8:47 am
by trolly
sorry, but i get the same problem,it look like the 2 font are interlaced

Posted: Thu Mar 27, 2008 9:37 am
by jal
trolly wrote:sorry, but i get the same problem,it look like the 2 font are interlaced
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.


JAL

Posted: Thu Mar 27, 2008 9:57 am
by trolly
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:
The VGA's hardware provides for two banks of 256 character bitmaps to displayed simultaneously
; so i think that i must stet the both character set select (A and B) to the same address bu i dont know how

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
[/code]

Posted: Thu Mar 27, 2008 10:19 am
by Stevo14
jal wrote: I really don't know what you and Stevo14 are trying to do.
We were merely experiencing the same problem. My problem is fixed, trolly's isn't.

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 
Go here http://www.osdever.net/FreeVGA/vga/seqreg.htm and find the register called "Character Map Select Register". This should make everything clearer.

Posted: Thu Mar 27, 2008 10:25 am
by trolly
Stevo14 wrote:
jal wrote: I really don't know what you and Stevo14 are trying to do.
We were merely experiencing the same problem. My problem is fixed, trolly's isn't.

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 
Go here http://www.osdever.net/FreeVGA/vga/seqreg.htm and find the register called "Character Map Select Register". This should make everything clearer.
in this site , he says that :
000b -- Select font residing at 0000h - 1FFFh
also why do you copy the font to 0xa0000 and not 0x0000?

Posted: Thu Mar 27, 2008 11:43 am
by Stevo14
trolly wrote: in this site , he says that :
000b -- Select font residing at 0000h - 1FFFh
also why do you copy the font to 0xa0000 and not 0x0000?
0xA0000 is the start of video memory AFAIK.
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.

Posted: Thu Mar 27, 2008 11:50 am
by inflater
He doesn't want to use BIOS (INT 10h)... :?

Posted: Thu Mar 27, 2008 12:40 pm
by trolly
ok i unterstand.
maybe the problem is that the sequencer copy only One byte on Two :?