hw7_xv6_lock

hw7_xv6_lock - Homework Locking This assignment requires...

Info icon This 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.
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern