SlideShare a Scribd company logo
1 of 18
Operating services
Operating System provides services to both the users and to the
programs.
1)It provides programs an environment to execute.
2)It provides users the services to execute the programs in a
convenient manner.
Important services provided by an operating system −
• User interface
• Program execution
• I/O operations
• File System manipulation
• Communication
• Error Detection
• Resource Allocation
• Protection
• User interface(UI):
Almost all operating systems have a user interface
• command-line interface(CLI):
which uses text commands and a method for
entering them (say, a program to allow entering and
editing of commands).
• Batch interface, in which commands and
directives to control those commands are entered
into files, and those files are executed.
• Graphical user interface (GUI) :Here, the interface
is a window system with a pointing device to direct
I/O, choose from menus,icons, desktops and make
selections and a keyboard to enter text. Some
systems provide two or all three of these variations.
• Program execution. The system must be able to load a program
into memory and to run that program. The program must be able to
end its 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. For specific devices, special functions
may be desired (such as recording to a CD or DVD drive or blanking a
display screen). For efficiency and protection, users usually cannot
control I/O devices directly. Therefore, the operating system must
provide a means to do I/O.
• File-system manipulation. The file system is of particular interest.
Obviously, programs need to read and write files and directories.
They also need to create and delete them by name, search for a
given file, and list file information. Finally, some programs include
permissions management to allow or deny access to files or
directories based on file ownership. Many operating systems provide
a variety of file systems, sometimes to allow
personal choice, and sometimes to provide specific features or
• Communications.
There are many circumstances in which one process needs to
exchange information with another process. Such communication
may occur between processes that are executing on the same
computer or between processes that are executing on different
computer systems tied together by a computer network.
Communications may be implemented via shared memory or
through message passing, in which packets of information are
moved between processes by the operating system.
• Communications.
There are many circumstances in which one process needs to
exchange information with another process. Such communication
may occur between processes that are executing on the same
computer or between processes that are executing on different
computer systems tied together by a computer network.
Communications may be implemented via shared memory or
through message passing, in which packets of information are
moved between processes by the operating system.
• Error detection.
The operating system needs to be constantly aware of possible
errors. Errors may occur in the CPU and memory hardware (such as a
memory error or a power failure), in I/O devices (such as a parity
error on tape, a connection failure on a network, or lack of paper in
the printer),
and in the user program (such as an arithmetic overflow, an attempt
to access an illegal memory location, or a too-great use of CPU time).
For each type of error, the operating system should take the
appropriate action to ensure correct and consistent computing. Of
course, there is variation in how operating systems react to and
correct errors. Debugging facilities can greatly enhance the user’s
and programmer’s abilities to use the system efficiently.
Another set of operating-system functions exists not for helping the
user but rather for ensuring the efficient operation of the system
itself
• Resource allocation. When there are multiple users or multiple
jobs running at the same time, resources must be allocated to each
of them. Many different types of resources are managed by the
operating system. Some (such as CPU cycles, main memory, and file
storage) may have special allocation code,whereas others (such as
I/O devices) may have much more general request and release code.
For instance, in determining how best to use the CPU, operating
systems have CPU-scheduling routines that take into
account the speed of the CPU, the jobs that must be executed, the
number of registers available, and other factors. There may also be
routines to allocate printers, modems, USB storage drives, and other
peripheral devices.
• Accounting.
We want to keep track of which users use how much and what kinds
of computer resources. This record keeping may be used for
accounting (so that users can be billed) or simply for accumulating
usage statistics. Usage statistics may be a valuable tool for
researchers who wish to reconfigure the system to improve
computing services.
• Protection and security
The owners of information stored in a multiuser or networked
computer system may want to control use of that information.
When several separate processes execute concurrently, it should not
be possible for one process to interfere with the others or with the
operating system itself. Protection involves ensuring that all access
to system resources is controlled. Security of the system from
outsiders is also important. Such security starts with requiring each
user to authenticate himself or herself to the system, usually by means of a
password, to gain access to system resources. It extends to defending external I/O
devices, including modems and network adapters, from invalid access attempts
• In computing, a system call is the programmatic way in which a
computer program requests a service from the kernel of the operating
system it is executed on. A system call is a way for programs to interact
with the operating system. A computer program makes a system call
when it makes a request to the operating system’s kernel. System
call provides the services of the operating system to the user programs
via Application Program Interface(API). It provides an interface
between a process and operating system to allow user-level processes
to request services of the operating system. System calls are the only
entry points into the kernel system. All programs needing resources
must use system calls.
Services Provided by System Calls :
• Process creation and management
• Main memory management
• File Access, Directory and File system management
• Device handling(I/O)
• Protection
• Networking, etc.
(Note that the system-call names used throughout this text are
generic)
Example of System Calls
• System call sequence to copy the contents of
one file to another file
System call
In order to ensure the proper execution of the operating system, we must be
able to distinguish between the execution of operating-system code and user
defined code.
• User mode and kernel mode
– Mode bit provided by hardware
– Provides ability to distinguish when system is running user code or
kernel code.
– When a user is running  mode bit is “user”
– When kernel code is executing  mode bit is “kernel”
– System call changes mode to kernel, return from call resets it to user
– Some instructions designated as privileged, only executable in kernel
mode
Most programmers never see this level of detail, however. Typically, 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. Behind the scenes,
the functions that make up an API typically invoke the actual system calls on
behalf of the application programmer. For example, the Win32 function
CreateProcess() (whichunsurprisingly is used to create a new process) actually
calls the NTCreateProcess () system call in the Windows kernel.
The system-call interface intercepts function calls in the API and invokes the
necessary system calls within the operating system. Typically, a number is
associated with each system call, and the system-call interface maintains a table
indexed according to these numbers. The system call interface
then invokes the intended system call in the operating-system kernel and returns
the status of the system call and any return values
The caller need know nothing about how the system call is implemented or
what it does during execution. Rather, it need only obey the API and understand
what the operating system will do as a result of the execution of that system
call. Thus, most of the details of the operating-system interface are hidden from
the programmer by the API and are managed by the run-time support library
Example of Standard API
• Consider the ReadFile() function in the
• Win32 API—a function for reading from a file
• A description of the parameters passed to ReadFile()
– HANDLE file—the file to be read
– LPVOID buffer—a buffer where the data will be read into and written from
– DWORD bytesToRead—the number of bytes to be read into the buffer
– LPDWORD bytesRead—the number of bytes read during the last read
– LPOVERLAPPED ovl—indicates if overlapped I/O is being used
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 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)
API – System Call – OS Relationship
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
Parameter Passing via Table
Types of System Calls
• Process control
• File management
• Device management
• Information maintenance
• Communications

