Printing text in 640x480 graphics mode is not working
Re: Printing text in 640x480 graphics mode is not working
I'm not really experienced with VGA, but couldn't it be that the frame buffer is not contiguous?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: Printing text in 640x480 graphics mode is not working
Hi,
Cheers,
Brendan
Anything that causes a difference in observable behaviour can be used to check it. This includes printing text; but also includes (deliberately) triple faulting or doing a "while(forever)" (where you can tell if the computer reboots or not), or making keyboard LEDs flash, or making PC speaker beep, or filling the entire screen with white (or black, or not). Also don't forget that you should be able to execute your code in a virtual machine and watch everything that happens as it happens (e.g. single-stepping in Bochs).catnikita255 wrote:1) I can't check it, because i can't print text.Brendan wrote:Then we need more symptoms - e.g. is the loop doing 8 iterations but the pixels aren't being set or is the loop actually only doing one iteration; is something in "putpixel()" dodgy and interfering with the loop; if you call "vgaPutchar" multiple times do you get the same symptoms for all characters or just the first; etc.
Maybe your "putpixel()" is broken (e.g. and does something like "address = displayMemory + y * 123456789 + x/8", so that it only works properly if y=0) and there's nothing wrong with your "vgaPutchar()". Did you try printing anything on the second line (or any other lines)?catnikita255 wrote:I'm fully filled first line of letters with '1' symbols, so i can see that it's printing it.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Printing text in 640x480 graphics mode is not working
Hi,
Cheers,
Brendan
For "640*480 with 16 colour" VGA mode, it's not contiguous - it's 4 planes with 1 bit per pixel; where a single pixel is 4 bits and those 4 bits are spread across all 4 planes. This is what makes it extremely slow if you don't do things right.Roman wrote:I'm not really experienced with VGA, but couldn't it be that the frame buffer is not contiguous?
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Printing text in 640x480 graphics mode is not working
1) I'm using QEMU, is it have single-stepping in it? 2) I'm drawn some figures and they are displaying fine, so my putpixel() is working.Brendan wrote:Hi,
Anything that causes a difference in observable behaviour can be used to check it. This includes printing text; but also includes (deliberately) triple faulting or doing a "while(forever)" (where you can tell if the computer reboots or not), or making keyboard LEDs flash, or making PC speaker beep, or filling the entire screen with white (or black, or not). Also don't forget that you should be able to execute your code in a virtual machine and watch everything that happens as it happens (e.g. single-stepping in Bochs).catnikita255 wrote:1) I can't check it, because i can't print text.Brendan wrote:Then we need more symptoms - e.g. is the loop doing 8 iterations but the pixels aren't being set or is the loop actually only doing one iteration; is something in "putpixel()" dodgy and interfering with the loop; if you call "vgaPutchar" multiple times do you get the same symptoms for all characters or just the first; etc.
Maybe your "putpixel()" is broken (e.g. and does something like "address = displayMemory + y * 123456789 + x/8", so that it only works properly if y=0) and there's nothing wrong with your "vgaPutchar()". Did you try printing anything on the second line (or any other lines)?catnikita255 wrote:I'm fully filled first line of letters with '1' symbols, so i can see that it's printing it.
Cheers,
Brendan
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Re: Printing text in 640x480 graphics mode is not working
Now i'm writed my vgaPrintStr() function, all lines is displaying, but why it's not displaying letters? Only background color is displaying.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Re: Printing text in 640x480 graphics mode is not working
Run your code under a debugger; then you can check whatever you want to.catnikita255 wrote: 1) I can't check it, because i can't print text.
Re: Printing text in 640x480 graphics mode is not working
No, i'm fixed problem with 1 line, but text is not displaying, only BG color.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Re: Printing text in 640x480 graphics mode is not working
Hi.
So far the troubles that you've had seem to be things that you can easily solve in a regular development environment, and are code that is not tied to OS development specifically, so I would recommend you to first try to get the code working in a normal environment (with debuggers and so on, say using SDL for graphics output) and only *then* porting it to a barebones environment.
So far the troubles that you've had seem to be things that you can easily solve in a regular development environment, and are code that is not tied to OS development specifically, so I would recommend you to first try to get the code working in a normal environment (with debuggers and so on, say using SDL for graphics output) and only *then* porting it to a barebones environment.
Re: Printing text in 640x480 graphics mode is not working
Thank you all, now text is displaying fine! I'm so happy now!
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.