Skip to content

7. Kernel And GUI

Command Shell 1

  • A command shell:
    • It is a program that accepts commands from the user and executes them.
    • It is OS-dependent. Commands are different for different OS.
    • It is a text-based version of a file manager. Shell always works in the context of a directory (the current working directory).
  • Home Directory. It is the directory where the user’s files are stored. It is the default directory when the user logs in. It is denoted by ~.
  • Command Shell on Windows:

    • It is called Command Prompt or PowerShell.
    • PowerShell is much closer to Linux/MacOS shells than CMD.
    • Wrap up folder names with double quotes if they contain spaces.
    • Some Shell Commands (PowerShell):
    pwd # print working directory
    cd <dir> # change directory
    ls # list files in the current directory
    mkdir <dir> # create a directory
    rmdir <dir> # remove a directory, must be empty
    move <file> <dir> # move a file to a directory, original file is deleted.
    move <file> <newFile> # rename a file
    rm <file> # remove a file
    copy <file> <dir> # copy a file to a directory
    copy <file> <newFile> # copy a file to a new file
    del <file> # delete a file
    
  • Command Shell on Linux/MacOS:

    • It is called Terminal.
    • Some Shell Commands (Terminal):
    pwd # print working directory
    cd <dir> # change directory
    ls # list files in the current directory
    mkdir <dir> # create a directory
    rmdir <dir> # remove a directory, must be empty
    mv <file> <dir> # move a file to a directory, original file is deleted.
    mv <file> <newFile> # rename a file
    rm <file> # remove a file
    cp <file> <dir> # copy a file to a directory
    cp <file> <newFile> # copy a file to a new file
    rm <file> # delete a file
    

GUI 2

  • The GUI was first developed at Xerox PARC by Alan Kay, Douglas Engelbart, and a group of other researchers in 1981.
  • Later, Apple introduced the Lisa computer with a GUI on January 19, 1983.
  • GUI is a graphical user interface. It includes objects such as icons, cursors, buttons, windows, menus, and scroll bars. Each of these objects has a specific function and visual effects such as shading, highlighting, and animation.
  • Elements of GUI:
    • Button. A small rectangle that contains a label. When the user clicks on the button, the program responds to the click.
    • Dialog Box. A small window that contains a message and a few buttons. It is used to display messages or get input from the user.
    • Icon. A small picture that represents a file, a program, or a device.
    • Menu. A list of commands that the user can select from.
    • Menu Bar. A horizontal bar that contains menus.
    • Ribbon. A horizontal bar that contains tabs. Each tab contains a group of commands.
    • Tab. A clickable area at the top of a window. It is used to switch between different views of the same window.
    • Toolbar. A Row of buttons that are used to perform common tasks.
    • Window. A rectangular area that contains a program’s user interface.
  • Examples of Non-GUI operating systems include MS-DOS and Unix.

Kernel 3

  • The kernel is the core of the operating system. It is the first program that runs when the computer is turned on (after the bootLoader). It remains in memory until the computer is turned off.
  • The Kernel provides an interface between the hardware and the user programs. So that it is responsible for handling system calls along with other tasks, such as memory management, process management, file management, device management, and security.
  • The kernel has its own isolated memory space; It is called kernel space and is protected from user programs.
  • Memory is divided into Kernel space and user space. The communication between the kernel and the user programs is done through system calls.
  • Functions of Kernel:
    • Access computer resources. Like CPU, memory, and I/O devices.
    • Resource management. Share resources among processes.
    • Memory management. Allocate memory to processes.
    • Device management. Manage I/O devices.
  • System calls can only be executed in Kernel mode. The kernel is responsible for switching between Kernel mode and User mode.
  • Processes are executed in user mode. When a Process makes a system call, the kernel switches to kernel mode and executes the system call. After the system call is executed, the kernel switches back to user mode using trap and interrupt.

Types of Kernel

Type Description Advantages Disadvantages
Monolithic Kernel Kernel and User share the same memory space. There is no explicit Kernel space. Process execution is faster since the communication between Kernel and User process happens faster. A single Service fail may crash the entire OS - When adding new services the entire OS needs reload - Bigger OS size
MicroKernel Kernel and User have separate memory space. Smaller OS size - Faster OS boot time. Slower process execution - More complex OS.
Hybrid Kernel Uses the modularity of Micro and the speed of Monolithic. Some services of the Kernel are in Kernel space while others are in User space. Faster process execution - Smaller OS size.
NanoKernel Kernel and User have separate memory space. It is the smallest type of Kernel that include only essential functions. Smaller OS size - Faster OS boot time.
Exokernel The resource protection is separated from management. Very complex design.

References


  1. CS 1110: Command shells. (2019). Department of Computer Science. https://www.cs.cornell.edu/courses/cs1110/2019sp/resources/command.html# 

  2. GUI. (2021, April 12). In computer hope. https://www.computerhope.com/jargon/g/gui.htm 

  3. What is kernel in operating system and what are the various types of kernel? (2019, November 11). AfterAcademy. https://afteracademy.com/blog/what-is-kernel-in-operating-system-and-what-are-the-various-types-of-kernel