Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application

Similar documents
I/O Devices. Device. Lecture Notes Week 8

Computer Architecture

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

ww.padasalai.net

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Chapter 7. Sequential Circuits Registers, Counters, RAM

vsyscall and vdso Adrien «schischi» Schildknecht vsyscall and vdso March 17, 2014

LSN 15 Processor Scheduling

CMP 338: Third Class

Department of Electrical and Computer Engineering The University of Texas at Austin

NEC PerforCache. Influence on M-Series Disk Array Behavior and Performance. Version 1.0

The conceptual view. by Gerrit Muller University of Southeast Norway-NISE

Simple Instruction-Pipelining (cont.) Pipelining Jumps

CHAPTER 5 - PROCESS SCHEDULING

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address

Generate i/o load on your vm and use iostat to demonstrate the increased in i/o

GPU Acceleration of Cutoff Pair Potentials for Molecular Modeling Applications

Part I. System call overview. Secure Operating System Design and Implementation System Calls. Overview. Abstraction. Jon A. Solworth.

ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

VMware VMmark V1.1 Results

ALU A functional unit

Last class: Today: Threads. CPU Scheduling

CprE 281: Digital Logic

COMPUTER SCIENCE TRIPOS

CMPEN 411 VLSI Digital Circuits Spring Lecture 21: Shifters, Decoders, Muxes

Lecture 2: Metrics to Evaluate Systems

Scheduling I. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Advanced topics on scheduling

ISSP User Guide CY3207ISSP. Revision C

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

SOFTWARE USER MANUAL. Weather Capture Advance WS1640 WM9280

CSE 380 Computer Operating Systems

Lecture Notes Week 4. Once the CPU is up and running, the routine scheduler() is never called again except in the routine sched().

TDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.

Parallel Numerics. Scope: Revise standard numerical methods considering parallel computations!

Lecture 1. How to Boot a PC. Andrei Pitiș. October 8, Operating Systems Practical. OSP Lecture 1, Booting 1/30

Databases through Python-Flask and MariaDB

Automata Theory CS S-12 Turing Machine Modifications

Lab Course: distributed data analytics

Implementing Absolute Addressing in a Motorola Processor (DRAFT)

Announcements. Project #1 grades were returned on Monday. Midterm #1. Project #2. Requests for re-grades due by Tuesday

CPU Scheduling. CPU Scheduler

Timeline of a Vulnerability

Process Scheduling. Process Scheduling. CPU and I/O Bursts. CPU - I/O Burst Cycle. Variations in Bursts. Histogram of CPU Burst Times

CSE370: Introduction to Digital Design

Virtualization. Introduction. G. Lettieri A/A 2014/15. Dipartimento di Ingegneria dell Informazione Università di Pisa. G. Lettieri Virtualization

PERFORMANCE METRICS. Mahdi Nazm Bojnordi. CS/ECE 6810: Computer Architecture. Assistant Professor School of Computing University of Utah

Scheduling I. Today Introduction to scheduling Classical algorithms. Next Time Advanced topics on scheduling

Project Two RISC Processor Implementation ECE 485

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

NINE CHOICE SERIAL REACTION TIME TASK

SimpleDreamEQ2. Upgrade kit equatorial mounts Synta EQ2, Celestron CG3. User guide. Micro GoTo system. Micro GoTo system

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

CPU SCHEDULING RONG ZHENG

High Performance Computing

*** SAMPLE ONLY! The actual NASUNI-FILER-MIB file can be accessed through the Filer address>/site_media/snmp/nasuni-filer-mib ***

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

Basic Computer Organization and Design Part 3/3

Worst-Case Execution Time Analysis. LS 12, TU Dortmund

An Automotive Case Study ERTSS 2016

Figure 4.9 MARIE s Datapath

Performance Metrics for Computer Systems. CASS 2018 Lavanya Ramapantulu

On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work

Computer Engineering Department. CC 311- Computer Architecture. Chapter 4. The Processor: Datapath and Control. Single Cycle

Socket Programming. Daniel Zappala. CS 360 Internet Programming Brigham Young University

CMPEN 411 VLSI Digital Circuits Spring Lecture 19: Adder Design

CSCI-564 Advanced Computer Architecture

Simulation of Process Scheduling Algorithms

Orbit Support Pack for Excel. user manual

Lecture 16 More Profiling: gperftools, systemwide tools: oprofile, perf, DTrace, etc.

TSCCLOCK: A LOW COST, ROBUST, ACCURATE SOFTWARE CLOCK FOR NETWORKED COMPUTERS

GIS = Geographic Information Systems;

Assignment 4: Object creation

Grabber. Technical Manual

Enrico Nardelli Logic Circuits and Computer Architecture

Weather Research and Forecasting (WRF) Performance Benchmark and Profiling. July 2012

Software BioScout-Calibrator June 2013

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

CIS 4930/6930: Principles of Cyber-Physical Systems

Overlay Transport Virtualization (OTV) Unicast-Mode Transport Infrastructure Deployment

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

GPS Mapping with Esri s Collector App. What We ll Cover

Computer Architecture

Laboratory Exercise #11 A Simple Digital Combination Lock

Unit 6: Branch Prediction

Lecture 19. Architectural Directions

Time. To do. q Physical clocks q Logical clocks

! Charge Leakage/Charge Sharing. " Domino Logic Design Considerations. ! Logic Comparisons. ! Memory. " Classification. " ROM Memories.

Time. Today. l Physical clocks l Logical clocks

CMP N 301 Computer Architecture. Appendix C

Introduction The Nature of High-Performance Computation

Lecture 3, Performance

ECE 448 Lecture 6. Finite State Machines. State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code. George Mason University

CPU scheduling. CPU Scheduling

The Analysis of Microburst (Burstiness) on Virtual Switch

An Overview of HPC at the Met Office

DISTRIBUTED COMPUTER SYSTEMS

CS/IT OPERATING SYSTEMS

FAGOR 8055 CNC Ordering Handbook. Ref. 0801

Transcription:

Administrivia 1. markem/cs333/ 2. Staff 3. Prerequisites 4. Grading Course Objectives 1. Theory and application 2. Benefits 3. Labs TAs Overview 1. What is a computer system? CPU PC ALU System bus Memory bus Bus interface I/O bridge Main memory USB Graphics adapter I/O bus Disk other devices such as network adapters Mouse Keyboard Disk hello executable stored on disk Figure 1: Hardware Model 2. Set of services system calls 3. Privileged program 1

4. Hardware arbitrator 5. Manager of hardware and privileged software operations 6. Abstract virtual machine that provides several useful additional abstractions 1. CPU Instruction sets PC: program counter; IP: instruction pointer IP: instruction register ALU general registers privileged register SP: stack pointer PSW: processor status work; FLAGS: flags register fetch decode execute interrupt 2. Boot process 3. First process 4. Creating new processes 5. Idealized Model Figure 2: Process State Transition Reference Model. 2

6. Executing new programs 7. OS as resource manager How does OS gain control? Can user processes game the system? 8. Traps v. Interrupts Involuntary Interrupt Voluntary Yield interrupt is asynchronous associated with external events time sensitive timer interrupt trap is a synchronous primarily used to access resources within the kernel mode change request for kernel service 9. Context switch Virtualization and Abstraction 1. Isolation is important 2. Virtual processor(s) xv6 has more than one physical 3. VM address space 4. Process abstraction Own processor and address space Cannot see other processes (normally) 5. Memory hierarchy Speed v. cost Caching: MMU/TLB, buffer cache, I/O controller, device (disk) 3

Smaller, faster, and costlier (per byte) storage devices Larger, slower, and cheaper (per byte) storage devices L5: L6: L4: L3: L2: L1: L0: Regs L1 cache (SRAM) L2 cache (SRAM) L3 cache (SRAM) Main memory (DRAM) Local secondary storage (local disks) Remote secondary storage CPU registers hold words retrieved from cache memory. L1 cache holds cache lines retrieved from the L2 cache. L2 cache holds cache lines retrieved from L3 cache L3 cache holds cache lines retrieved from memory. Main memory holds disk blocks retrieved from local disks. retrieved from disks on remote network servers. Figure 3: Memory Hierarchy Issues data consistency fair allocation latency hiding concurrent access by multiple CPUs 6. Other memory issues Application relocation in phys mem Protection 7. VM v. phys mem idea: hide difference from program virtual address: a new abstraction! base and bounds registers (segmentation) paged VM. Non contiguous at small scale 8. I/O device abstraction byte stream buffer often convenient memory, local disks, remote storage more or less the same to program 4

The Process 1. A program in execution 2. Memory (program instructions, static and dynamic data values) 3. CPU state (registers, PC, SP, etc.) 4. Operating system state (open files, accounting statistics, etc.) Process Address Space 1. Unique to each process 2. Text, Data, Stack(and others that we ll ignore) 3. Each process has its own not per program! Context Switch 1. process context state 2. context switch to scheduler primary task: select next process to execute 3. select next process 4. context switch to next process Process v. Thread 1. fork() and exec() key differences 2. container 3. always at least one thread of control 4. process creation heavyweight 5. thread creation lightweight 5

