shell impl?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
pulsar
Member
Member
Posts: 49
Joined: Wed Nov 22, 2006 1:01 am
Location: chennai

shell impl?

Post 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.
everyone here are best programmers ( not yet not yet)
M-Saunders
Member
Member
Posts: 155
Joined: Fri Oct 27, 2006 5:11 am
Location: Oberbayern
Contact:

Post 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
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post 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.
Crazed123
Member
Member
Posts: 248
Joined: Thu Oct 21, 2004 11:00 pm

Post by Crazed123 »

Normally you want your shell to read from some kind of Standard Input abstraction rather than the keyboard itself.
User avatar
pulsar
Member
Member
Posts: 49
Joined: Wed Nov 22, 2006 1:01 am
Location: chennai

Post 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.
everyone here are best programmers ( not yet not yet)
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post 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.
Post Reply