lab 2 overview - Lab 2: Overview David Lie ECE344...

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

View Full Document Right Arrow Icon
1 Lab 2: Overview David Lie ECE344 University of Toronto
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 ECE344: Operating Systems Overview Some notes: – How to use splhigh/splx Explanation of system calls
Background image of page 2
3 ECE344: Operating Systems Splhigh/Splx These disable interrupts – Think of this as a global lock for all threads. Everything within an splhigh/splx will execute atomically – Why don’t we just use splhigh/splx instead of lock_acquire/lock_release?
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 ECE344: Operating Systems Fork 2 easy steps: 1. Copy PCB state (i.e. trapframe) to new thread 2. Make a copy of address space and pass to new thread Both are passed to thread_fork() Remember to set return arguments differently between parent and child: – Child needs return value of 0 – Parent should get the PID of the child
Background image of page 4
5 ECE344: Operating Systems Execve Execve: – Destroy the current thread’s address space – Create a new one – Load the new program into the address space from disk – Pass arguments from old process – Jump to the starting point
Background image of page 5

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

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

This document was uploaded on 02/20/2012.

Page1 / 8

lab 2 overview - Lab 2: Overview David Lie ECE344...

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

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