hw7_xv6_lock

hw7_xv6_lock - Homework: Locking This assignment requires...

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

View Full Document Right Arrow Icon
Homework: Locking Read : spinlock.c Hand-In Procedure You are to turn in this homework at the beginning of lecture. Please write up your answers to the exercises below and hand them in to a 6.828 staff member at the beginning of lecture. Assignment : In this assignment we will explore some of the interaction between interrupts and locking. Make sure you understand what would happen if the kernel executed the following code snippet: struct spinlock lk; initlock(&lk, "test lock"); acquire(&lk); acquire(&lk); (Feel free to use Bochs to find out. acquire is in spinlock.c .) In xv6, the first acquire turns off interrupts on the local processor using cli , and interrupts remain off until the release of the last lock (at which point they are enabled using sti ). Let's see what happens if we turn on interrupts while holding the ide lock. In ide_rw in ide.c , add a call to sti(); after the call to acquire . Rebuild the kernel and boot it in Bochs. The kernel should panic almost immediately. Turn in
Background image of page 1

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

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

This note was uploaded on 05/29/2010 for the course 6 828 taught by Professor Guy during the Fall '08 term at MIT.

Page1 / 2

hw7_xv6_lock - Homework: Locking This assignment requires...

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

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