diff options
author | Austin Clements <[email protected]> | 2011-09-07 11:49:14 -0400 |
---|---|---|
committer | Austin Clements <[email protected]> | 2011-09-07 11:49:14 -0400 |
commit | 01a6c054d548d9fff8bbdfac4d3f3de4ae8677a1 (patch) | |
tree | 4320eb3d09f31f4a628b80d45482a72ee7c3956b /web/xv6-sched.html | |
parent | 64a03bd7aa5c03a626a2da4730a45fcceea75322 (diff) | |
download | xv6-labs-01a6c054d548d9fff8bbdfac4d3f3de4ae8677a1.tar.gz xv6-labs-01a6c054d548d9fff8bbdfac4d3f3de4ae8677a1.tar.bz2 xv6-labs-01a6c054d548d9fff8bbdfac4d3f3de4ae8677a1.zip |
Remove web directory; all cruft or moved to 6.828 repo
Diffstat (limited to 'web/xv6-sched.html')
-rw-r--r-- | web/xv6-sched.html | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/web/xv6-sched.html b/web/xv6-sched.html deleted file mode 100644 index f8b8b31..0000000 --- a/web/xv6-sched.html +++ /dev/null @@ -1,96 +0,0 @@ -<title>Homework: Threads and Context Switching</title> -<html> -<head> -</head> -<body> - -<h1>Homework: Threads and Context Switching</h1> - -<p> -<b>Read</b>: swtch.S and proc.c (focus on the code that switches -between processes, specifically <code>scheduler</code> and <code>sched</code>). - -<p> -<b>Hand-In Procedure</b> -<p> -You are to turn in this homework during 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. -<p> -<b>Introduction</b> - -<p> -In this homework you will investigate how the kernel switches between -two processes. - -<p> -<b>Assignment</b>: -<p> - -Suppose a process that is running in the kernel -calls <code>sched()</code>, which ends up jumping -into <code>scheduler()</code>. - -<p> -<b>Turn in</b>: -Where is the stack that <code>sched()</code> executes on? - -<p> -<b>Turn in</b>: -Where is the stack that <code>scheduler()</code> executes on? - -<p> -<b>Turn in:</b> -When <code>sched()</code> calls <code>swtch()</code>, -does that call to <code>swtch()</code> ever return? If so, when? - -<p> -<b>Turn in:</b> -Why does <code>swtch()</code> copy %eip from the stack into the -context structure, only to copy it from the context -structure to the same place on the stack -when the process is re-activated? -What would go wrong if <code>swtch()</code> just left the -%eip on the stack and didn't store it in the context structure? - -<p> -Surround the call to <code>swtch()</code> in <code>schedule()</code> with calls -to <code>cons_putc()</code> like this: -<pre> - cons_putc('a'); - swtch(&cpus[cpu()].context, &p->context); - cons_putc('b'); -</pre> -<p> -Similarly, -surround the call to <code>swtch()</code> in <code>sched()</code> with calls -to <code>cons_putc()</code> like this: - -<pre> - cons_putc('c'); - swtch(&cp->context, &cpus[cpu()].context); - cons_putc('d'); -</pre> -<p> -Rebuild your kernel and boot it on bochs. -With a few exceptions -you should see a regular four-character pattern repeated over and over. -<p> -<b>Turn in</b>: What is the four-character pattern? -<p> -<b>Turn in</b>: The very first characters are <code>ac</code>. Why does -this happen? -<p> -<b>Turn in</b>: Near the start of the last line you should see -<code>bc</code>. How could this happen? - -<p> -<b>This completes the homework.</b> - -</body> - - - - - - |