Computer Science
Beginner
80 mins
Teacher/Student led
What you need:
Chromebook/Laptop/PC

Operating Systems Layers

In this lesson, you'll explore the essential layers of an operating system and their roles in managing computer resources. Learn about hardware, kernel, application, and user interface layers, and understand process management, file systems, and virtualisation through practical examples.
Learning Goals Learning Outcomes Teacher Notes

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Introduction

    In this lesson, you will explore the layers of an operating system (OS) and their roles in managing computer resources. You will learn about the hardware layer, kernel, application layer, and user interface, with a focus on process management, file systems, and virtualisation. Using examples from Linux and Windows, you will discuss how these components interact to make computers efficient and user-friendly.

    By the end of this lesson, you will be able to:

    • Describe the main layers of an operating system and their functions.
    • Explain process management, file systems, and virtualisation with real-world examples.
    • Analyse OS features in group discussions to understand their practical applications.

    2 - Understanding OS Layers

    An operating system acts as an intermediary between users and computer hardware, managing resources and providing a platform for applications. It is structured in layers, each with specific responsibilities, to ensure efficient operation. Let's explore these layers in detail:

    Hardware Layer:
    This is the foundation, consisting of physical components like the CPU, memory, storage devices, and input/output peripherals. The OS interacts directly with this layer to control hardware resources. 

    Hardware Layer

    Kernel Layer:
    The kernel is the core of the OS, handling low-level tasks such as memory allocation, process scheduling, and device management. It acts as a bridge between hardware and software. In Linux, the kernel is open-source and highly customisable, whereas Windows has a proprietary kernel focused on stability and security.

    Kernel Layer

    Application Layer:
    This layer includes system utilities and application programming interfaces (APIs) that allow software to run. It provides services like file management and networking. For instance, Linux uses shells like Bash for command-line applications, while Windows offers APIs like Win32 for developers.

    Application Layer

    User Layer:
    The top layer is the user interface, such as graphical user interfaces (GUIs) or command-line interfaces (CLIs). It allows users to interact with the system easily. Windows provides a familiar GUI with the Start menu, while Linux distributions like Ubuntu offer both GUI (e.g., GNOME) and CLI options.

    User Layer
    These layers work together hierarchically: the kernel manages hardware, applications build on kernel services, and the user layer provides accessibility.

    3 - Opening a Web Browser

    Now that you've learned about the layers of an operating system, let's apply this knowledge to a everyday task: opening a web browser on your computer. This will help you see how all the layers work together in practice. We'll break it down step by step, explaining what happens behind the scenes when you click on your browser icon.

    1. User Layer Involvement
      You start by interacting with the user interface. This is the top layer – the graphical user interface (GUI) on your desktop. For example, in Windows, you might click the browser icon on the taskbar or Start menu; in Linux (like Ubuntu), you could use the GNOME desktop to launch it. Your action (mouse click or keyboard shortcut) sends a request to the OS to start the browser application. The user layer makes this easy and intuitive, translating your input into commands the system can understand.
    2. Application Layer Involvement
      Once the request is made, the application layer kicks in. This layer includes system utilities and APIs that help launch and run software. The OS checks for the browser's executable file (like chrome.exe on Windows) and prepares to load it. It handles any necessary services, such as networking APIs that the browser will use later for internet access. In Linux, this might involve shell scripts or system calls to initiate the program.
    3. Kernel Layer Involvement
      At the core, the kernel takes over. It manages the low-level tasks: allocating memory for the browser process, scheduling CPU time to run it, and handling device management (like accessing your screen and input devices). The kernel creates a new process for the browser, ensuring it doesn't interfere with other running programs through process isolation. For instance, in Windows, the kernel uses priority scheduling; in Linux, it might use time-sharing to multitask efficiently. 
    4. Hardware Layer Involvement
      Finally, the hardware layer comes into play. The kernel interacts directly with physical components: the CPU executes the browser's code, memory (RAM) stores the program's data temporarily, storage devices (like your hard drive or SSD) load the browser files, and input/output peripherals (screen, mouse, keyboard) display the browser window and respond to your actions. Without this foundation, none of the upper layers could function.
    All these layers interact hierarchically: your user input triggers the application layer, which calls on the kernel to manage resources, ultimately controlling the hardware. This seamless process happens in seconds, making your computer efficient and user-friendly.
    Reflect for a moment: Next time you open your browser, think about this chain of events. How might a problem in one layer (like low memory in the hardware layer) affect the whole process?

    4 - Process Management

    Process management is a key function of the OS kernel, involving the creation, scheduling, and termination of processes.

    But what exactly is a process? Think of it as a running program – for example, when you open a web browser or a game, that's a process in action. The kernel oversees these processes to ensure the computer runs smoothly, making sure no single program hogs all the resources.

    It ensures efficient use of CPU time and resources by deciding which process gets to use the CPU at any given moment, like a traffic controller directing cars at a busy junction.

    In Windows, the Task Manager shows processes and allows you to end tasks, using algorithms like priority scheduling to manage them – this means important tasks get more attention. Linux uses tools like 'ps' and 'top' for monitoring, with the kernel handling multitasking through time-sharing, where the CPU switches quickly between processes to make it seem like everything is running at once.

    Examples: When you open multiple apps on Windows, the OS allocates CPU time to each process to prevent freezing. In Linux, servers run multiple processes simultaneously for web hosting, using virtual memory to isolate them – this means each process has its own 'space' in memory, preventing one from interfering with another.

    Why is process isolation important for security? Consider a scenario where a faulty process could crash the entire system without proper management. For instance, if a virus infects one process, isolation stops it from spreading.

    Take a few minutes a moment to open a process monitoring tool on your computer and observe the running processes:

    • On Windows: Press Ctrl+Shift+Esc to open Task Manager. Go to the 'Processes' tab and look at the list of running processes, CPU usage, and memory allocation. Try opening a new app (like a browser) and see how a new process appears.
    • On macOS: Open Spotlight (Cmd+Space), search for 'Activity Monitor', and launch it. View the 'CPU' or 'Memory' tabs to see active processes and their resource usage.
    • On Linux: If using a GUI like Ubuntu, search for 'System Monitor' in the applications menu. Alternatively, open a terminal and type 'top' or 'htop' (if installed) to view processes interactively. Observe how processes are listed with their IDs, CPU, and memory usage.

    Spend a few minutes exploring: Identify a few processes, note their resource usage, and think about how the kernel is managing them in the background. 

    5 - File Systems

    The file system is a crucial part of the operating system that organises and manages data storage on disks, such as hard drives or SSDs. It handles essential tasks like file creation, deletion, reading, writing, and access control, providing a structured way to store and retrieve information efficiently. Without a good file system, your computer would struggle to keep track of all your files, photos, documents, and programs, leading to chaos and potential data loss.

    Different operating systems use different file systems to suit their needs. For example, Windows typically uses NTFS (New Technology File System), which supports large files, built-in encryption to protect sensitive data, and permissions to control who can access certain files or folders. This makes it great for secure environments, like in schools or businesses. On the other hand, Linux often uses ext4, which is known for its reliability and a feature called journaling. Journaling acts like a safety net – it logs changes before they're fully applied, so if there's a sudden crash or power outage, the system can recover without losing data.

    Examples: In Windows, you can right-click a folder and encrypt it for security, ensuring only authorised users can open it. In Linux, advanced file systems like Btrfs go even further by offering snapshots, which are like instant backups of your files at a specific point in time – super useful for data recovery if something goes wrong, such as accidentally deleting an important assignment.

    Take a few minutes to explore the file system on your computer and observe how files are managed:

    • On Windows: Press Windows key + E to open File Explorer. Navigate to a folder like Documents, right-click on a file or folder, select 'Properties', and check the 'General' tab for details like size and type, or the 'Security' tab for permissions. Try creating a new folder (right-click > New > Folder) and note how it's instantly added to the file system.
    • On macOS: Open Finder (Cmd + Space, search for Finder), go to a folder like Documents, right-click (or Ctrl-click) a file, select 'Get Info', and view details like size, permissions, and sharing options. Create a new folder (File > New Folder) and observe the changes.
    • On Linux: Open the file manager (e.g., Files in Ubuntu), navigate to a directory like Home, right-click a file, select 'Properties', and look at permissions, size, and type. In a terminal, you can type 'ls -l' to list files with details or 'mkdir newfolder' to create a directory.

    Spend a few minutes exploring: Identify a few files or folders, note their properties, and think about how the file system organises them, handles permissions, and ensures data integrity in the background.

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of DigitalSkills.org. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more