Operating System
Operating System
---
- A user interface allows the user to interact with the operating system.
2. **Graphical User Interface (GUI)**: Users interact via visual elements (menus, buttons, etc.).
- Advantages:
- Disadvantages:
- **Linux**: Terminal.
1. **Command interpreter contains the code**: The CLI has built-in code to execute commands.
2. **Command interpreter calls external programs**: CLI calls external programs to perform tasks.
#### 9. **Conclusion**
- The user interacts with the operating system through interfaces (CLI or GUI).
- CLI offers more control but requires memorization, while GUI is user-friendly and intuitive.
---
Lecture 9
- System calls provide an interface to the services available by the operating system.
- Programs use system calls to request access to resources like memory, hardware, etc.
- **User Mode:**
- **Kernel Mode:**
3. **Context Switching:**
- When a program running in user mode requires system resources, it makes a system call, which
switches the execution to kernel mode, known as **context switching**.
- **Step-by-Step Breakdown:**
- **Input File Name:** A system call is made to get the input file name from the user (via
keyboard or mouse).
- **Output File Name:** Another system call is made to get the output file name.
- **Open Input File:** The program uses a system call to open the input file.
- **Create Output File:** If the output file doesn’t exist, a system call creates it; if it does, the
program aborts via a system call.
- **Copying Data:** The program uses system calls in a loop to read from the input file and write
to the output file.
- **Close Files:** System calls are made to close both input and output files.
- **Completion Message:** A final system call writes a message to the screen indicating the
completion of the process.
6. **Takeaway:**
- Thousands of system calls may be executed per second during program execution.
- System calls are essential for programs to access operating system services.
This lecture provides a basic understanding of system calls, their function, and their importance in
program execution. Future lectures will delve into the different types of system calls.
Lecture 10
Here are structured notes based on your content regarding the types of system calls:
---
- Examples:
- **Wait for Time/Event**: Allows a process to wait for a specific time or event.
2. **File Manipulation**
- Examples:
3. **Device Management**
- Examples:
- **Attach/Detach Device**: Logically attaches or detaches a device (e.g., ejecting a pen drive).
4. **Information Maintenance**
- Examples:
- **Get/Set Time/Date**: Retrieves or sets the system time and date.
- **Get/Set Process, File, Device Attributes**: Retrieves or sets attributes related to processes,
files, or devices.
5. **Communication**
- Examples:
- **Attach/Detach Remote Devices**: Attaches or detaches remote devices to/from the system.
---
1. **Process Control**
2. **File Manipulation**
3. **Device Management**
4. **Information Maintenance**
5. **Communication**
Each category groups system calls based on their functionalities, allowing the operating system to
handle processes, files, devices, information, and communication efficiently.