SlideShare a Scribd company logo
Amrita
School
of
Engineering,
Bangalore
Ms. Harika Pudugosula
Teaching Assistant
Department of Electronics & Communication Engineering
• Operating System Services
• User and Operating System Interface
• System Calls
• Types of System Calls
• System Programs
• Operating System Structure
2
Objectives
• To describe the services an operating system
provides to users, processes, and other
systems
• To discuss the various ways of structuring an
operating system
• To explain how operating systems are installed
and customized and how they boot
3
Operating System Services
• Operating systems provide an environment for execution of programs
and services to programs and users
• One set of operating-system services provides functions that are
helpful to the user:
– User interface - Almost all operating systems have a user
interface (UI).
• Varies between Command-Line (CLI), Graphics User
Interface (GUI), Batch interface
– Program execution - The system must be able to load a
program into memory and to run that program, end execution,
either normally or abnormally (indicating error)
– I/O operations - A running program may require I/O, which may
involve a file or an I/O device
4
5
fig: A view of Operating System Services
Cont..
• One set of operating-system services provides functions that are
helpful to the user (Cont.):
– File-system manipulation - The file system is of particular
interest. Programs need to read and write files and directories,
create and delete them, search them, list file Information,
permission management.
– 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
• May occur in the CPU and memory hardware, in I/O devices,
in user program
• For each type of error, OS should take the appropriate action
to ensure correct and consistent computing
• Debugging facilities can greatly enhance the user’s and
programmer’s abilities to efficiently use the system
6
• Another set of OS functions exists for ensuring the efficient
operation of the system itself via resource sharing
– Resource allocation - When multiple users or multiple
jobs running concurrently, resources must be allocated to
each of them
• Many types of resources - CPU cycles, main
memory, file storage, I/O devices.
– Accounting - To keep track of which users use how
much and what kinds of computer resources
– Protection and security - The owners of information
stored in a multiuser or networked computer system may
want to control use of that information, concurrent
processes should not interfere with each other
• Protection involves ensuring that all access to
system resources is controlled
• Security of the system from outsiders requires user
authentication, extends to defending external I/O
devices from invalid access attempts
7
Cont..
User Operating System Interface - CLI
CLI or command interpreter allows direct command entry
– Sometimes implemented in kernel, sometimes by systems
program
– Sometimes multiple command implemented – shells
– The main function of the command interpreter is to get and
execute the next user-specified command
• Primarily fetches a command from user and executes it
– Two approaches that OS executes a task
• the command interpreter itself contains the code to execute
the command
• OS implements most commands through system programs
– Example: a command to delete a file naming file.txt
– Sometimes commands built-in, sometimes just names of
programs
• If the latter, adding new features doesn’t require shell
modification 8
Bourne Shell Command Interpreter
9
User Operating System Interface - GUI
• User-friendly desktop metaphor 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)
– Invented at Xerox PARC
• 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
– Unix and Linux have CLI with optional GUI interfaces (CDE,
KDE, GNOME)
10
Touchscreen Interfaces
n Touchscreen devices require
new interfaces
l Mouse not possible or not
desired
l Actions and selection based
on gestures
l Virtual keyboard for text
entry
l Voice commands.
11
The Mac OS X GUI
12
System Calls
• System calls provide an interface to the services made available by
an operating system
• Typically written in a high-level language (C or C++)
• Application developers design programs according to an
application programming interface (API).
• The API specifies a set of functions that are available to an
application programmer, including the parameters that are passed
to each function and the return values the programmer can expect.
• Mostly accessed by programs via a high-level Application
Programming Interface (API) rather than direct system call use
• Three most common APIs are
– Windows API for Windows System
– POSIX API for POSIX-based systems (including virtually all
versions of UNIX, Linux, and Mac OS X), and
– Java API for the Java virtual machine (JVM)
• Each operating system has its own name for each system call 13
14
Example: Copy contents of one file to another file
15
16
17
18
19
fig: Example of how system calls are used
20
System Call Implementation
• Typically, a number associated with each system call
– System-call interface maintains a table indexed
according to these numbers
• The system call interface invokes the intended system call
in OS kernel and returns status of the system call and any
return values
• The caller need know nothing about how the system call is
implemented
– Just needs to obey API and understand what OS will do
as a result call
– Most details of OS interface hidden from programmer
by API
• Managed by run-time support library (set of
functions built into libraries included with compiler)
21
API – System Call – OS Relationship
22
fig: The handling of a user application invoking the
open() system call
System Call Parameter Passing
• Often, more information is required than simply identity of
desired system call
– Exact type and amount of information vary according to
OS and call
• Three general methods used to pass parameters to the OS
– Simplest: pass the parameters in registers
• In some cases, may be more parameters than
registers
– Parameters stored in a block, or table, in memory, and
address of block passed as a parameter in a register
• This approach taken by Linux and Solaris
– Parameters placed, or pushed, onto the stack by the
program and popped off the stack by the operating
system
– Block and stack methods do not limit the number or
length of parameters being passed
23
Parameter Passing via Table
24
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
– Dump memory if error
– Debugger for determining bugs, single step execution
– Locks for managing access to shared data between processes
25
Types of System Calls (Cont.)
• File management
– create file, delete file
– open, close file
– read, write, reposition
– get and set file attributes
• Device management
– request device, release device
– read, write, reposition
– get device attributes, set device attributes
– logically attach or detach devices
26
Types of System Calls (Cont.)
• 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 if message passing model to
host name or process name
• From client to server
– Shared-memory model create and gain access to
memory regions
– transfer status information
– attach and detach remote devices
27
• Protection
– Control access to resources
– Get and set permissions
– Allow and deny user access
28
Types of System Calls (Cont.)
Examples of Windows and Unix System Calls
29
Standard C Library Example
• C program invoking printf() library call, which calls write() system
call
30
Example: MS-DOS
• Single-tasking
• Shell invoked when
system booted
• Simple method to run
program
– No process created
• Single memory space
• Loads program into
memory, overwriting all
but the kernel
• Program exit -> shell
reloaded
At system startup running a program
31
Example: FreeBSD
• Unix variant
• Multitasking
• User login -> invoke user’s choice of
shell
• Shell executes fork() system call to
create process
– Executes exec() to load program
into process
– Shell waits for process to
terminate or continues with user
commands
• Process exits with:
– status code = 0 – no error
– status code > 0 – error code
32
System Programs
• System programs provide a convenient environment for program
development and execution. They can be divided into:
– File manipulation
– Status information sometimes stored in a File modification
– Programming language support
– Program loading and execution
– Communications
– Background services
– Application programs
• Most users’ view of the operation system is defined by system
programs, not the actual system calls
33
System Programs
• Provide a convenient environment for program development
and execution
– Some of them are simply user interfaces to system calls;
others are considerably more complex
• File management - Create, delete, copy, rename, print,
dump, list, and generally manipulate files and directories
• Status information
– Some ask the system for info - date, time, amount of
available memory, disk space, number of users
– Others provide detailed performance, logging, and
debugging information
– Typically, these programs format and print the output to
the terminal or other output devices
– Some systems implement a registry - used to store and
retrieve configuration information
34
System Programs (Cont.)
• File modification
– Text editors to create and modify files
– Special commands to search contents of files or perform
transformations of the text
• Programming-language support - Compilers, assemblers,
debuggers and interpreters sometimes provided
• Program loading and execution- Absolute loaders,
relocatable loaders, linkage editors, and overlay-loaders,
debugging systems for higher-level and machine language
• Communications - Provide the mechanism for creating virtual
connections among processes, users, and computer systems
– Allow users to send messages to one another’s screens,
browse web pages, send electronic-mail messages, log in
remotely, transfer files from one machine to another
35
System Programs (Cont.)
• Background Services
– Launch at boot time
• Some for system startup, then terminate
• Some from system boot to shutdown
– Provide facilities like disk checking, process scheduling,
error logging, printing
– Run in user context not kernel context
– Known as services, subsystems, daemons
• Application programs
– Don’t pertain to system
– Run by users
– Not typically considered part of OS
– Launched by command line, mouse click, finger poke
36
37
References
1. Silberscatnz and Galvin, “Operating System Concepts,” Ninth Edition,
John Wiley and Sons, 2012.
38
Thank you

