That site is pretty impressive. If only there were an onlineassembler.com to go with it, I could do all of my OS development on my iPhone.
It does, however, make me realize just how primitive our development tools really are.
For example, the site will show you, graphically, which code runs in a loop, and which code blocks call other code blocks. When I get a chance, I'm going to try uploading my entire compiled OS to see what it looks like.
Strange behaviour of compiler (Same code is not working now)
Re: Strange behaviour of compiler (Same code is not working
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: Strange behaviour of compiler (Same code is not working
There's something for C++-to-assembler online, which is quite nice too http://godbolt.orgSpyderTL wrote:That site is pretty impressive. If only there were an onlineassembler.com to go with it,
Learn to read.
Re: Strange behaviour of compiler (Same code is not working
Is it possible the "keyboard_getchar()" was working without return?Octocontrabass wrote:Is keyboard_getchar() supposed to be recursive? If so, you've forgotten a "return" statement.Agola wrote:That made me suspect about optimization for recursive functionsCode: Select all
if (scancode & 0x80) return keyboard_getchar();
Because it was working, I know. Just not sure it was "return keyboard_getchar();" or "keyboard_getchar();"
And does newlib handle backspace while reading from stdin?
Or have I handle backspace myself?
Keyboard not found!
Press F1 to run setup.
Press F2 to continue.
Press F1 to run setup.
Press F2 to continue.
-
- Member
- Posts: 5587
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Strange behaviour of compiler (Same code is not working
Maybe, maybe not. I would have to see the code you lost to tell you.Agola wrote:Is it possible the "keyboard_getchar()" was working without return?
As far as I can tell, newlib doesn't handle backspace when reading from anything.Agola wrote:And does newlib handle backspace while reading from stdin?
Or have I handle backspace myself?
Re: Strange behaviour of compiler (Same code is not working
I think the old "keyboard_getchar()" was:Octocontrabass wrote:Maybe, maybe not. I would have to see the code you lost to tell you.Agola wrote:Is it possible the "keyboard_getchar()" was working without return?
As far as I can tell, newlib doesn't handle backspace when reading from anything.Agola wrote:And does newlib handle backspace while reading from stdin?
Or have I handle backspace myself?
Code: Select all
char keyboard_getchar()
{
while (!(inb(0x64) & 0x1));
unsigned char scancode = inb(0x60);
if (scancode & 0x80) keyboard_getchar();
char chr = key_list[scancode];
terminal_putchar(chr);
return chr;
}
Compared their assembly outputs, they look nearly identical, I don't know what is the problem really
Keyboard not found!
Press F1 to run setup.
Press F2 to continue.
Press F1 to run setup.
Press F2 to continue.