xv6 Overview Process State Machine The idealized model captures the lifecycle of a process once it is ready to run in the system. An implementation model will have to account for all other possible stated in the system. 1. XV6 Model Figure 4: XV6 Process State Transition Model 2. Syscall Interface trap 0x40 (int 64) Return a code required; often indicates SUCCESS or FAILURE. User mode code must check return code. Only exception is exec() which only returns on failure. All arguments are passed on the stack. e.g., x86 not x86 64 style. Kernel helper functions: argint(), argptr(), argstr() How to Boot Assume that our project directory is markem/xv6. 1. Normal $ make qemu nox qemu system i386 nographic hdb f s. img xv6. img smp 2 m 512 xv6... 6

cpu1 : s t a r t i n g cpu0 : s t a r t i n g sb : s i z e 1000 nblocks 941 ninodes 200 nlog 30 l o g s t a r t 2 i n o d e s t a r t 32 i n i t : s t a r t i n g sh $ 2. Debug requires 2 windows First Window $ make qemu nox gdb dd i f =/dev/ zero o f=xv6. img count =10000 10000+0 r e c o r d s in 10000+0 r e c o r d s out 5120000 bytes ( 5. 1 MB) copied, 0.0167251 s, 306 MB/ s dd i f=bootblock o f=xv6. img conv=notrunc 1+0 r e c o r d s in 1+0 r e c o r d s out 512 bytes (512 B) copied, 0.0158223 s, 32.4 kb/ s dd i f=k e r n e l o f=xv6. img seek=1 conv=notrunc 353+1 r e c o r d s in 353+1 r e c o r d s out 181005 bytes (181 kb) copied, 0.00314437 s, 57.6 MB/ s sed s / l o c a l h o s t :1234/ l o c a l h o s t :27377/ <. g d b i n i t. tmpl >. g d b i n i t Now run gdb. qemu system i386 nographic hdb f s. img xv6. img smp 2 m 512 S gdb tcp : : 2 7 3 7 7 Second Window $ gdb GNU gdb ( Ubuntu 7.7.1 0 ubuntu5 1 4. 0 4. 2 ) 7. 7. 1 Copyright (C) 2014 Free Software Foundation, Inc. L i c e n s e GPLv3+: GNU GPL v e r s i o n 3 or l a t e r <http : / / gnu. org / l i c e n s e s / gp This i s f r e e s o f t w a r e : you are f r e e to change and r e d i s t r i b u t e i t. There i s NO WARRANTY, to the extent permitted by law. Type show copying and show warranty f o r d e t a i l s. This GDB was c o n f i g u r e d as x86 64 linux gnu. Type show c o n f i g u r a t i o n f o r c o n f i g u r a t i o n d e t a i l s. For bug r e p o r t i n g i n s t r u c t i o n s, p l e a s e s e e : <http : / /www. gnu. org / s o f t w a r e /gdb/ bugs />. 7

Find the GDB manual and other documentation r e s o u r c e s o n l i n e at : <http : / /www. gnu. org / s o f t w a r e /gdb/ documentation />. For help, type help. Type apropos word to search f o r commands r e l a t e d to word. warning : F i l e /u/markem/xv6/. g d b i n i t auto l o a d i n g has been d e c l i n e d b To enable e x e c u t i o n o f t h i s f i l e add add auto load s a f e path /u/markem/xv6/. g d b i n i t l i n e to your c o n f i g u r a t i o n f i l e /u/markem /. g d b i n i t. To completely d i s a b l e t h i s s e c u r i t y p r o t e c t i o n add s e t auto load s a f e path / l i n e to your c o n f i g u r a t i o n f i l e /u/markem /. g d b i n i t. For more i n f o r m a t i o n about t h i s s e c u r i t y p r o t e c t i o n s e e the Auto l o a d i n g s a f e path s e c t i o n in the GDB manual. E. g., run from the s h e l l : i n f o ( gdb ) Auto l o a d i n g s a f e path ( gdb ) The file.gdbinit in your $HOME directory must be updated. How to Exit XV6 1. By halt Command The command halt is designed to tell QEMU to show down the kernel. It has been known to not always work, although course staff cannot duplicate the problem. 2. By Control Sequence Use the control sequence control a x. 8