Fabián E. Bustamante, Spring 2007 Introduction to Computer Systems Today : Welcome to EECS 213 Lecture topics and assignments Lab rationale Next time:

Slides:



Advertisements
Similar presentations
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Advertisements

Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
OPERATING SYSTEMS Lecturer: Szabolcs Mikulas Office: B38B
Our Digital World Second Edition
SE-292 High Performance Computing
May 14, 2003Serguei A. Mokhov, 1 Von Neumann Model Cond. Assembly Intro COMP5201 Revision: 1.2 Date: June 18, 2003.
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc
C SINGH, JUNE 7-8, 2010IWW 2010, ISATANBUL, TURKEY Advanced Computers Architecture, UNIT 2 Advanced Computers Architecture UNIT 2 CACHE MEOMORY Lecture7.
MEMORY popo.
COMP1214 Systems & Platforms: Operating Systems Concepts Dr. Yvonne Howard – Rikki Prince – 1.
Database System Concepts and Architecture
Operating System.
Processes Management.
Copyright 2013 – Noah Mendelsohn Compiling C Programs Noah Mendelsohn Tufts University Web:
CSCE 3121 Computer Organization Lecture 1. CSCE 3122 Course Overview Topics: –Theme –Five great realities of computer systems –Computer System Overview.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Lab rationale CS 213 F ’06 CS-213 Yan Chen.
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Lab rationale and infrastructure F ’08 class01b.ppt.
16/13/2015 3:30 AM6/13/2015 3:30 AM6/13/2015 3:30 AMIntroduction to Software Development What is a computer? A computer system contains: Central Processing.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Class overview CS 213 S ’06 CS-213 Aleksandar Kuzmanovic.
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Class overview CS 213 S ’08 CS-213 Aleksandar Kuzmanovic.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
CS 213 Introduction to Computer Systems Course Organization David O’Hallaron August 28, 2001 Topics: Staff, text, and policies Lecture topics and assignments.
COMP 321: Introduction to Computer Systems Scott Rixner Alan L. Cox
Computer Architecture Lecture 01 Fasih ur Rehman.
Winter 2015 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University Introduction and Overview.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
CMSC 313, F ‘09 1 Introduction to Assembly TopicsTopics –Assembly Overview –Instructions –Hardware.
University of Amsterdam Computer Systems – a guided tour Arnoud Visser 1 Computer Systems A guided Tour.
CPU Computer Hardware Organization (How does the computer look from inside?) Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge.
Introduction to Computer Systems Topics: Theme Four great realities of computer systems Chap 1 in “Computer Systems” book “The Class That Gives.
Intro to Computer Systems Summer 2014 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Introduction and Overview Summer 2014 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
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,
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Introduction to Computer Systems Topics: Theme Five great realities of computer systems (continued) “The class that bytes”
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Lab rationale CS 213 F ’02 class01b.ppt “The Class.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Lecture on Central Process Unit (CPU)
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
Introduction and Overview Winter 2013 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
Introduction to Operating Systems Concepts
Computer Systems MTSU CSCI 3240 Spring 2016 Dr. Hyrum D. Carroll
Chapter 1: A Tour of Computer Systems
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
System Programming and administration
CS703 - Advanced Operating Systems
Local secondary storage (local disks)
Computer Systems Summary
Computer Science I CSC 135.
Introduction to Computer Systems
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Computer Systems
Introduction to Computer Systems
Hardware Organization
System calls….. C-program->POSIX call
Cache Memory and Performance
Presentation transcript:

Fabián E. Bustamante, Spring 2007 Introduction to Computer Systems Today : Welcome to EECS 213 Lecture topics and assignments Lab rationale Next time: Bits & bytes and some Boolean algebra

EECS 213 Introduction to Computer Systems Northwestern University 2 Welcome to Intro. to Computer Systems Everything you need to know Your instructor: Fabián E. Bustamante Your TA: well see about that Your undergraduate assistant –Helping with grading homework and projects Communication channels: –Course webpage –News

EECS 213 Introduction to Computer Systems Northwestern University 3 Course theme Abstraction is good, but dont forget reality! Courses to date emphasize abstraction –Abstract data types, asymptotic analysis, … Abstractions have limits –Especially in the presence of bugs –Need to understand underlying implementations Useful outcomes –Become more effective programmers Better at debugging, performance tuning, … –Prepare for later systems classes in CS & ECE Compilers, Operating Systems, Networks,... –What do you need? Required: EECS 211 or equivalent & Experience with C or C++ Useful: EECS 311

