OSDev.org
https://forum.osdev.org/

Strange input glitch
https://forum.osdev.org/viewtopic.php?f=1&t=32516
Page 1 of 1

Author:  nm111 [ Thu Oct 26, 2017 11:18 am ]
Post subject:  Strange input glitch

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:
Code:
>echo Hello
Hello
>echo Hello
Heloo
>echo Hello
(nothing)

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)

Author:  zaval [ Thu Oct 26, 2017 1:59 pm ]
Post subject:  Re: Strange input glitch

nm111 wrote:
So,
...
Does anyone have any help?

...
moronic signature wrote:
_________________
Person: "How do I compile this on Windows?" Me: "Don't use Windows."

Image

Author:  iansjack [ Thu Oct 26, 2017 2:55 pm ]
Post subject:  Re: Strange input glitch

Perhaps I'm missing something, but I can't see where you define your getChar() and printf() functions.

As per the previous post, slagging off a particular operating system just makes you look like a kid trying (unsuccessfully) to be cool.

Author:  Octacone [ Thu Oct 26, 2017 3:10 pm ]
Post subject:  Re: Strange input glitch

iansjack wrote:
Perhaps I'm missing something, but I can't see where you define your getChar() and printf() functions.

As per the previous post, slagging off a particular operating system just makes you look like a kid trying (unsuccessfully) to be cool.


I managed to find those... Inside the headers...

Author:  thepowersgang [ Thu Oct 26, 2017 10:36 pm ]
Post subject:  Re: Strange input glitch

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).

Author:  iansjack [ Fri Oct 27, 2017 12:37 am ]
Post subject:  Re: Strange input glitch

Octacone wrote:
iansjack wrote:
Perhaps I'm missing something, but I can't see where you define your getChar() and printf() functions.

As per the previous post, slagging off a particular operating system just makes you look like a kid trying (unsuccessfully) to be cool.


I managed to find those... Inside the headers...

Ah, I see them.

That's going to lead to tears before bedtime.

Author:  MichaelPetch [ Fri Oct 27, 2017 11:11 pm ]
Post subject:  Re: Strange input glitch

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/