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.
So, I have been trying to make an OS, but a glitch is getting in my way. When I type a command, sometimes the argument gets blanked out or replaced. I have no idea about where this glitch is happening, but it seems to occur more often when backspaces are used.
So for example:
I am pretty sure this has nothing to do with my string-splitting routine, as that works pretty well in as a normal C program. Does anyone have any help? (OS is on https://github.com/nm111/NMOS)
Why is Windows bad? It's bulky, slow, and costs over £100. Throw it away and install something open-source, like Arch.
moronic signature wrote:
_________________
Person: "How do I compile this on Windows?" Me: "Don't use Windows."
ANT - NT-like OS for x64 and arm64. efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
At a quick guess, this is caused by bad rendering (either printing or scrolling).
With that said - Your code organisation has a lot of issues (non-inline code shouldn't be in headers, printf shouldn't deviate from the standard, indentation is pretty inconsistent, ...)
I suggest adding in a logging function (e.g. something like `void logf(const char*, ...);` that acts like printf) that writes to the first serial port and using that to debug your rendering issues (by logging the various values before you use them).
I think you should consider looking at your CAPSLOCK and Shift handling code. I ran your code and originally couldn't reproduce the problems you mentioned, but I didn't use upper case characters. I accidentally turned on CAPSLOCK and discovered things go really wrong and then seem to cause issues for any command after that happens to have upper case letters in it. I also noticed that things start failing if I enter a number of characters while holding down the shift key. It seems if you follow them with a space things go terribly wrong. You may wish to revisit the code you have to process SHIFT/CAPSLOCK - you've got serious problems there.