drawing with VGA

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
alberinfo
Member
Member
Posts: 122
Joined: Wed Aug 29, 2018 4:42 pm

Re: drawing with VGA

Post 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!
MichaelPetch
Member
Member
Posts: 799
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: drawing with VGA

Post 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.
alberinfo
Member
Member
Posts: 122
Joined: Wed Aug 29, 2018 4:42 pm

Re: drawing with VGA

Post 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!
Post Reply