More Related Content

PPT
ch2_OS Structures.ppt To discuss the various ways of structuring an operatin...
PDF
CH02.pdf
PPT
OS Services, System call, Virtual Machine
PPT
operating system introduction and organization
PPTX
Lecture_02_Operating System Structures Operating Systems
PPTX
PPTX
Advanced Bulkification Strategies in Apex Triggers
PDF
Ch2 operating-system structures
ch2_OS Structures.ppt To discuss the various ways of structuring an operatin...
CH02.pdf
OS Services, System call, Virtual Machine
operating system introduction and organization
Lecture_02_Operating System Structures Operating Systems
Advanced Bulkification Strategies in Apex Triggers
Ch2 operating-system structures

Similar to Operating System Structure Part-I.pdf (20)

PPT
Operating-System Structures
PPTX
Design Of Operating System_Lecture_OS_2.pptx
PPT
PPT
MELJUN CORTES operating_system_structure
PPT
Chapter 2 - Operating System Structures
PPT
OS - Ch2
PDF
02_os_structures.pdfbnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
PPT
Operating System 2
PDF
System Structure Notes : comprehensive study
PPTX
OS SERVICES.pptxJGHHHHHHHHHHHHHHHHGGGGGGGG
PDF
osunit1ppt-23011904470yuoij4-685c22ef.pdf
PPTX
OS UNIT 1 PPT.pptx
PPTX
MODULE-1_Operating System Services - ppt
PPTX
Chapter 1 - Operating Systems Introduction.pptx
PDF
2 operating system structures
PDF
Operating systems system structures
PPT
Introduction to System Calls
PPTX
Lecture 1 Introduction to operating systems.pptx
PDF
this book is all about operating sys.pdf
PPTX
Operating System Module 1 Session 6.pptx
Operating-System Structures
Design Of Operating System_Lecture_OS_2.pptx
MELJUN CORTES operating_system_structure
Chapter 2 - Operating System Structures
OS - Ch2
02_os_structures.pdfbnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Operating System 2
System Structure Notes : comprehensive study
OS SERVICES.pptxJGHHHHHHHHHHHHHHHHGGGGGGGG
osunit1ppt-23011904470yuoij4-685c22ef.pdf
OS UNIT 1 PPT.pptx
MODULE-1_Operating System Services - ppt
Chapter 1 - Operating Systems Introduction.pptx
2 operating system structures
Operating systems system structures
Introduction to System Calls
Lecture 1 Introduction to operating systems.pptx
this book is all about operating sys.pdf
Operating System Module 1 Session 6.pptx
Ad

