Kernel and Shell

Jan 12 • Resources • 25130 Views • 8 Comments on Kernel and Shell

Kernel and Shell are the important part of an operating system which is used to perform any specific operation on the System. The term is basically denotes a software that is used to provide an interface to each user of an operating system in order to excess the services of Kernel. When a user gave Command to perform an operation, then the command will first serve to the Shell part. The Shell is also known as an Interpreter which is used to translate program in assembly language to machine language and then the made request is transferred to the Kernel. Now, let discuss the concept of Kernel and Shell in brief in terms of questions and answers.

Questions and Answers on Kernel and Shell

Q1. What is a kernel?
Answer: Kernel is actually the heart of operating systems. It acts as  an interface between the applications and actual data processing done at hardware level (CPU, disk memory etc.). Kernel lies in the center of the operating system which manages the communication b/w the user level applications and the hardware installed on the system. In other words, we can say that its a platform consisting the specific set of libraries and infrastructure for the new application made and thus help in interaction among them.

Here is a diagram that gives you a better view about what Kernel is in an Operating System

Kernel

OS Kernel

Let’s take another picture of the Kernel in Operating system to clear this concept in our mind In the second image below, the kernel lies in between the application and the hardware like CPU, Memory and Devices and let them interact with the applications installed. Thus, it is behaving like a interaction level for the other two.

Shell and Kernel

Kernel in OS

After clearing the introduction of the kernel in operating system. Let’s find the types. There are following types of kernels developed-

  • Monolithic Kernel
  • Microlithic Kernel
  • Hybrid or Modular Kernel
  • Exo Kernel
  • Nano Kernel

Q2. What are the tasks performed by kernel?
Answer: There are following main tasks performed by kernel:-

Note: To know more about “Operating System Design/Kernel Architecture” read Operating System Design/Kernel Architecture

Q3. Differentiate between Micro and Monolithic kernels.
Answer:  The answer for this question comes from the names. There are following major differences-
a. Mono means  everything in kernel space, whereas micro means minimal kernel space.

b. Monolithic Kernels perform Process management,Memory Management,File Input/Output. Here all OS services run along with the main kernel thread, thus also residing in the same memory area. Whereas,

In Micro-Kernel, very minimal support for the process management goes into the kernel. The micro-kernel approach consists of defining a simple abstraction over the hardware,with a set of primitives or system to implement minimal Operating System (OS) services such as an address space management, thread management, and inter-process communication. All the other services, including those normally provided by the kernel such as networking, are implemented in user-space programs referred to as servers.

c. The disadvantage of monolithic kernels is the dependency between system components a bug might crash the entire system – and the fact that large kernels also. Main disadvantage with micro kernels is that large amount of system calls might slow down the system.

d. Examples of Monolithic Kernels are: Symbian os, AIX OS, Amoeba.
Examples of Micro kernels are Mach, QNX, L4, Minix.

Q4. What are hybrid kernels?
Answer: Hybrid kernels can thought of like extensions of micro kernels with some features of monolithic kernels. Basically, Hybrid kernels are a compromise between the monolithic and microkernel designs. This implies running some services (such as the network stack or the file system) in kernel space to reduce the performance overhead of a traditional microkernel, but still running kernel code (such as device drivers) as servers in user space. Hybrid kernels are used in most commercial operating systems such as Microsoft Windows NT, 2000, XP, Vista, and 7.

Q5. What are Exo-kernels?
Answer: These are the type of kernels that simply separate security from an abstraction. It makes non-overridable parts of operating system multiplex the hardware securely. The goal is to avoid forcing any particular abstraction upon applications, instead allowing them to use or implement whatever abstractions are best suited to their task without having to layer on top of other abstractions which may impose limits or unnecessary overhead.

Q6. What is a Shell in operating system?

Shell in OS

OS Shell

Answer: A shell is simply a software the gives a user interface to various operating system functions and services. So, in layman words ”Your interface to operating system is called shell”. Shells provide a way for you to communicate with the operating system. This communication is carried out either interactively (input from the keyboard is acted upon immediately) or as a shell script. A shell script is a sequence of shell and operating system command that is stored in a file.

Here is a pic that gives you a brief idea about shell:

Q7. What are the different types of shells available?
Answer: Some most popular commercial shells are:-

  • Korn shell
  • Bourne Shell
  • C shell
  • POSIX shell

Q8. List some salient features of shells in OS.
Answer: Well, some relevant features are:-
a. Wildcard substitution in file names (pattern-matching)
Carries out commands on a group of files by specifying a pattern to match, rather than specifying an actual file name.

b. Command aliasing
Gives an alias name to a command or phrase. When the shell encounters an alias on the command line or in a shell script, it substitutes the text to which the alias refers.

c. Command history
Records the commands you enter in a history file. You can use this file to easily access, modify, and reissue any listed command.

d. File name substitution
Automatically produces a list of file names on a command line using all pattern-matching characters.

e. Input and output redirection
Redirects input away from the keyboard and redirects output to a file or device other than the terminal. For example, input to a program can be provided from a file and redirected to the printer or to another file.

f. Piping
Links any number of commands together to form a complex program. The standard output of one program becomes the standard input of the next.

g. Shell variable substitution
Stores data in user-defined variables and predefined shell variables.

Q9. What is Korn Shell?
Answer: Korn shell is basically a UNIX shell that was developed by David Korn in Bell Labs. It has many features of C shell (csh) and Bourne Shell (bsh) and is one of the most efficient shells.

Q10. What is C shell?
Answer: C shell is a unix shell created by Bill Joy.at the University of California at Berkeley as an alternative to UNIX’s original shell, the Bourne shell .These two UNIX shells,along with the Korn shell , are the three most commonly used shells. The C shell program name is csh. The C shell was invented for programmers who prefer a syntax similar to that of the C language.

Download the Questions with answers on Kernels and Shells in Operating system in pdf Questions and Answers on Kernel and Shell in Operating Systems.pdf

Give your suggestions and feedback about this article in the comment section below this article.

Related Links-

Tell us Your Queries, Suggestions and Feedback

Your email address will not be published.

8 Responses to Kernel and Shell

  1. Yahya Adam says:

    Information technology

  2. Yahya Adam says:
  3. Mamata Kumari Sharma says:

    The contents of this article are just perfect and information & diagrams about Kernel and shell in Operating system are appropriately used.

  4. Rachita Mishra says:

    Both the Shell and the Kernel are the Parts of this Operating System. Kernel is also called as the heart of the Operating System.A shell is software that provides an interface for users of an operating system to access the services of a kernel.

  5. sneha nanda says:

    kernel is actually the heart of OPERATING SYSTEM . The partwise explanation of kernels and shells in this article provides all the neccessary information in one view and hence, is highly appreciated.

  6. Ranjit Singh says:

    This article is very good to know about the brain of operating system i.e KERNEL and shell(&its types).

  7. Pallavi sinha says:

    Article looks impressive and contains almost all useful information regarding this topic.if u have any doubt or rather wan to clear fundamental about this topic chk this link………..

  8. Divya Acharya says:

    this post contains information about kernel and shell,must go through this post

« »