Department of Computer Science

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

Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki CS 547/490 Network.
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.
OS Spring’03 Introduction Operating Systems Spring 2003.
OS Spring’04 Introduction Operating Systems Spring 2004.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
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.
How Hardware and Software Work Together
Chapter 2 (PART 1) Light-Weight Process (Threads) Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki.
CS 312 Computer Architecture Memory Basics Department of Computer Science Southern Illinois University Edwardsville Summer, 2015 Dr. Hiroshi Fujinoki
Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki IPC1.PPT/001 Inter-Process.
Chapter 1 (PART 1) Introduction to OS (concept, evolution, some keywords) Department of Computer Science Southern Illinois University Edwardsville Summer,
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
Operating System Concepts Part II Department of Computer Science Southern Illinois University Edwardsville Spring, 2009 Dr. Hiroshi Fujinoki
12/2/091 What is an Operating System Andy Konwinski CS61CL Dec 2, 2009 Lecture 13 UCB CS61CL F09 Lec 13.
Chapter 1 (PART 2) Operating System Concepts Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Uniprocessor Process Management & Process Scheduling Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
OS Boot Sequence and File System (implication to “Boot Sector Viruses”) Department of Computer Science Southern Illinois University Edwardsville Spring,
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.
Introduction to Operating Systems Concepts
Operating Systems CMPSC 473
CS 286 Computer Organization and Architecture
Mechanism: Limited Direct Execution
Day 08 Processes.
Day 09 Processes.
CS 3305 System Calls Lecture 7.
CS 286 Computer Organization and Architecture
CS 286: Memory Paging and Virtual Memory
CS 286 Computer Organization and Architecture
OS Virtualization.
OPERATING SYSTEMS.
Computer System Overview
System Calls.
Chapter 15, Exploring the Digital Domain
CGS 3763 Operating Systems Concepts Spring 2013
Components of a CPU AS Computing - F451.
CS 286 Computer Organization and Architecture
CS 286 Computer Architecture & Organization
Processes David Ferry CSCI 3500 – Operating Systems
CS 286 Computer Organization and Architecture
Uniprocessor Process Management & Process Scheduling
CS 286 Computer Organization and Architecture
Introduction to OS (concept, evolution, some keywords)
Deadlock Prevention & Avoidance
Software - Operating Systems
Process Synchronization
Real-Time Process Scheduling Concepts, Design and Implementations
Welcome to CS314 Operating Systems A Quick Tour for Introduction to OS
Introduction to OS (concept, evolution, some keywords)
Department of Computer Science
Welcome to CS314 Operating Systems A Quick Tour for Introduction to OS
Process/Code Migration and Cloning
OS Boot Sequence and File System
Department of Computer Science
Operating System Concepts
Threads: Light-Weight Processes
Operating System Concepts
Deadlock Prevention & Avoidance
Real-Time Process Scheduling Concepts, Design and Implementations
Process Synchronization
OS Boot Sequence and File System
Light-Weight Process (Threads)
Uniprocessor Process Management & Process Scheduling
An Introduction to Operating Systems
MIPS R3000 Subroutine Calls and Stack
Presentation transcript:

Department of Computer Science CS 314 Operating Systems TWO Processor Modes USER and KERNEL modes Department of Computer Science Southern Illinois University Edwardsville Spring, 2019 Dr. Hiroshi Fujinoki E-mail: hfujino@siue.edu Two_Processor_Modes/001

CS 314 Operating Systems What are the two processor modes? * Intel calls it “protected mode”  KERNEL (“SYSEM”) mode*  USER mode The mode of a processor in which a processor can execute any instruction (no restriction on the type of instructions) The mode of a processor in which there are restrictions on the type of instructions (listed below) a processor can executes Send a command to an I/O device (printers, hard drives, and etc.) Access (both “read” and “write”) to any memory address in a computer system Activate/disable “hardware interrupts” (“interrupt” discussed in CS286) Kill currently existing processes Many others Two_Processor_Modes/002

CS 314 Operating Systems What are the two processor modes?  KERNEL (“SYSEM”) mode The mode of a processor in which a processor can execute any instruction (no restriction on the type of instructions)  USER mode The mode of a processor in which there are restrictions on the type of instructions (listed below) a processor can executes Processor Mode Flag 1 – KERNEL mode 0 – USER mode Two_Processor_Modes/003

OS performs the requested CS 314 Operating Systems How is the processor mode used?  When a processor is executing an operating system, the processor should be in KERNEL (“SYSEM”) mode  When a processor is executing any user process, the processor should be in USER mode OS performs the requested task in KERNEL mode system call KERNEL MODE USER OS OS OS OS OS user process user process Your process calls “wait” for a semaphore user process context switching user process Your process creates a new file in HDD You start a user process time Your process has data to a printer Your process requests more memory space You power-on your PC Two_Processor_Modes/004

CS 314 Operating Systems How is the processor mode changed? USERKERNEL This jump address can be setup only in the KERNEL mode Hardware Interrupter  USERKERNEL KERNELUSER Jump to a specific memory address (OS) It’s easy to do! system calls Processor 1 Processor  Mode Change OS OS 1 Any system call automatically lets (“forces”) a processor jump to the hardware interrupter User App. Process Processor  Context-switch to the user process Processor User App. Process Two_Processor_Modes/005

CS 314 Operating Systems Conclusions  The USER mode in a processor prohibits user processes from directly accessing hardware resources. Forcing user processes (those running in USER mode) to call the OS (system calls) when user processes need hardware resources. After all, USER/KERNEL modes are the key to keep the OS as the government. Two_Processor_Modes/006