Operating Systems {week 01.b}

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Operating-System Structures
Operating System Structures
Chap 2 System Structures.
Operating-System Structures
Chapter 2: Operating-System Structures
2: OS Structures 1 Jerry Breecher OPERATING SYSTEMS STRUCTURES.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems CSCI-6140 – Computer Operating Systems David Goldschmidt, Ph.D.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
2.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Overview of topics covered Operating System Services.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Operating-System Structures. Operating System Services Operating systems provide an environment for execution of programs and services to programs and.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Silberschatz, Galvin and Gagne  Operating System Concepts UNIT II Operating System Services.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Chapter 2. System Structures
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
System Components Operating System Services System Calls.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Operating Systems {week 11a}
Chapter 3: Operating-System Structures
Operating System Structures
Topic 2 (Textbook - Chapter 2) Operating-System Structures
Chapter 2: Operating-System Structures
Introduction to threads
Chapter 2:Operating System Structures
Exceptional Control Flow
Chapter 2: Operating-System Structures
Module 3: Operating-System Structures
Introduction to Kernel
2. OPERATING SYSTEM 2.1 Operating System Function
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Operating System.
Lecture 4: Operating System Structures
Chapter 2: System Structures
Operating System Structure
Introduction to Operating System (OS)
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Ch 2 - Overview Interacting with services provided by the OS
Chapter 2: System Structures
Chapter 3: Operating-System Structures
CS703 - Advanced Operating Systems
Chapter 1 Introduction to Operating System Part 5
Outline (Chapters 1 and 2)
Lecture Topics: 11/1 General Operating System Concepts Processes
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Introduction to Operating Systems
Outline Chapter 2 (cont) OS Design OS structure
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
OPERATING SYSTEMS STRUCTURES
System calls….. C-program->POSIX call
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Presentation transcript:

Operating Systems {week 01.b} Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D. Operating Systems {week 01.b}

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, including disks, networks connection, etc. Filesystem manipulation Read/write/traverse filesystem directories, read/write files, enforce permissions, search for files

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

Operating system structure (i) Using a layered approach, the operating system is divided into N levels or layers Layer 0 is the hardware Layer 1 is often the kernel Layer N is the top-level user interface (GUI) Each layer uses functions and services of the layer (or layers) beneath it

Operating system structure (ii) Also view as a stack of services

Operating system kernel The core program running in an operating system is called the 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

User and kernel modes (i) Program instructions run either in user mode or in kernel mode Kernel mode allows the operating system to protect itself and its system components switch modes via system calls

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, memory leaks, memory hogs, etc. Not always effective in practice... Can you stop a runaway process before your computer crashes? Aaaaaaaugghhhh! I’m going to take this computer and...

System calls via APIs (i) OS services are available via system calls System calls are made via an interface called an 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

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)

System calls via APIs (iii) System call sequence for a file copy program:

System calls via APIs (iv) An API hides the implementation details of the underlying operating system Programmers just need to abide by the API specifications How do we change the API or the operating system services that it offers? the dude abides...

System calls via APIs (v)

System calls via APIs (vi) Example using the printf() function from C One API may call another, which may in turn call another, and so on...

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

Programming exercise Implement a program to simulate caching: 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 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