EECS 213 Introduction to Computer Systems Northwestern University 4 Course perspective Most systems courses are builder-centric –Operating Systems: Implement portions of an OS –Compilers: Write compiler for simple language –Networking: Implement and simulate network protocols This course is programmer-centric –Purpose is to show how by knowing more about the underlying system, one can be more effective as a programmer –Enable you to Write programs that are more reliable and efficient Incorporate features that require hooks into OS –Not just a course for dedicated hackers We bring out the hidden hacker in everyone –Cover material in this course that you wont see elsewhere

EECS 213 Introduction to Computer Systems Northwestern University 5 Textbooks Required: –Bryant & OHallaron, Computer Systems: A Programmers Perspective, PH (csapp.cs.cmu.edu) Recommended: –Kernighan & Ritchie (K&R), The C Programming Language, Second Edition, PH 1988 –R. Stevens, Advanced Programming in the Unix Environment, AW 1992; theres a new edition by R. Stevens and S. Rago, AW 2005

EECS 213 Introduction to Computer Systems Northwestern University 6 Course components Lectures –Higher level concepts –10% of grade from class participation Labs –The heart of the course – in-depth understanding –3 labs, remove the malloc lab due to lack of TA 2 ~ 3 weeks –10% of grade each –Working on teams of 2 Homework assignments (3-4) –10% of grade Exams – midterm & final –25% of grade each

EECS 213 Introduction to Computer Systems Northwestern University 7 Policies Late policy –10% off per day Cheating –What is cheating? Sharing code: either by copying, retyping, looking at, or supplying a copy of a file. –What is NOT cheating? Helping others use systems or tools. Helping others with high-level design issues. Helping others debug their code. –Penalty for cheating: Removal from course with failing grade.

EECS 213 Introduction to Computer Systems Northwestern University 8 Facilities TLAB (Tech F-252, on the bridge to Ford) –A cluster of Linux machines (e.g., TLAB- 11.cs.northwestern.edu) You should all have TLAB accounts by now; problems? contact root Need physical access to TLAB? Contact Carol Surma

EECS 213 Introduction to Computer Systems Northwestern University 9 Lab rationale Doing a lab should result in new skills and concepts –Data Lab: computer arithmetic, digital logic. –Bomb Lab: assembly language, using a debugger, understanding the stack. –Exploit Lab: understanding the calling stack organization and buffer overflow vulnerabilities.

EECS 213 Introduction to Computer Systems Northwestern University 10 Some topics covered Programs and data –Bits arithmetic, assembly, representation of C control … –Includes aspects of architecture and compilers Memory hierarch –Memory technology, memory hierarchy, caches, disks, locality –Includes aspects of architecture and OS. Linking & exceptional control flow –Object files, dynamic linking, libraries, process control, … –Includes aspects of compilers, OS, and architecture Virtual memory –Virtual memory, address translation, dynamic storage allocation –Includes aspects of architecture and OS I/O, networking & concurrency –High level & low-level I/O, net programming, threads, … –Includes aspects of networking, OS, and architecture

EECS 213 Introduction to Computer Systems Northwestern University 11 Hello World What happens and why when you run hello on your system? Goal: introduce key concepts, terminology, and components /*hello world*/ # include int main() { printf(hello, world\n); }

EECS 213 Introduction to Computer Systems Northwestern University 12 Information is bits + context Hello is a source code –Sequence of bits (0 or 1) –8-bit data chunks are called Bytes –Each Byte has an integer value that corresponds to some character (ASCII standard) E.g., # -> 35 –Files that consist of ASCII characters -> text files –All other files -> binary files (e.g., 35 is a part of a machine command) Context is important –The same sequence of bytes might represent a character string or machine instruction

EECS 213 Introduction to Computer Systems Northwestern University 13 Programs translated by other programs Pre-processing –E.g., #include is inserted into hello.i Compilation (.s) –Each statement is an assembly language program Assembly (.o) –A binary file whose bytes encode mach. language instructions Linking –Get printf() which resides in a separate precompiled object file Pre- processor ( cpp ) hello.i Compiler ( cc1 ) hello.s Assembler ( as ) hello.o Linker ( ld ) hellohello.c Source program (text) Modified source program (text) Assembly program (text) Relocatable object programs (binary) Executable object program (binary) printf.o unix> gcc –o hello hello.c

