Hello,
Having followed several tutorials I found, and eventually recoding from the start, I've managed to program a basic kernel based on James Molloy's tutorials, with keyboard input. However, I can't work out how the best way to make a CLI is. I have several ideas, but I can't choose which would work best and how to properly implement it without a standard library that I'm used to. Has anyone got any ideas?
Also, I adjusted some of the monitor-related functions which were heavily based on James's tutorials to print "shell>" every time return(the key) is pressed if a variable called climode=1. For some reason, when it starts scrolling off the screen, the first letter, "s" in the "shell>" isn't show and instead there is a blank space. Anyone know what's up with that?
Programming a CLI
Re: Programming a CLI
A shell / CLI is a user-space application. In the timeline of OS development, having some kind of standard library / user-space API available should come first - IMHO.RevivalDBM wrote:...I can't choose which would work best and how to properly implement it without a standard library that I'm used to.
Every good solution is obvious once you've found it.
-
- Member
- Posts: 34
- Joined: Sun Aug 03, 2008 5:38 am
Re: Programming a CLI
Come to think of it, you're probably right. However, I think that a basic CLI within the kernel supporting only some basic commands would help until my kernel evolves to the point the CLI can be removed from the kernel and become just a user mode application.Solar wrote:A shell / CLI is a user-space application. In the timeline of OS development, having some kind of standard library / user-space API available should come first - IMHO.RevivalDBM wrote:...I can't choose which would work best and how to properly implement it without a standard library that I'm used to.
Last edited by RevivalDBM on Tue Aug 12, 2008 5:14 am, edited 1 time in total.
Re: Programming a CLI
Hi,
A CLI can be a useful debugging tool. My own plan is to add a basic kernel "debug mode" CLI early on - with built in debugger. The next stage is to write user mode services. At this point, the "debug CLI" becomes a user mode app and is stripped out of the kernel. Of course, this requires some careful interface planning to ensure that not too much of the kernel/CLI need rewriting once the debugger becomes a separate binary.
Cheers,
Adam
A CLI can be a useful debugging tool. My own plan is to add a basic kernel "debug mode" CLI early on - with built in debugger. The next stage is to write user mode services. At this point, the "debug CLI" becomes a user mode app and is stripped out of the kernel. Of course, this requires some careful interface planning to ensure that not too much of the kernel/CLI need rewriting once the debugger becomes a separate binary.
Cheers,
Adam