Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Interrupt Handling and CPU State in Computer Systems: A Study Guide for 15-410 Students, Slides of Software Engineering

An overview of computer hardware, focusing on cpu state, synchronization, and interrupt handling. It includes information on user and non-user registers, processor status registers, floating point number registers, and the story of getpid(). Students of the 15-410 course at carnegie mellon university will find this document useful for understanding the concepts of cpu state and interrupt handling.

Typology: Slides

2011/2012

Uploaded on 04/16/2012

shyrman
shyrman 🇺🇸

4.2

(6)

240 documents

1 / 39

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
15-410, F’11
1
Hardware Overview
Sep. 7, 2011
Dave Eckhardt
Dave Eckhardt
Garth Gibson
Garth Gibson
L04_Hardware
15-410
“Computers make very fast, very accurate mistakes.”
--Brandon Long
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27

Partial preview of the text

Download Interrupt Handling and CPU State in Computer Systems: A Study Guide for 15-410 Students and more Slides Software Engineering in PDF only on Docsity!

15-410, F’

Hardware Overview

Sep. 7, 2011

Dave Eckhardt

Dave Eckhardt

Garth Gibson

Garth Gibson

L04_Hardware

“Computers make very fast, very accurate mistakes.”

--Brandon Long

15-410, F’

Synchronization

Partner signups

Partner signups

11 group signups so far – thanks!

Please sign up as soon as you decide!

This helps other students

Both partners please sign up!

This helps course staff detect “love triangles”

15-410, F’

Synchronization

Personal Simics licenses

Personal Simics licenses

Simics machine-simulator software is licensed

We have enough “seats” for the class

Should work on most CMU-network machines

Will not work on most non-CMU-network

machines

CMU operates a VPN server for off-campus users

»

http://www.cmu.edu/computing/network/vpn

»

There is an open-source alternative (OpenConnect)

  • We don't yet know how to make it work

15-410, F’

Synchronization

Simics on Windows?

Simics on Windows?

Simics simulator itself is available for Windows

15-410 build/debug infrastructure is not

Can be hacked up, issues may arise

»

Version skew, partner, ...

Options

Options

Dual-boot Linux/Windows, run Linux in VMware

Usability via X depends on network latency

May be too slow – though we are experimenting

Port to cygwin (may be non-trivial)

There are some cluster machines...

WeH 5205/5207, GHC 3000, GHC 5201/

15-410, F’

Inside The Box - Historical/Logical

CPU

Memory

Graphics

Ethernet

IDE

Floppy

USB

15-410, F’

Inside The Box - 1997-

CPU

Memory

AGP Graphics

IDE

Floppy

USB

North Bridge

South Bridge

P

C

I

Ethernet

SCSI

15-410, F’

CPU State

User registers (on Planet IA32)

User registers (on Planet IA32)

General purpose - %eax, %ebx, %ecx, %edx

Stack Pointer - %esp

Frame Pointer - %ebp

Mysterious String Registers - %esi, %edi

15-410, F’

CPU State

Non-user

Non-user registers, a.k.a....

registers, a.k.a....

Processor status register(s)

Processor status register(s)

Currently running: user code / kernel code?

Interrupts on / off

Virtual memory on / off

Memory model

small, medium, large, purple, dinosaur

15-410, F’

Story time!

Time for some fairy tales

Time for some fairy tales

The getpid() story (shortest legal fairy tale)

The read() story (toddler version)

The read() story (grade-school version)

15-410, F’

The Story of getpid()

User process is computing

User process is computing

User process calls getpid() library routine

Library routine executes TRAP $

In Intel-land, TRAP is called “ INT ” (because it

isn't one)

REMEMBER: “ INT ” is not an interrupt

The world changes

The world changes

Some registers dumped into memory somewhere

Some registers loaded from memory somewhere

The processor has

The processor has entered kernel mode

entered kernel mode

15-410, F’

Entering Kernel Mode

Operating

System

Process 1

Process 2

CPU

save

15-410, F’

Entering Kernel Mode

Operating

System

Process 1

Process 2

CPU

Ethernet

SATA

Floppy

USB

15-410, F’

The Story of getpid()

Process runs in kernel mode

Process runs in kernel mode

running->u_reg[R_EAX] = running->u_pid;

Return from interrupt”

Return from interrupt”

Processor state restored to user mode

(modulo %eax)

User process returns to computing

User process returns to computing

 Library routine returns %eax as value of getpid()

15-410, F’

Returning to User Mode

Operating

System

Process 1

Process 2

CPU

restore