More from Harika Pudugosula (20)

PPTX
Artificial Neural Networks_Part-2.pptx
PPTX
Artificial Neural Networks_Part-1.pptx
PPTX
Introduction.pptx
PDF
CPU Scheduling Part-III.pdf
PDF
CPU Scheduling Part-II.pdf
PDF
CPU Scheduling Part-I.pdf
PDF
Multithreaded Programming Part- III.pdf
PDF
Multithreaded Programming Part- II.pdf
PDF
Multithreaded Programming Part- I.pdf
PDF
Deadlocks Part- III.pdf
PDF
Deadlocks Part- II.pdf
PDF
Deadlocks Part- I.pdf
PDF
Memory Management Strategies - IV.pdf
PDF
Memory Management Strategies - III.pdf
PDF
Memory Management Strategies - II.pdf
PDF
Memory Management Strategies - I.pdf
PDF
Virtual Memory Management Part - II.pdf
PDF
Virtual Memory Management Part - I.pdf
PDF
Operating System Structure Part-II.pdf
PDF
Lecture-4_Process Management.pdf
Artificial Neural Networks_Part-2.pptx
Artificial Neural Networks_Part-1.pptx
Introduction.pptx
CPU Scheduling Part-III.pdf
CPU Scheduling Part-II.pdf
CPU Scheduling Part-I.pdf
Multithreaded Programming Part- III.pdf
Multithreaded Programming Part- II.pdf
Multithreaded Programming Part- I.pdf
Deadlocks Part- III.pdf
Deadlocks Part- II.pdf
Deadlocks Part- I.pdf
Memory Management Strategies - IV.pdf
Memory Management Strategies - III.pdf
Memory Management Strategies - II.pdf
Memory Management Strategies - I.pdf
Virtual Memory Management Part - II.pdf
Virtual Memory Management Part - I.pdf
Operating System Structure Part-II.pdf
Lecture-4_Process Management.pdf
Ad

