Page 1 of 1
shell impl?
Posted: Sat Mar 03, 2007 10:02 am
by pulsar
Hi
shell is just another application loaded at the beginning. So what support does it need from the kernel? should the input be send to the active shell or does the shell makes request for input.
well my idea is to have a console keyboard thread that will periodically recieve from the keyboard and send it to the active shell. does that mean the shell must register itself with the kernel, then only it is possible to send the input to the shell.
Posted: Sat Mar 03, 2007 10:17 am
by M-Saunders
I don't know the structure of your kernel, but you shouldn't need to "register" anything. Just implement some kind of "get_string" or "get_char" routine in the kernel -- then your shell program gets a string via that routine, parses it, and executes and commands contained therein. eg:
loop:
cli = get_string()
parse(cli)
execute(progs_in_cli)
goto loop
etc.
M
Posted: Sat Mar 03, 2007 10:22 am
by Tyler
My Kernel Requires Registration only off the Virtual Console, unless you have some generic Console support above and beyond you shell i doubt you will need to register for input and output. If you did require this then applications would not be able to reciieve input without registering, so a generic in/out kernel sytem call set is probably better.
Posted: Sat Mar 03, 2007 11:01 am
by Crazed123
Normally you want your shell to read from some kind of Standard Input abstraction rather than the keyboard itself.
Posted: Sun Mar 04, 2007 7:13 am
by pulsar
if you are not registering then how does the kernel know that it is a shell and input must be sent to it. i'm trying to implement multiple virtual consoles. for me shell and the console are one and the same, its just an application, the shell will be given separate video buffer and the inputs will be sent to it. The registration is required because, if the shell is active then input are sent to the shell and not to the application else the input will be directly sent to the application. consoles, shells are just part of the gui. gui is yet to be completed.
Posted: Sun Mar 04, 2007 10:27 am
by Tyler
pulsar wrote:if you are not registering then how does the kernel know that it is a shell and input must be sent to it. i'm trying to implement multiple virtual consoles. for me shell and the console are one and the same, its just an application, the shell will be given separate video buffer and the inputs will be sent to it. The registration is required because, if the shell is active then input are sent to the shell and not to the application else the input will be directly sent to the application. consoles, shells are just part of the gui. gui is yet to be completed.
As i said in my last post, if you are implementing virtual consoles, have a single control program recieve all input and send it to the correct console.