15-410 F’13 Lecture Notes: Computer Hardware and Interrupt Handling, Slides of Operating Systems

These are the lecture notes for the computer hardware and interrupt handling section of the 15-410 course at carnegie mellon university, fall 2013. The notes cover topics such as cpu state, synchronization, interrupt handlers, race conditions, and interrupt masking. They also include information about simics licenses, simics on windows, and the story of getpid().

Typology: Slides

2013/2014

Uploaded on 02/01/2014

sashie
sashie 🇮🇳

4.2

(40)

176 documents

1 / 40

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
15-410, F’13
1
Hardware Overview
Sep. 4, 2013
Dave Eckhardt
Dave Eckhardt
Todd Mowry
Todd Mowry
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
pf28

Partial preview of the text

Download 15-410 F’13 Lecture Notes: Computer Hardware and Interrupt Handling and more Slides Operating Systems in PDF only on Docsity!

15-410, F’

Hardware Overview

Sep. 4, 2013

Dave Eckhardt

Dave Eckhardt

Todd Mowry

Todd Mowry

L04_Hardware

“Computers make very fast, very accurate mistakes.”

--Brandon Long

15-410, F’

Synchronization

Partner signups

Partner signups

~12 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)

  • It used to not work with the campus server
  • Recently rumor has it that it does

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 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