OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Sep 23, 2020 7:16 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Strange input glitch
PostPosted: Thu Oct 26, 2017 11:18 am 
Offline
User avatar

Joined: Thu Apr 13, 2017 8:24 am
Posts: 1
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)

_________________
Why is Windows bad? It's bulky, slow, and costs over £100. Throw it away and install something open-source, like Arch.


Top
 Profile  
 
 Post subject: Re: Strange input glitch
PostPosted: Thu Oct 26, 2017 1:59 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 479
Location: Ukraine, Bachmut
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

_________________
future big goal: ANT - NT-like OS for mips, arm and x86.
current smaller goal: efify - UEFI for a couple of boards (mips and arm).


Top
 Profile  
 
 Post subject: Re: Strange input glitch
PostPosted: Thu Oct 26, 2017 2:55 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3940
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Strange input glitch
PostPosted: Thu Oct 26, 2017 3:10 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1090
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...

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
 Post subject: Re: Strange input glitch
PostPosted: Thu Oct 26, 2017 10:36 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 25, 2007 6:03 am
Posts: 723
Location: Perth, Western Australia
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).

_________________
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc


Top
 Profile  
 
 Post subject: Re: Strange input glitch
PostPosted: Fri Oct 27, 2017 12:37 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3940
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Strange input glitch
PostPosted: Fri Oct 27, 2017 11:11 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 525
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group