week5_wed - CSCC 69H3 Operating Systems Winter 2010...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCC 69H3 Operating Systems Winter 2010 Professor Bianca Schroeder U of T
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Today: - Understanding system calls - Adding system calls to OS161
Background image of page 2
Requesting OS Services OS and user programs are isolated from each other But OS provides services to user programs… So how do they communicate? User mode Application programs Privileged mode Operating system • System call • Interrupt • OS sets up registers, mode for application • Jumps to next application instruction
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Implementing a new system call User mode (application) Privileged mode (kernel) Application program: helloworld() …. sys_helloworld(): kernel routine implementing the actual functionality How does the system give user- level applications access to sys_helloworld?
Background image of page 4
System calls: Implementing a helloworld system call User mode (application) Privileged mode (kernel) Application program: helloworld() …. sys_helloworld(): kernel routine implementing the actual functionality At the application level: helloworld C library function: Pass control to kernel Let kernel know which system call to execute How do you do that? => Raise an exception
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is an exception? A mechanism that enables OS to regain control Interface between OS and processor Exceptions are raised for different reasons By the hardware because something went wrong E.g. division by zero, or a page fault (will see in a few weeks what this is) Or because applications asks for it E.g. through a system call … Implemented by the exception handler A carefully crafted piece of assembler
Background image of page 6
What does the exception handler do? Transfers control to the OS through a special
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/22/2010 for the course CS CSCC69 taught by Professor Bianca during the Spring '10 term at University of Toronto.

Page1 / 19

week5_wed - CSCC 69H3 Operating Systems Winter 2010...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online