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.
oh, btw, i suggest you don't move the cursor after every char, but after a line or a "printf" command is completed.
Otherwise, you'll have a veeeery sloooow display ...
i decided that i didnt want to use the hardware cursor in my OS. instead i just used a location in video memory and set the attribute to white background. i like this kind of cursor better. try it and you will proboly like it too. and btw its easy to update:
This is OK until you want to put the cursor over some other character. The hardware cursor will work when superimposed like this, but the software cursor will overwrite whatever it underneath.
another widely used trick (among each other, by the mouse cursor) is to reverse the attribute byte and leaving the character byte unchanged ...
However, the cursor is mainly required when input from the keyboard is required ... what is the use for cursor update when printing the output of LS ? hide it until the application is blocked waiting for some input from the user, *then* show it (and i would show it using the hardware if possible, as this will allow automatic blinking, etc.)
Think about it: accessing video ram and video I/O port will have the same cost, as it implies crossing the very same bus...
...unless said video RAM is cached, in which case the CPU won't use the bus on every access, and when it does, it will do so in a burst (e.g. one cache line at a time).
tim: To use my method of making a cursor its proboly possible to change the attribute of the location from white on black to black on white. the program EDIT in dos changes from white on blue to black on yellow. that way the software cursor wont overwrite...
BTW: this function is put into my i386.h file. This is an exception to the rule of no functions in headers. It's inline, so it must be implemented in every module where it is used (the compiler can't inline functions across modules). Because of that, it's declared as private to this module (by the static keyword) so that, if more than one module uses the out function, they don't conflict.