Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
0 views

Ch2 Operating System Structures

Operating systems provide essential services for program execution, user interfaces (CLI and GUI), I/O operations, file-system manipulation, communication, and error detection. System calls serve as the programming interface to these services, allowing user-mode applications to interact with the kernel mode of the operating system. The document outlines various types of system calls, including process control, file management, device management, information maintenance, and communications.

Uploaded by

yosef jbara
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Ch2 Operating System Structures

Operating systems provide essential services for program execution, user interfaces (CLI and GUI), I/O operations, file-system manipulation, communication, and error detection. System calls serve as the programming interface to these services, allowing user-mode applications to interact with the kernel mode of the operating system. The document outlines various types of system calls, including process control, file management, device management, information maintenance, and communications.

Uploaded by

yosef jbara
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Chapter 2: Operating-System

Structures

Operating System Concepts Essentials– 8th Edition Silberschatz, Galvin and Gagne ©2011
Operating System Services
 Operating systems provide an environment for execution of programs and
services to programs and users
 Operating-system services provided to the user:
 User interface - Almost all operating systems have a user interface (UI).
 Varies between Command-Line (CLI), Graphics User Interface (GUI).
 Program execution - It provides programs an environment to execute.

 I/O operations - Operating system provides the access to the required I/O
device when required.

 File-system manipulation - The file system is of particular interest.


Programs need to read and write files and directories. The operating system
gives the permission to the program for operation on file. create and delete
them, search them, list file Information, permission management.

Operating System Concepts Essentials – 8th Edition 2.2 Silberschatz, Galvin and Gagne ©2011
Operating System Services (Cont.)
 Communications – Processes may exchange information, on the
same computer or between computers over a network
 Communications may be via shared memory or through
message passing (packets moved by the OS)
 Error detection – OS needs to be constantly aware of possible
errors. An error may occur in the CPU and memory hardware, in I/O
devices, in user program.
 The OS constantly checks for possible errors.
 For each type of error, the OS takes an appropriate action to
ensure correct and consistent computing.

Operating System Concepts Essentials – 8th Edition 2.3 Silberschatz, Galvin and Gagne ©2011
User Operating System Interface - CLI

 Command Line Interface (CLI) or command interpreter allows direct


command entry
 Sometimes implemented in kernel, sometimes by systems
program

Operating System Concepts Essentials – 8th Edition 2.4 Silberschatz, Galvin and Gagne ©2011
User Operating System Interface - GUI

 User-friendly desktop interface


 Usually mouse, keyboard, and monitor
 Icons represent files, programs, actions, etc
 Various mouse buttons over objects in the interface cause various
actions (provide information, options, execute function, open directory
(known as a folder)

 Many systems now include both CLI and GUI interfaces


 Microsoft Windows is GUI with CLI “command” shell
 Solaris is CLI with optional GUI interfaces (Java Desktop, KDE)

Operating System Concepts Essentials – 8th Edition 2.5 Silberschatz, Galvin and Gagne ©2011
Bourne Shell Command Interpreter

Operating System Concepts Essentials – 8th Edition 2.6 Silberschatz, Galvin and Gagne ©2011
The Mac OS X GUI

Operating System Concepts Essentials – 8th Edition 2.7 Silberschatz, Galvin and Gagne ©2011
System Calls
 Programming interface to the services provided by the OS

 Typically written in a high-level language (C or C++)

 Examples of APIs are Win32 API for Windows, and Java API for the
Java virtual machine (JVM).

Operating System Concepts Essentials – 8th Edition 2.8 Silberschatz, Galvin and Gagne ©2011
Example of System Calls
 System call sequence to copy the contents of one file to another file

Operating System Concepts Essentials – 8th Edition 2.9 Silberschatz, Galvin and Gagne ©2011
API – System Call – OS Relationship

Operating System Concepts Essentials – 8th Edition 2.10 Silberschatz, Galvin and Gagne ©2011
Standard C Library Example
 C program invoking printf() library call, which calls write() system call

Operating System Concepts Essentials – 8th Edition 2.11 Silberschatz, Galvin and Gagne ©2011
System Calls
 To understand system calls, first one needs to understand the difference
between kernel mode and user mode of a CPU. Every modern operating
system supports these two modes.

Operating System Concepts Essentials – 8th Edition 2.12 Silberschatz, Galvin and Gagne ©2011
System Calls
 Kernel Mode
 When CPU is in kernel mode, the code being executed can access any
memory address and any hardware resource.
 Hence kernel mode is a very privileged and powerful mode.
 If a program crashes in kernel mode, the entire system will be halted.

 User Mode
 When CPU is in user mode, the programs don’t have direct access to
memory and hardware resources.
 In user mode, if any program crashes, only that particular program is
halted.
 That means the system will be in a safe state even if a program in user
mode crashes.
 Hence, most programs in an OS run in user mode.
Operating System Concepts Essentials – 8th Edition 2.13 Silberschatz, Galvin and Gagne ©2011
Types of System Calls
 Process control
 end, abort
 load, execute
 create process, terminate process
 get process attributes, set process attributes
 wait for time
 wait event, signal event
 allocate and free memory
 File management
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes

Operating System Concepts Essentials – 8th Edition 2.14 Silberschatz, Galvin and Gagne ©2011
Types of System Calls (Cont.)
 Device management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices
 Information maintenance
 get time or date, set time or date
 get system data, set system data
 get and set process, file, or device attributes
 Communications
 create, delete communication connection
 send, receive messages
 transfer status information
 attach and detach remote devices

Operating System Concepts Essentials – 8th Edition 2.15 Silberschatz, Galvin and Gagne ©2011

You might also like