C shell

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
nuno_silva_pt

C shell

Post by nuno_silva_pt »

How can i make a shell in c++?
Mr_Spam

Re:C shell

Post by Mr_Spam »

for the greatists stability of the kernel, i'd make a shell system call then an application started from the kernel at boot calls the shell system call baised on the user input.
gtsphere

Re:C shell

Post by gtsphere »

due to handling many different things that C++ has to offer, you need to recreate the wheel in some cases. Here is a good linke to help you out.

http://www.invalidsoftware.net/os/
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:C shell

Post by Pype.Clicker »

- have an "input reader"
- once the user entered a line, check the syntax
- grab the first word : that's the command name
- locate the code for that command (it might be internal command like "help", "ls", "cd", "set" ... or some external program)
- if external program, look up for the program in every directory in $PATH
- if program found, load it in memory, set up arguments array and call main(argc, argv[])
- when program returns, restart
Post Reply