Page 1 of 1

Programming a CLI

Posted: Tue Aug 12, 2008 4:29 am
by RevivalDBM
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?

Re: Programming a CLI

Posted: Tue Aug 12, 2008 4:38 am
by Solar
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.
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.

Re: Programming a CLI

Posted: Tue Aug 12, 2008 4:45 am
by RevivalDBM
Solar wrote:
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.
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.
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.

Re: Programming a CLI

Posted: Tue Aug 12, 2008 4:49 am
by AJ
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