November 30, 2023 University of the People Department of Computer Science CS 2301 - Operating Systems 1 Instructor: Damian Kravets System calls are like messengers between the applications you use and the heart of your computer's operating system, called the kernel. This kernel manages the computer's resources and runs different programs. These system calls help applications ask the kernel for important services, like handling files, controlling processes, and talking to devices (magichat, 2022). Categorizing System Calls: A Spectrum of Functionalities To understand what these system calls do, we can group them based on specific things they help with: 1. File System Calls: These calls help applications smoothly work with the file system. This includes tasks like opening, reading, writing, closing, deleting, and creating directories. 2. Process Control Calls: These calls manage the different stages a program goes through, like creating new processes, running programs, waiting for processes to finish, sending signals, and figuring out process IDs. 3. Device Input/Output (I/O) Calls: These calls connect applications with the things you can input to (like a keyboard) or output from (like a screen). They allow reading, writing, controlling parameters, and keeping an eye on multiple I/O operations. 4. Memory Management Calls: These calls make sure the computer uses its memory well. They take care of tasks like giving out memory, taking it back when it's not needed, and protecting it so everything runs smoothly. 5. Networking Calls: These calls help with communication between computers, doing tasks like creating connections, sending and receiving data packets, and setting up network sockets. 6. Interprocess Communication (IPC) Calls: These calls help different programs talk to each other and share resources, so they can work together better. System Call Demonstration: Opening a File for Access
To show how a system call works, let's look at the open() call. This call is like asking the computer to open a file. When you use it, the computer checks if the file exists, if you're allowed to use it, and if it's available. If everything is good, the computer gives you a special name (a file descriptor) to use for other operations (Chapman, 2021). Process States: A Glimpse into Process Dynamics Process states are like the different moods a program can be in. There are five main ones: 1. Running: The program is doing things actively on the computer. 2. Runnable: The program is ready to do things but is waiting for its turn on the computer. 3. Interruptible Sleep: The program is waiting for something to happen, like an input or output task, and can be woken up by signals. 4. Uninterruptible Sleep: The program is waiting for something crucial, like finishing an input or output task, and can't be interrupted. 5. Zombie: The program has finished, but the computer hasn't cleaned up after it yet. Context Switching: The Balancing Act of Process Management Context switching is like changing the focus from one program to another. It helps the computer use its resources well among different programs. But, it