User Interfaces for Operating Systems
User Interfaces for Operating Systems
Objectives
- Explore different kinds of user interfaces for operating systems.
- Focus on command line interface (CLI) and graphical desktop environments (GUI).
- Emphasize the importance of the command line interface for automation.
User Interfaces to Operating Systems
- Users cannot directly interact with the kernel; all interactions create new processes.
- Types of user interfaces:
- Command Line Interface (CLI)
- Batch system
- Graphical User Interfaces (GUI)
- Text-Based User Interface (TUI): similar to CLI, uses keystrokes for actions
Dominance of User Interfaces
- Traditional OS (Windows, macOS, Android, Chrome OS, iOS): GUI is dominant.
- Linux: Choice between CLI and GUI (desktop environments).
- Servers: CLI is often the default due to resource efficiency.
CLI vs. GUI
- CLI can appear scary but becomes easy with practice.
- Advantages and disadvantages exist for both, choice depends on the task.
CLI
- Powerful for automation.
- Requires memorization of commands (hundreds or thousands, but only about 20 are used daily)
- More precise (e.g., typing a number is more exact than using a slider).
- Less forgiving (syntax errors cause errors).
GUI
- More user-friendly and easy to learn.
- More forgiving (lenient with mouse clicks, etc.).
- Can represent more than just text (images, videos, sounds).
- Designers try to cater to all possible uses, but inherently less power than CLI
Efficiency and Resources
- Experienced CLI users are faster than GUI users.
- GUI offers a richer experience in terms of communication.
- GUI requires more resources, making CLI preferable for servers.
Shell and Terminal
- CLI involves running a program (shell) that communicates with the kernel.
- Shell: Application that takes typed commands and executes them via system calls.
- Shells are appearing in GUI-oriented OS like Windows.
POSIX Systems Shells
- Born shell
- C shell
- Born Again Shell (Bash): most common, to be used in the course
- K Shell
- Z Shell: Default on macOS, can switch to other POSIX shells
Microsoft Windows Shells
- PowerShell: Similar to bash, different syntax, used for Windows system administration
Shell Functionality
- Shell interprets commands, defines environment with variables.
- Enables shell scripts for automation (repetitive tasks, system checks, combining commands).
Demo of Shell
Windows Terminal (PowerShell):
ls
: Lists files in the current directory.pwd
: Shows the current directory.whoami
: Shows the current user.
Secure Shell (SSH) to remote Linux machine (Bash shell):
- Uses password for secure connection.
- NeoFetch tool to show Linux distribution info.
Common Commands
man
: Manual pages for command documentation.ls
: List directory contents.cd
: Change directories.rm
: Remove files.cp
: Copy files.mv
: Move files.pwd
: Present working directory.- Commands to show the contents of a text file.
Batch Interface
- Used in high-performance computing for automating long-running applications.
- Batch scheduler manages jobs based on resource availability.
Graphical User Interface (GUI)
- Familiar to most users (Windows, macOS).
- Uses a desktop metaphor with icons.
- Mouse, keyboard, and touchscreen control actions.
GUI Processes
- Background desktop and icons are managed separately.
- Panels (start menu, taskbar) are separate processes.
- Window manager: Manages resizing, moving, and hiding windows.
- Applications control what is displayed inside their windows.
POSIX GUI System - X Window Environment (X)
- XServer: Controls graphics cards, keyboard, and mouse input.
- XClients: Applications (word processor, etc.) making draw requests to the XServer.
- Window manager: Special XClient that manages windows.
Window Managers
- Choice of window manager in Linux affects window operations and animations.
- Customizable buttons (close, maximize, minimize).
- Tiling support: Some window managers offer tiling for efficient window arrangement.
Tiling Window Manager Example
- Linux virtual machine (PopOS) with tiling window manager.
- Applications automatically take up available screen space.
- Efficient for workflows like programming, especially with keyboard shortcuts.
- Workspaces: Ability to have multiple activities on different workspaces.
Desktop Environments
- Suite of XClients and a window manager providing an integrated desktop experience.
- Examples: GNOME, KDE, Mate.
- Can install multiple desktop environments and choose which to use.
Desktop Environment Considerations
- Resource usage: KDE and GNOME require more resources.
- Special effects: Some offer more visual effects.
- Window management: Tiling vs. traditional.
Key Takeaways
- Familiarity with terminal applications and shells (PowerShell, BashShell, Z Shell) is crucial.
- Understanding different desktop environments allows for customization based on needs and resources.