This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Hello, in bochs displaying a string longer then 5 through VGA buffer doesn't work. If string is greather then 5 the color gest displayed but not the tex. If string is smaller then 6 it works. I it a bochs bug or is it normal for VGA. Here is my function:
@stlw: Stop spreading lies and look up operator precedence. Everytime you are in doubt, you should look it up, instead of randomly adding unnecessary parentheses. This improves both your code and your coding skills considerably.
The main culprit is likely silent promotion to 'int' and the fact that he appears to use uint16_t instead of size_t - or just that his code is so mistaken in the first place that it doesn't work because of something else bad he did.
The main culprit is likely silent promotion to 'int' and the fact that he appears to use uint16_t instead of size_t - or just that his code is so mistaken in the first place that it doesn't work because of something else bad he did.
My crystal ball blames the linker script for not adding a .rodata for when the compiler no longer wants to inline longer string printings.
As far as I recall how the graphics code works you can't have a colour/text pair on screen if it hasn't actually existed that way in VRAM at some point.
Also, regarding parentheses, binary shift has varying precedences across programming languages - because it's mostly absent from formal mathematics and the perceived logical use is a subjective thing as a consequence. Also, you should write code to convey the most legible intent - that includes well-placed parentheses rather than the minimum number thereof.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]