Recently uploaded (20)

DOCX
573137875-Attendance-Management-System-original
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Welding lecture in detail for understanding
PPTX
Construction Project Organization Group 2.pptx
PPT
Project quality management in manufacturing
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
web development for engineering and engineering
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Well-logging-methods_new................
PPTX
Geodesy 1.pptx...............................................
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
573137875-Attendance-Management-System-original
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Welding lecture in detail for understanding
Construction Project Organization Group 2.pptx
Project quality management in manufacturing
Foundation to blockchain - A guide to Blockchain Tech
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
R24 SURVEYING LAB MANUAL for civil enggi
bas. eng. economics group 4 presentation 1.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
web development for engineering and engineering
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Well-logging-methods_new................
Geodesy 1.pptx...............................................
Model Code of Practice - Construction Work - 21102022 .pdf

Operating System Structure Part-I.pdf

  • 1. Amrita School of Engineering, Bangalore Ms. Harika Pudugosula Teaching Assistant Department of Electronics & Communication Engineering
  • 2. • Operating System Services • User and Operating System Interface • System Calls • Types of System Calls • System Programs • Operating System Structure 2
  • 3. Objectives • To describe the services an operating system provides to users, processes, and other systems • To discuss the various ways of structuring an operating system • To explain how operating systems are installed and customized and how they boot 3
  • 4. Operating System Services • Operating systems provide an environment for execution of programs and services to programs and users • One set of operating-system services provides functions that are helpful to the user: – User interface - Almost all operating systems have a user interface (UI). • Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch interface – Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error) – I/O operations - A running program may require I/O, which may involve a file or an I/O device 4
  • 5. 5 fig: A view of Operating System Services
  • 6. Cont.. • One set of operating-system services provides functions that are helpful to the user (Cont.): – File-system manipulation - The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management. – 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 • May occur in the CPU and memory hardware, in I/O devices, in user program • For each type of error, OS should take the appropriate action to ensure correct and consistent computing • Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use the system 6
  • 7. • Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing – Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them • Many types of resources - CPU cycles, main memory, file storage, I/O devices. – Accounting - To keep track of which users use how much and what kinds of computer resources – Protection and security - The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other • Protection involves ensuring that all access to system resources is controlled • Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts 7 Cont..
  • 8. User Operating System Interface - CLI CLI or command interpreter allows direct command entry – Sometimes implemented in kernel, sometimes by systems program – Sometimes multiple command implemented – shells – The main function of the command interpreter is to get and execute the next user-specified command • Primarily fetches a command from user and executes it – Two approaches that OS executes a task • the command interpreter itself contains the code to execute the command • OS implements most commands through system programs – Example: a command to delete a file naming file.txt – Sometimes commands built-in, sometimes just names of programs • If the latter, adding new features doesn’t require shell modification 8
  • 9. Bourne Shell Command Interpreter 9
  • 10. User Operating System Interface - GUI • User-friendly desktop metaphor 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) – Invented at Xerox PARC • 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 – Unix and Linux have CLI with optional GUI interfaces (CDE, KDE, GNOME) 10
  • 11. Touchscreen Interfaces n Touchscreen devices require new interfaces l Mouse not possible or not desired l Actions and selection based on gestures l Virtual keyboard for text entry l Voice commands. 11
  • 12. The Mac OS X GUI 12
  • 13. System Calls • System calls provide an interface to the services made available by an operating system • Typically written in a high-level language (C or C++) • Application developers design programs according to an application programming interface (API). • The API specifies a set of functions that are available to an application programmer, including the parameters that are passed to each function and the return values the programmer can expect. • Mostly accessed by programs via a high-level Application Programming Interface (API) rather than direct system call use • Three most common APIs are – Windows API for Windows System – POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and – Java API for the Java virtual machine (JVM) • Each operating system has its own name for each system call 13
  • 14. 14 Example: Copy contents of one file to another file
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19. 19 fig: Example of how system calls are used
  • 20. 20
  • 21. System Call Implementation • Typically, a number associated with each system call – System-call interface maintains a table indexed according to these numbers • The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values • The caller need know nothing about how the system call is implemented – Just needs to obey API and understand what OS will do as a result call – Most details of OS interface hidden from programmer by API • Managed by run-time support library (set of functions built into libraries included with compiler) 21
  • 22. API – System Call – OS Relationship 22 fig: The handling of a user application invoking the open() system call
  • 23. System Call Parameter Passing • Often, more information is required than simply identity of desired system call – Exact type and amount of information vary according to OS and call • Three general methods used to pass parameters to the OS – Simplest: pass the parameters in registers • In some cases, may be more parameters than registers – Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register • This approach taken by Linux and Solaris – Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system – Block and stack methods do not limit the number or length of parameters being passed 23
  • 25. 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 – Dump memory if error – Debugger for determining bugs, single step execution – Locks for managing access to shared data between processes 25
  • 26. Types of System Calls (Cont.) • File management – create file, delete file – open, close file – read, write, reposition – get and set file attributes • Device management – request device, release device – read, write, reposition – get device attributes, set device attributes – logically attach or detach devices 26
  • 27. Types of System Calls (Cont.) • 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 if message passing model to host name or process name • From client to server – Shared-memory model create and gain access to memory regions – transfer status information – attach and detach remote devices 27
  • 28. • Protection – Control access to resources – Get and set permissions – Allow and deny user access 28 Types of System Calls (Cont.)
  • 29. Examples of Windows and Unix System Calls 29
  • 30. Standard C Library Example • C program invoking printf() library call, which calls write() system call 30
  • 31. Example: MS-DOS • Single-tasking • Shell invoked when system booted • Simple method to run program – No process created • Single memory space • Loads program into memory, overwriting all but the kernel • Program exit -> shell reloaded At system startup running a program 31
  • 32. Example: FreeBSD • Unix variant • Multitasking • User login -> invoke user’s choice of shell • Shell executes fork() system call to create process – Executes exec() to load program into process – Shell waits for process to terminate or continues with user commands • Process exits with: – status code = 0 – no error – status code > 0 – error code 32
  • 33. System Programs • System programs provide a convenient environment for program development and execution. They can be divided into: – File manipulation – Status information sometimes stored in a File modification – Programming language support – Program loading and execution – Communications – Background services – Application programs • Most users’ view of the operation system is defined by system programs, not the actual system calls 33
  • 34. System Programs • Provide a convenient environment for program development and execution – Some of them are simply user interfaces to system calls; others are considerably more complex • File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories • Status information – Some ask the system for info - date, time, amount of available memory, disk space, number of users – Others provide detailed performance, logging, and debugging information – Typically, these programs format and print the output to the terminal or other output devices – Some systems implement a registry - used to store and retrieve configuration information 34
  • 35. System Programs (Cont.) • File modification – Text editors to create and modify files – Special commands to search contents of files or perform transformations of the text • Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided • Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language • Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems – Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, transfer files from one machine to another 35
  • 36. System Programs (Cont.) • Background Services – Launch at boot time • Some for system startup, then terminate • Some from system boot to shutdown – Provide facilities like disk checking, process scheduling, error logging, printing – Run in user context not kernel context – Known as services, subsystems, daemons • Application programs – Don’t pertain to system – Run by users – Not typically considered part of OS – Launched by command line, mouse click, finger poke 36
  • 37. 37 References 1. Silberscatnz and Galvin, “Operating System Concepts,” Ninth Edition, John Wiley and Sons, 2012.