This is a basic command-line shell implemented in C++ that demonstrates how system calls like fork(), execvp(), and wait() work under the hood. It serves as an educational project for understanding process creation and management in Unix-like operating systems.
Uptil these things have been implemented:
- Input Parsing.
- Process creation.
- Parent and Child Process Handling.
- Built-in Commands like
cdandhistory. - Command Chaining using
;,&&,|| - IO redirection from terminal to file. Read more about here
Terminologies related what I have done till now:
-
Parent Process: A process that initiates the creation of another process. By default ,
init()is the utlimate parent process in a UNIX-based OS. -
Child Process: A process created by another process (the parent process), allowing multi-processing and efficient resource management in operating systems.
-
Zombie Process: A child process becomes a zombie process when it has terminated but its parent process has not waited for it, and hence its status is not yet cleaned in the PCB.
System Calls used till now:
-
fork(): Creates a new child process by duplicating the current (parent) process. -
exeecvp(): Replaces the current process image with a new program. -
wait(): Pauses the parent process until any one child process terminates. -
chdir(): Changes the current working directory of the calling process.
Built-in Commands / Shell primitve commands that are implemented
cd
history
Commands to run:
-
make -
./miniShell
