SlideServe
Menu
Préférences
© SlideServe · v2026

Understanding Operating System Services and Structure in CSCI-4210

nigel avatar
15 diapositives · 311 Views · Jul 26, 2014

This document provides an overview of key concepts in operating system services and architecture from CSCI-4210, taught by Dr. David Goldschmidt. It covers crucial services provided by operating systems such as program execution, I/O operations, and file system manipulation, as well as inter-process communication (IPC) methods. Additionally, it explores the layered structure of operating systems, user and kernel modes, and the use of Application Program Interfaces (APIs) for system calls. A programming exercise is included to illustrate caching concepts and function implementations in C.

Understanding Operating System Services and Structure in CSCI-4210 - slide 1
01 / 15Understanding Operating System Services and Structure in CSCI-4210
1 / 17

Télécharger la présentation

Understanding Operating System Services and Structure in CSCI-4210
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D. Operating Systems{week 02}

  2. Operating system services (i) • An operating system provides services: • Program execution • Load programs into memory, run/suspend/halt programs, handle/display errors • I/O operations • Seamlessly interact with I/O devices, includingdisks, networks connection, etc. • Filesystem manipulation • Read/write/traverse filesystem directories,read/write files, enforce permissions, search for files

  3. Operating system services (ii) • Other operating system services: • Inter-Process Communications (IPC) • Processes exchange information via shared memory,message passing, sockets, pipes, files, etc. • Often spans multiple computers and networks • Error detection and recovery • Detect errors in CPU, memory, I/O devices,processes, network connections, etc. • Recover from errors gracefully,ensuring correct and consistent operations

  4. Operating system structure (i) • Using a layered approach, the operating system is divided into Nlevels or layers • Layer 0 is the hardware • Layer 1 is often the kernel • Layer N is the top-leveluser interface (GUI) • Each layer uses functionsand services of the layer(or layers) beneath it

  5. Operating system structure (ii) • Also viewas a stackof services

  6. Operating system kernel • The core program running inan operating system is calledthe kernel • When a computer is switched on,a bootstrap program executes from ROM • The bootstrap program initializes the system, then loads the operating system kernel and starts its execution

  7. User and kernel modes (i) • Program instructions run eitherin user mode or in kernel mode • Kernel mode allows the operating systemto protect itself and its system components switch modesvia system calls

  8. User and kernel modes (ii) • Kernel gives control to a user process, but may set a timer to ensure a process does not run beyond its allotted time • To avoid infinite loops, memoryleaks, memory hogs, etc. • Not always effective in practice... • Can you stop a runaway processbefore your computer crashes? Aaaaaaaugghhhh!I’m going to takethis computer and...

  9. System calls via APIs (i) • OS services are available via system calls • System calls are made via an interface calledan Application Program Interface (API) • Common operating system APIs: • Win32 API for Windows • POSIX API for POSIX-based systems,including UNIX, Linux, Mac OS X • Java API for Java Virtual Machine • C/C++ Standard Library

  10. System calls via APIs (ii) • Types of system calls include: • Process control (e.g. start/suspend/stop a process) • Debugging information, too • File management • Device management • Information retrieval and maintenance • Current date/time, number of current users, OS version, amount of free memory, process information, etc. • Communications (e.g. IPC, network)

  11. System calls via APIs (iii) • An API hides the implementation details of the underlying operating system • Programmers just need to abide bythe API specifications • How do we change the API orthe operating system servicesthat it offers? the dude abides...

  12. System calls via APIs (iv)

  13. System calls via APIs (v) • Example using the printf()function from C • One API may callanother, which mayin turn call another,and so on...

  14. System calls via APIs (vi) • Use registers to pass parameters: • Store memory location X that references a block of data somewhere in memory

  15. Programming exercise This better work in C • Implement a program to simulate caching: • Write a function called calculateAnswer() that takes integer n as input and calculates (and returns)the sum (1 + 2 + … + n) • Pretend this method is computationally costly! • Initially, the cache (holds only 11 elements) is empty • Ask the user to input a number in range 1..100 • If the answer is not in the cache, call calculateAnswer() and display the resulting sum; store the result in the cache • If the answer is in the cache, simply display the answer