Bootable Programs Building an O/S. Basic Requirements of any O/S Respond to interrupts (all kinds) Preserve user environment Protect users and self from.

Slides:



Advertisements
Similar presentations
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.
Advertisements

CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Operating System Structure
The Kernel Abstraction. Challenge: Protection How do we execute code with restricted privileges? – Either because the code is buggy or if it might be.
Chapter 6 Limited Direct Execution
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Build an Operating System
Exceptions, Interrupts & Traps
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Computer Organization
System Calls 1.
Welcome to the World of Nachos CPS 110 Spring 2004 Discussion Session 1.
Protection and the Kernel: Mode, Space, and Context.
80386DX.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
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.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Chapter 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Operating Systems 1 K. Salah Module 2.0: Processes Process Concept Trace of Processes Process Context Context Switching Threads –ULT –KLT.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
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 CSE 451 Section 2: Interrupts, Syscalls, Virtual Machines, and Project 1.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
© 2004, D. J. Foreman 1 Implementing Processes and Threads.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
University of Pennsylvania 9/12/00CSE 3801 Processes, Interrupts, and System Calls CSE 380 Lecture Note 2 Insup Lee.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
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.
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 2. System Structures
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
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.
© D. J. Foreman, Structure of an O/S. © D. J. Foreman, Overview  Required functionality –Handle interrupts –Manage resources Processes.
Introduction to Operating Systems Concepts
Bare metal OS project CSSE 332 Operating Systems
Processes and threads.
Process concept.
Interrupts and signals
Memory Protection: Kernel and User Address Spaces
CS 3305 System Calls Lecture 7.
Intro to Processes CSSE 332 Operating Systems
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Lecture Topics: 11/1 General Operating System Concepts Processes
Operating Systems Lecture 3.
Modern PC operating systems
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Memory Protection: Kernel and User Address Spaces
Presentation transcript:

Bootable Programs Building an O/S

Basic Requirements of any O/S Respond to interrupts (all kinds) Preserve user environment Protect users and self from corruption Handle I/O errors Handle user errors

Responding to ANY interrupt Hardware loads a pre-defined state vector – Context switch occurs – NSI is inside kernel at primary interrupt handler Primary handler determines type of interrupt – I/O completion – Service call – Program error – Paging/addressing exception Save user’s environment (stack, registers) in process’s PCB or thread’s TCB Branch to detail interrupt handler

Detail interrupt handler Take required action – All instructions valid – Must not cause another interrupt Therefore must not do I/O - one exception: – Handling I/O errors may require I/O to device – Interrupt for this 2ndary I/O must be deleted Must allow for all possible (and improbable) errors Return to common return point

Common return to user Determine next thread/process to run – New user – Interrupted user Locate PCB/TCB for selected user Prep state vector, could be: – Old vector (in reserved RAM) from previously interrupted program – New vector data determined for a new program Save kernel’s registers in reserved storage Restore user’s registers & stack from PCB/TCB Load prepared state vector for user Context switch occurs

SOS A Small Operating System “built-in” user command-line shell Written in z/390 assembler language – 32-bit mode – Runs in a z/390 virtual machine You will – Modify it to provide service call handling – Install it as a bootable program – Boot it – Test it

SOS – bootable drive Virtual device at address 222 Preformatted as a CMS disk – Simplifies putting programs on the drive – Reserved space for the bootable program (SOS) – Boot loader (IBM supplied) installed by student – Allows seeing disk content from CMS shell

SOS – original contents Device address discovery – Operator’s terminal – Boot drive Locate volume TOC Locates file directory Displays content of directory in hexadecimal Terminates

SOS - Lab 1 Copy the SOSSAMP file to your “a-disk” Rename it to: SOS Assemble it using HLASM Prepare the bootable drive Boot it

SOS – Lab 2 Add “shell” code to the single compile Add state-vector loading to “activate” shell Shell displays your prompt, waits for input Shell issues SVC n in response to input – 0<= n <= 7 – See lab assignment for details SOS gets control and performs service “n” SOS – returns control to shell – loads “terminate” state vector