OS - Lecture # 05 - Operating System Structure
OS - Lecture # 05 - Operating System Structure
�ِﺴ ِﻢ ِ
ۑ ۷ ٥ ۶ ۹ ٥ ۷
ἐ ۸ ہ ٦ ٦ ﯧ
٦ ╖
ڮ ּĭڹڮ┤ּ ﮩڵּ �ڶ┼≡ּ ڶּﮥ ڵṟ˨ּδڶڹڮ┬ּṎڮ>ڹڰּ↑ ﮘּ┼˃δﯖּ �ڵ · ▲ ʳ ╕
Ḋ
ڴּڼѲڮ ڴּ ɢڵּڹ٪ʬδ
1
Operating System Structure
Lecture # 05
By: Muhammad Ehsan
Lecturer
Department of Computer Science
2
Operating System Structure
3
Lecture Outline
4
User and Operating-System
Interface
5
Command-line interface
7
Graphical User Interfaces
User-friendly desktop metaphor interface
o Usually mouse, keyboard, and monitor
o Icons represent files, programs, actions, etc
o 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
Apple Mac OS X is “Aqua” GUI interface with UNIX kernel underneath and shells
available
8
Unix and Linux have CLI with optional GUI interfaces (CDE, KDE, GNOME)
Touchscreen Interfaces
9
The Mac OS X GUI
10
System Calls
11
System Calls
User mode
Kernel
Privileged mode
Mode
12
System Calls
13
Example of System Calls
Example of a System Call sequence for writing a simple program to
read data from one file and copy them to another file:
17
System Call Implementation
19
Types of System Calls
20
Types of System Calls
21
Types of System Calls
Process control
create process, terminate process
end, abort
load, execute
get process attributes, set process attributes
wait for time
wait event, signal event
allocate and free memory
22
Types of System Calls
File management
create file, delete file
open, close file
read, write, reposition
get and set file attributes
23
Types of System Calls
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
24
Types of System Calls
Communications
create, delete communication connection
send, receive messages if message passing model to host name or
process name
o From client to server
Shared-memory model create and gain access to memory regions
transfer status information
attach and detach remote devices
25
Types of System Calls
Protection
Control access to resources
Get and set permissions
Allow and deny user access
26
Examples of Windows and Unix System Calls
27
Standard C Library Example
28
System Programs
29
System Programs
An important aspect of a modern system is the collection of system
programs.
-----Application Program-----
System program
31
System Programs
Most users’ view of the operation system is defined by system programs,
not the actual system calls
Provide a convenient environment for program development and
execution
Some of them are simply user interfaces to system calls; others are
considerably more complex
32
System Programs
File management:
Create, delete, copy, rename, print, dump, list, and generally manipulate files
and directories
Status information
o Some ask the system for info - date, time, amount of available memory, disk
space, number of users
o Others provide detailed performance, logging, and debugging information
o Some systems implement a registry - used to store and retrieve
configuration information
33
System Programs
File modification
o Text editors to create and modify files
o Special commands to search contents of files or perform
transformations of the text
Programming-language support
o Compilers, assemblers, debuggers and interpreters sometimes
provided
• for common programming languages (such as C, C++, Java,Visual
Basic, and PERL) are often provided to the user with the operating
system.
34
System Programs
Program loading and execution
o Once a program is assembled or compiled, it must be loaded into
memory to be executed.
o Absolute loaders, relocatable loaders, linkage editors, and overlay-
loaders, debugging systems for higher-level and machine language
Communications
o Provide the mechanism for creating virtual connections among
processes, users, and computer systems
o Allow users to send messages to one another’s screens, browse web
pages, send electronic-mail messages, log in remotely, transfer files
35
from one machine to another
System Programs
Background Services
o Launch at boot time
o Some for system startup, then terminate
o Some from system boot to shutdown
o Provide facilities like disk checking, process scheduling, error logging,
printing
o Run in user context not kernel context
o Known as services, subsystems
36
System Programs
37
JAZAK ALLAH!
Any Question?
38