Chapter 8: System Software Part of any computer system is the system software –This is software that supports our use of the computer –We will examine.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Operating System Structures
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Operating System Structure
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
1 Operating Systems and Protection CS Goals of Today’s Lecture How multiple programs can run at once  Processes  Context switching  Process.
OS Spring’03 Introduction Operating Systems Spring 2003.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Computer Organization and Architecture
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Chapter 6: An Introduction to System Software and Virtual Machines
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
System Calls 1.
Protection and the Kernel: Mode, Space, and Context.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
What is an Operating System? The OS is a program – Permit easy access, control hardware, communicate between user and software, user and hardware, software.
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
UNIX Unit 1- Architecture of Unix - By Pratima.
CPSC 171 Introduction to Computer Science System Software and Virtual Machines.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
What is a Process ? A program in execution.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Chapter 8: System Software
Processes and threads.
CS 3305 System Calls Lecture 7.
Introduction to Operating System (OS)
Chapter 8: System Software
OS Virtualization.
Operating Systems.
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Introduction to Operating Systems
Process Description and Control
CSE 153 Design of Operating Systems Winter 2019
Chapter 2: Operating-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Presentation transcript:

Chapter 8: System Software Part of any computer system is the system software –This is software that supports our use of the computer –We will examine some OS topics here, but as this material is covered in detail in CSC 460, we will skip over a lot of it (sections 8.3, ) The original role of the OS was to provide an interface between application software and hardware –The programmer used to have to write the code that interacts with hardware (e.g., printer, disk drive, memory) the OS alleviated the need for the programmer to write this code –Rudimentary OSs were introduced in the 1960s, called resident monitors because the code would always be resident in memory This code would be called upon whenever a new program was to be run or whenever the current program needed system resources Today, the OS not only provides the hardware/software interface, but directly supports the user as a complex interface and resource manager –Read the history in section 8.2.1, but we will skip it in lecture

OS Components The kernel is the core of the OS –It supports the process manager, scheduler, resource manager and I/O manager –It is responsible for scheduling, synchronization, protection/security, memory management and interrupt handling Other elements of the OS are –Shells – the user-specified environment –Utilities – programs usually run by the OS or user to keep the environment reasonably maintained (e.g., antiviral software, disk backup, disk defragmenter, screen saver, file manager) We now examine services providing by the OS

User Interface The interface actually takes on two roles: –Interface between user and hardware How I/O requests are handled –This includes interrupt mechanisms, bus arbitration, protection mechanisms, and so forth –We covered some of this in chapter 7 and won’t go into any more detail here –Interface between user and software How the user commands the system to perform operations whether the commands are to applications software or OS –Today, this is done through a GUI (menus, buttons, icons) –In the past, this was done through command line interpreters and still is common in OSs like Unix/Linux

Process Manager Starting programs upon request –Find executable code in the file system, load into memory –Start the process give process a status and move to appropriate queue Handle scheduling of programs –Process admitted to the system, placed in waiting queue –Process moved to memory, placed in ready queue –Program gets attention by the CPU context switching occurs between processes to move the CPU between processes Terminating the process and freeing its resources Process manager also –Handles interprocess communication –Communicates with other aspects of the OS kernel to track resource usage resource manager file manager memory manager

Resource Management Resources are finite –They include disk/tape drives, memory, CPU, network connection, printer, etc Processes might need more resources than are available –The OS allocates a resource to a process –At that point, the resource is usually dedicated no other process can use the resource until the first process lets go of it this is known as mutually exclusive access – why is it necessary? –This can lead to deadlock where processes hold resources and need other resources currently held by other processes P0 P1 R0 R1 Process P0 currently has access to R0 and needs R1 while Process P1 currently has access to R1 and needs R0 result – deadlock, neither P0 nor P1 are able to continue but neither release their resources!

Synchronization & Atomic Instructions Process manager must synchronize access to shared memory/resources When a process wants access, it issues a request command –if the resource is unavailable, this process moves to a wait queue –once the resource becomes available, the next process in the queue is selected to hold onto the resource We don’t want to interrupt the request command so we make it an atomic instruction (part of the instruction set) –Atomic instructions are non-interruptible even though they perform multiple steps such as “compare-and-swap” and “test- and-lock”

Memory Management, Modes Memory is managed separately from resource management but is another type of resource –Manages virtual memory –Decides how many frames each processor (or user) is given –Allocates memory, should memory be allocated in contiguous blocks? –Memory management also searches for memory violations CPUs typically operate in one of two modes: –User mode only has access to some operations and limited memory space access –Privileged mode (also known as system mode, administrator mode or kernel mode) has access to all operations and memory When in user mode, program instructions may request access to resources/memory –To gain access, the OS must switch modes –Mode is a bit in the status flags

Security and Protection In addition to deadlock, resource sharing leads to the situation where a process wants to use a resource that is owned by another process –Or the user who runs the first process wants to access a resource owned by a different user –Protection mechanisms must be enforced in the OS to make sure that this cannot happen Otherwise, one use could access/erase/alter files owned by another user –Security mechanisms extend this idea of protection to networks so that a user is not able to access resources of the system (including the CPU and memory) unless they have been authorized to do so Through some form of authentication mechanism such as logging in with a private password Without security, systems would be susceptible to illegal access

Assemblers The assembler is a program that translates an assembly program into machine language –Recall that there is a 1-to-1 mapping of assembly language instructions to machine instructions unlike a high level language instruction which might require several to dozens of machine instructions So the assembler’s task is not too difficult –Translate the mnemonic into the appropriate op code –Translate the operands into Addressing mode and addressing specifications Literals into binary equivalence Variable names and Labels into memory locations and/or offsets Compiler the list of variables and functions into a symbol table –What would happen if the assembler places variables and labels into specific memory locations? the program/code would be non-relocatable

Linkers and Loaders When you use library files of functions, those files are pre-assembled/compiled –But your program needs to reference memory locations Where will your code and the library code be placed? It is the job of the linker to make the connections between variables and functions in your program and the library files It is the job of the loader to make the connections between variable names and labels, and memory locations

Compilers Just as with assembly code, a program written in a high-level language must also be translated into machine language –This is the job of the compiler –But the compiler has a much harder job Consider the following code: This is translated into at least 15 Intel assembly instructions! –Usually compilers make multiple passes through a program progressively breaking into smaller chunks resulting eventually in a (possibly optimized) machine language program for(j=0;j<n;j++) if(a[j] > b[j] – k) c[k++] = a[j]; The steps of a compiler

The Run-Time Stack We examine one last system oriented feature –The run-time stack is used to implement function calls for most languages When a function is called, an “activation record instance” is pushed onto the stack This record contains storage space for –All local variables –All parameters –The return address (where to return to when the function terminates) –The return value (if the function returns a value) When a function is called, the OS uses a special register called the Stack Pointer (SP) to determine where this new activation record instance is pushed When the function terminates, the PC is reset to be the return address, the return value is returned to the function/operation that called the function, and the activation record instance is popped off the stack, with the SP adjusted to the new top –NOTE: without the run-time stack, recursion is not possible!

Example