Page 3 of 3

Re: drawing with VGA

Posted: Fri Jan 25, 2019 3:21 pm
by alberinfo
ok, now trying on fonts.but it doesnt draw nothing or garbage. I.E, if i put the character is 'A' when calling the drawchar func, it doesn't do anything, and if i put the font as a character, then it draws garbage. also i have a problem between the paging and VBE, i cannot access the LFB when paging enabled(it works with paging disabled).can you help me?

Thanks!

Re: drawing with VGA

Posted: Sat Jan 26, 2019 3:26 pm
by MichaelPetch
Is your latest code (that doesn't work) in your github account? If it is, are you aware that the video mode being used is a text mode? In QEMU it is 80x25 where the LFB is at 0xb8000. I get the same result of a purplish object on the screen when 'A' is printed whether I enable paging or not (in setup.c). It ill be garbage in text mode because text mode uses 2 bytes for each cell (one character is character, and the other is the attribute). The reason LFB doesn't work is because your function id_map_lfb() is completely broken. It doesn't create proper page tables and page table entries so when you enable paging - any attemptto write to the LFB will fail.

Re: drawing with VGA

Posted: Sat Jan 26, 2019 6:31 pm
by alberinfo
MichaelPetch wrote:Is your latest code (that doesn't work) in your github account?
no, it's not.i've updated the code, so now you can check it out.
MichaelPetch wrote:The reason LFB doesn't work is because your function id_map_lfb() is completely broken. It doesn't create proper page tables and page table entries so when you enable paging - any attemptto write to the LFB will fail.
you're actually right; i was trying something to map the lfb, but it didn't actually work.

Thanks!