More Related Content

Similar to chapter2.pptx

Lecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating SystemsLecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating SystemsArnoyKhan
 
OS - Ch2
OS - Ch2OS - Ch2
OS - Ch2sphs
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresWayne Jones Jnr
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System StructuresCloudbells.com
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Amit Gupta
 
Services and system calls
Services and system callsServices and system calls
Services and system callssangrampatil81
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsMeenalJabde
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfnikhil287188
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdfHarika Pudugosula
 
Operating Systems
Operating SystemsOperating Systems
Operating Systemsvampugani
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfFahanaAbdulVahab
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating SystemDivya S
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.pptdivyang32
 

Similar to chapter2.pptx (20)

Lecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating SystemsLecture_02_Operating System Structures Operating Systems
Lecture_02_Operating System Structures Operating Systems
 
Os unit i
Os unit iOs unit i
Os unit i
 
OS - Ch2
OS - Ch2OS - Ch2
OS - Ch2
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Os unit 1(cont)
Os unit 1(cont)Os unit 1(cont)
Os unit 1(cont)
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System Structures
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]
 
Services and system calls
Services and system callsServices and system calls
Services and system calls
 
Operating System
Operating SystemOperating System
Operating System
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System Concepts
 
CH02.pdf
CH02.pdfCH02.pdf
CH02.pdf
 
Unit I OS CS.ppt
Unit I OS CS.pptUnit I OS CS.ppt
Unit I OS CS.ppt
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
Operating System Structure Part-I.pdf
Operating System Structure Part-I.pdfOperating System Structure Part-I.pdf
Operating System Structure Part-I.pdf
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.ppt
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 

