- What happens if we have ONLY the kernel BUT NO shell?
You then have a machine with the actual OS but there is NO way you can use it. There is no “interface” for the human to interact with the OS and hence the machine. (Assuming GUIs don’t exist, for simplicity 🙂 - What happens if we have ONLY the shell BUT NO kernel?
This is impossible. Shell is a program provided by the OS so that you can interact with it. Without the kernel/OS nothing can execute (in a sense, not 100% true though, but you get the idea)
A shell is just a program that offers some functionality that runs on the OS. The kernel is the “essence/core” of the OS. The words can be confusing so here’s the dictionary definition of kernel:
</font> </div> <div data-blogger-escaped-style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 15px; margin-top: 15px; outline: none 0px; padding: 0px; vertical-align: baseline;" style="border:0;box-sizing:border-box;font-family:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin-bottom:15px;margin-top:15px;outline:none 0;padding:0;vertical-align:baseline;"> <p style="margin:0;"><font data-blogger-escaped-style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: 700; line-height: inherit; margin: 0px; outline: none 0px; padding: 0px; vertical-align: baseline;" face="inherit" style="border:0;box-sizing:border-box;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:700;line-height:inherit;margin:0;outline:none 0;padding:0;vertical-align:baseline;"><i data-blogger-escaped-style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; outline: none 0px; padding: 0px; vertical-align: baseline;" style="border:0;box-sizing:border-box;font-family:inherit;font-stretch:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0;outline:none 0;padding:0;vertical-align:baseline;">Kernel:</i></font></p> </div> <div data-blogger-escaped-style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 15px; margin-top: 15px; outline: none 0px; padding: 0px; vertical-align: baseline;" style="border:0;box-sizing:border-box;font-family:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin-bottom:15px;margin-top:15px;outline:none 0;padding:0;vertical-align:baseline;"> <p style="margin:0;"><i data-blogger-escaped-style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; border: 0px; box-sizing: border-box; font-family: inherit; font-stretch: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; outline: none 0px; padding: 0px; vertical-align: baseline;" style="border:0;box-sizing:border-box;font-family:inherit;font-stretch:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0;outline:none 0;padding:0;vertical-align:baseline;">a softer, usually edible part of a nut, seed, or fruit stone contained within its hard shell.
See how the words kernel/shell relate? That’s the origin of it and its borrowed use in computing. The kernel is the essence/core of the OS. You access the machine via the OS and the OS via a “shell” that seems to “contain” the kernel.
Hope this clarifies your confusion 🙂
The core inner part of the OS is the Kernel (linux kernel or Windows kernel or FreeBSD kernel) but users interact with this by using the outer part or shell (eg bash shell or cmd.exe or korn shell)
Users can not directly control hardware like printers or monitors. Users can not directly control virtual memory or process scheduling. While the kernel takes care of such matters, the user uses the UI or shell to communicate with the kernel. The UI can be CLI (bash shell or DOS shell) or GUI (Kde for Linux or Metro UI for Windows)
The kernel is the part of the operating system that runs in privileged mode. It does all sorts of things like interact with hardware, do file I/O, and spawn off processes.
The shell (e.g., bash), by contrast, is a specific program which runs in user-space (i.e., unprivileged mode). Whenever you try to start a process with the shell, the shell has to ask the kernel to make it. In Linux, it would probably do this with the system calls fork
and execve
. Furthermore, the shell will forward its input (usually, from your own key presses) to the running program’s stdin
, and it will forward the program’s output (stdout
and stderr
) to its own output (usually displayed on your screen). Again, it does all this with the help of the kernel.
Basically the kernel is the center of the operating system that manages everything. The shell is just a particular program, a friendly interface that translates your commands into some low-level calls to the kernel.
Analogical we try to say like, Kernel is chef who prepare food, and shell is kind of waiter who take the order and deliver it to the user.
Technically, Shell is software program which understood that what user want and convey it to kernel. Kernel perform work according to the instruction and return back to user via shell.
If you really enthusiastic about how shell and kernel work together then please feel free to browse code NEKTech-Linux Jitendra-khasdev/NEKTech-Linux-Shell
- A shell is a command interpreter, i.e. the program that either process the command you enter in your terminal emulator (interactive mode) or process shell scripts (text files containing commands) (batch mode). In early Unix times, it used to be the unique way for users to interact with their machines. Nowadays, graphical environments are replacing the shell for most casual users.
A kernel is a low level program interfacing with the hardware (CPU, RAM, disks, network, …) on top of which applications are running. It is the lowest level program running on computers although with virtualization you can have multiple kernels running on top of virtual machines which themselves run on top of another operating system.
An API is a generic term defining the interface developers have to use when writing code using libraries and a programming language. Kernels have no APIs as they are not libraries. They do have an ABI, which, beyond other things, define how do applications interact with them through system calls. Unix application developers use the standard C library (eg: libc, glibc) to build ABI compliant binaries. printf(3) and fopen(3) are not wrappers to system calls but (g)libc standard facilities. The low level system calls they eventually use are write(2) and open(2) and possibly others like brk, mmap. The number in parentheses is a convention to tell in what manual the command is to be found.
The first volume of the Unix manual pages contains the shell commands.
The second one contains the system call wrappers like write and open. They form the interface to the kernel.
The third one contains the standard library (including the Unix standard API) functions (excluding system calls) like fopen and printf. These are not wrappers to specific system calls but just code using system calls when required.
A KERNEL is the part of the Operating System that communicates between the hardware and software of a computer and manages how hardware resources are used to meet software requirements.
A SHELL is the user interface that allows users to request specific tasks from the computer. Two types of user interfaces are the text based “Command Line Interface”, (CLI), or the Icon based “Graphical User Interface”, (GUI).
Note that the “CLI” uses less resources and is a more stable interface.
However, those of us using home routers will use a “GUI”. Note that the Operating System, (OS), of a home router is actually called “Firmware”.
Reference
https://www.quora.com/What-is-the-difference-between-a-kernel-and-shell
Both the Shell and the Kernel are the Parts of this Operating System. These Both Parts are used for performing any Operation on the System. When a user gives his Command for Performing Any Operation, then the Request Will goes to the Shell Parts, The Shell Parts is also called as the Interpreter which translate the Human Program into the Machine Language and then the Request will be transferred to the Kernel. So that Shell is just called as the interpreter of the Commands which Converts the Request of the User into the Machine Language.
Kernel is also called as the heart of the Operating System and the Every Operation is performed by using the Kernel , When the Kernel Receives the Request from the Shell then this will Process the Request and Display the Results on the Screen.
As we have learned there are Many Programs or Functions those are Performed by the Kernel But the Functions those are Performed by the Kernel will never be Shown to the user. And the Functions of the Kernel are Transparent to the user.
Reference
http://ecomputernotes.com/fundamental/disk-operating-system/what-is-shell-and-kernel