EECS 213 Introduction to Computer Systems Northwestern University 14 Hardware organization Main memory I/O bridge Bus interface ALU Register file CPU System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters hello executable stored on disk PC Buses: transfer fixed-sized chunks of data (WORDS) Pentium: 4B bus I/O Devices: System connections to external world. Mouse, keyboard (input); Display, disk device (output) Main Memory: Temporary storage device. Holds both a program and the data it manipulates. Control Processor Unit Executes instructions stored in MM. PC - holds address of machine-language instruction from memory

EECS 213 Introduction to Computer Systems Northwestern University 15 Running Hello Running hello Whats the shell? What does it do? –prints a prompt –waits for you to type command line –loads and runs hello program … unix>./hello hello, world unix>

EECS 213 Introduction to Computer Systems Northwestern University 16 Running Hello Main memory I/O bridge Bus interface ALU Register file System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters PC./hello" User types "hello" Reading the hello command from the keyboard

EECS 213 Introduction to Computer Systems Northwestern University 17 Running Hello Main memory I/O bridge Bus interface ALU Register file System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters hello executable stored on disk PC hello code "hello,world\n" Shell program loads hello.exe into main memory

EECS 213 Introduction to Computer Systems Northwestern University 18 Running Hello Main memory I/O bridge Bus interface ALU Register file System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters hello executable stored on disk PC hello code "hello,world\n" The processor executes instructions and displays hello…

EECS 213 Introduction to Computer Systems Northwestern University 19 Caches matter System spends a lot of time moving info. around Larger storage devices are slower than smaller ones –Register file ~ 100 Bytes & Main memory ~ millions of Bytes Easier and cheaper to make processors run faster than to make main memory run faster –Standard answer – cache Main memory (DRAM) Memory bridge Bus interface L2 cache (SRAM) ALU Register file CPU chip Cache busSystem busMemory bus L1 cache (SRAM)

EECS 213 Introduction to Computer Systems Northwestern University 20 Storage devices form a hierarchy Main memory holds disk blocks retrieved from local disks. Registers On-chip L1 cache (SRAM) Main memory (DRAM) Local secondary storage (local disks) Remote secondary storage (distributed file systems, Web servers) Local disks hold files retrieved from disks on remote network servers. Off-chip L2 cache (SRAM) L1 cache holds cache lines retrieved from the L2 cache. CPU registers hold words retrieved from cache memory. L2 cache holds cache lines retrieved from memory. L0: L1: L2: L3: L4: L5: Smaller, faster, and costlier (per byte) storage devices Storage at one level serves as cache at the next level

EECS 213 Introduction to Computer Systems Northwestern University 21 Operating System OS – a layer of software interposed between the application program and the hardware Two primary goal –Protect resources from misuse by applications –Provide simple and uniform mechanisms for manipulating low-level hardware devices Application programs ProcessorMain memoryI/O devices Operating system Software Hardware

EECS 213 Introduction to Computer Systems Northwestern University 22 OS Abstractions Files – abstractions of I/O devices Virtual Memory – abstraction for main memory and I/O devices Processes – abstractions for processor, main memory, and I/O devices ProcessorMain memoryI/O devices Processes Files Virtual memory

EECS 213 Introduction to Computer Systems Northwestern University 23 Processes OS provides the illusion that a process is the only one there Process –OSs abstraction of a running program Context switch –Saving context of one process, restoring that of another one –Distorted notion of time shell process hello process Application code Time Context switch Context switch OS code Application code OS code Application code

EECS 213 Introduction to Computer Systems Northwestern University 24 Virtual Memory Illusion that each process has exclusive use of a large main memory Example –Virtual address space for Linux Kernel virtual memory Memory mapped region for shared libraries Run-time heap (created at runtime by malloc) User stack (created at runtime) Unused 0 Memory invisible to user code 0xc x x Read/write data Read-only code and data Loaded from the hello executable file printf() function 0xffffffff

EECS 213 Introduction to Computer Systems Northwestern University 25 Networking Talking to other systems Network – seen as another I/O device Many system-level issues arise in presence of network –Coping with unreliable media –Cross platform compatibility –Complex performance issues Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots Network adapter Network

EECS 213 Introduction to Computer Systems Northwestern University 26 Conclusions Any computer system is more than just hardware –A collection of intertwined hardware & software that must cooperate to achieve the end goal – running applications The rest of our course will expand on this