chapter2.pptx

  • 1. Operating services Operating System provides services to both the users and to the programs. 1)It provides programs an environment to execute. 2)It provides users the services to execute the programs in a convenient manner. Important services provided by an operating system − • User interface • Program execution • I/O operations • File System manipulation • Communication • Error Detection • Resource Allocation • Protection
  • 2. • User interface(UI): Almost all operating systems have a user interface • command-line interface(CLI): which uses text commands and a method for entering them (say, a program to allow entering and editing of commands). • Batch interface, in which commands and directives to control those commands are entered into files, and those files are executed. • Graphical user interface (GUI) :Here, the interface is a window system with a pointing device to direct I/O, choose from menus,icons, desktops and make selections and a keyboard to enter text. Some systems provide two or all three of these variations.
  • 3. • Program execution. The system must be able to load a program into memory and to run that program. The program must be able to end its 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. For specific devices, special functions may be desired (such as recording to a CD or DVD drive or blanking a display screen). For efficiency and protection, users usually cannot control I/O devices directly. Therefore, the operating system must provide a means to do I/O. • File-system manipulation. The file system is of particular interest. Obviously, programs need to read and write files and directories. They also need to create and delete them by name, search for a given file, and list file information. Finally, some programs include permissions management to allow or deny access to files or directories based on file ownership. Many operating systems provide a variety of file systems, sometimes to allow personal choice, and sometimes to provide specific features or
  • 4. • Communications. There are many circumstances in which one process needs to exchange information with another process. Such communication may occur between processes that are executing on the same computer or between processes that are executing on different computer systems tied together by a computer network. Communications may be implemented via shared memory or through message passing, in which packets of information are moved between processes by the operating system.
  • 5. • Communications. There are many circumstances in which one process needs to exchange information with another process. Such communication may occur between processes that are executing on the same computer or between processes that are executing on different computer systems tied together by a computer network. Communications may be implemented via shared memory or through message passing, in which packets of information are moved between processes by the operating system.
  • 6. • Error detection. The operating system needs to be constantly aware of possible errors. Errors may occur in the CPU and memory hardware (such as a memory error or a power failure), in I/O devices (such as a parity error on tape, a connection failure on a network, or lack of paper in the printer), and in the user program (such as an arithmetic overflow, an attempt to access an illegal memory location, or a too-great use of CPU time). For each type of error, the operating system should take the appropriate action to ensure correct and consistent computing. Of course, there is variation in how operating systems react to and correct errors. Debugging facilities can greatly enhance the user’s and programmer’s abilities to use the system efficiently.
  • 7. Another set of operating-system functions exists not for helping the user but rather for ensuring the efficient operation of the system itself • Resource allocation. When there are multiple users or multiple jobs running at the same time, resources must be allocated to each of them. Many different types of resources are managed by the operating system. Some (such as CPU cycles, main memory, and file storage) may have special allocation code,whereas others (such as I/O devices) may have much more general request and release code. For instance, in determining how best to use the CPU, operating systems have CPU-scheduling routines that take into account the speed of the CPU, the jobs that must be executed, the number of registers available, and other factors. There may also be routines to allocate printers, modems, USB storage drives, and other peripheral devices.
  • 8. • Accounting. We want to keep track of which users use how much and what kinds of computer resources. This record keeping may be used for accounting (so that users can be billed) or simply for accumulating usage statistics. Usage statistics may be a valuable tool for researchers who wish to reconfigure the system to improve computing services. • Protection and security The owners of information stored in a multiuser or networked computer system may want to control use of that information. When several separate processes execute concurrently, it should not be possible for one process to interfere with the others or with the operating system itself. Protection involves ensuring that all access to system resources is controlled. Security of the system from outsiders is also important. Such security starts with requiring each user to authenticate himself or herself to the system, usually by means of a password, to gain access to system resources. It extends to defending external I/O devices, including modems and network adapters, from invalid access attempts
  • 9. • In computing, a system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. A system call is a way for programs to interact with the operating system. A computer program makes a system call when it makes a request to the operating system’s kernel. System call provides the services of the operating system to the user programs via Application Program Interface(API). It provides an interface between a process and operating system to allow user-level processes to request services of the operating system. System calls are the only entry points into the kernel system. All programs needing resources must use system calls. Services Provided by System Calls : • Process creation and management • Main memory management • File Access, Directory and File system management • Device handling(I/O) • Protection • Networking, etc. (Note that the system-call names used throughout this text are generic)
  • 10. Example of System Calls • System call sequence to copy the contents of one file to another file
  • 11. System call In order to ensure the proper execution of the operating system, we must be able to distinguish between the execution of operating-system code and user defined code. • User mode and kernel mode – Mode bit provided by hardware – Provides ability to distinguish when system is running user code or kernel code. – When a user is running  mode bit is “user” – When kernel code is executing  mode bit is “kernel” – System call changes mode to kernel, return from call resets it to user – Some instructions designated as privileged, only executable in kernel mode
  • 12. Most programmers never see this level of detail, however. Typically, 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. Behind the scenes, the functions that make up an API typically invoke the actual system calls on behalf of the application programmer. For example, the Win32 function CreateProcess() (whichunsurprisingly is used to create a new process) actually calls the NTCreateProcess () system call in the Windows kernel. The system-call interface intercepts function calls in the API and invokes the necessary system calls within the operating system. Typically, a number is associated with each system call, and the system-call interface maintains a table indexed according to these numbers. The system call interface then invokes the intended system call in the operating-system kernel and returns the status of the system call and any return values The caller need know nothing about how the system call is implemented or what it does during execution. Rather, it need only obey the API and understand what the operating system will do as a result of the execution of that system call. Thus, most of the details of the operating-system interface are hidden from the programmer by the API and are managed by the run-time support library
  • 13. Example of Standard API • Consider the ReadFile() function in the • Win32 API—a function for reading from a file • A description of the parameters passed to ReadFile() – HANDLE file—the file to be read – LPVOID buffer—a buffer where the data will be read into and written from – DWORD bytesToRead—the number of bytes to be read into the buffer – LPDWORD bytesRead—the number of bytes read during the last read – LPOVERLAPPED ovl—indicates if overlapped I/O is being used
  • 14. 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 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)
  • 15. API – System Call – OS Relationship
  • 16. 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
  • 18. Types of System Calls • Process control • File management • Device management • Information maintenance • Communications