<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -155,9 +155,7 @@ void *Memory::PageFault(struct modeswitch_registers *r) {
 	Akari-&gt;console-&gt;putInt(faultingAddress, 16);
 	Akari-&gt;console-&gt;putChar('\n');
 
-	while (1)
-		__asm__ __volatile__(&quot;hlt&quot;);
-
+	// Return 0, which tells the interrupt handler to kill this process.
 	return 0;
 }
 </diff>
      <filename>Memory.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -80,11 +80,14 @@ static void AkariEntryCont() {
 	// Shell
 	Tasks::Task *shell = Tasks::Task::CreateTask((u32)&amp;ShellProcess, 3, true, 0, Akari-&gt;memory-&gt;_kernelDirectory);
 	kbdriver-&gt;next = shell;
+	Tasks::Task *anoshell = Tasks::Task::CreateTask((u32)&amp;ShellProcess, 3, true, 0, Akari-&gt;memory-&gt;_kernelDirectory);
+	shell-&gt;next = anoshell;
 	
 	// Now we need our own directory! BootstrapTask should've been nice enough to make us one anyway.
 	Akari-&gt;memory-&gt;switchPageDirectory(base-&gt;pageDir);
 
 	Tasks::SwitchRing(3, 0); // switches to ring 3, uses IOPL 0 (no I/O access unless iomap gives it) and enables interrupts.
+	syscall_exit();
 
 	// We have a proper (kernel-mode) idle task we spawn above that hlts, so we
 	// can exit, with an exit syscall. We can't actually call syscall_exit(), since</diff>
      <filename>entry.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
 #include &lt;Console.hpp&gt;
 #include &lt;Descriptor.hpp&gt;
 #include &lt;debug.hpp&gt;
+#include &lt;Tasks.hpp&gt;
 
 static const char *isr_messages[] = {
     &quot;Division by zero&quot;,
@@ -51,10 +52,26 @@ void *isr_handler(struct modeswitch_registers *r) {
 		Akari-&gt;console-&gt;putInt(r-&gt;callback.eflags, 16);
 		Akari-&gt;console-&gt;putString(&quot;, user ESP (may be garbage): &quot;);
 		Akari-&gt;console-&gt;putInt(r-&gt;useresp, 16);
-		Akari-&gt;console-&gt;putString(&quot;\n&quot;);
+		Akari-&gt;console-&gt;putString(&quot;\nProcess killed.\n&quot;);
 
-		while (1)
-			__asm__ __volatile__(&quot;hlt&quot;);
+		// TODO OMG: refactor this code! It's terrible! Half-copied from
+		// UserCalls.cpp and the surrounding architecture to skip a killed
+		// task in Syscalls. These can be unified, now.
+
+		Tasks::Task *nextTask = Akari-&gt;tasks-&gt;getNextTask();
+
+		Tasks::Task **scanner = &amp;Akari-&gt;tasks-&gt;start;
+		while (*scanner != Akari-&gt;tasks-&gt;current) {
+			scanner = &amp;(*scanner)-&gt;next;
+		}
+		*scanner = (*scanner)-&gt;next;
+
+		Akari-&gt;tasks-&gt;current = nextTask;
+		return Akari-&gt;tasks-&gt;assignInternalTask(Akari-&gt;tasks-&gt;current);
+
+
+		// while (1)
+			// __asm__ __volatile__(&quot;hlt&quot;);
 	}
 
 	return resume;</diff>
      <filename>interrupts.cpp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bcbdb966b5661b30c226ec39ee6d5b0f450ebf6f</id>
    </parent>
  </parents>
  <author>
    <name>Arlen Cuss</name>
    <email>celtic@sairyx.org</email>
  </author>
  <url>http://github.com/celtic/akari/commit/0ba778b89f10e90fb7b8f22b7930aaeaf772cdc5</url>
  <id>0ba778b89f10e90fb7b8f22b7930aaeaf772cdc5</id>
  <committed-date>2009-10-10T20:39:21-07:00</committed-date>
  <authored-date>2009-10-10T20:39:21-07:00</authored-date>
  <message>Duplicate shells, adding a syscall_exit to the entry since I know it'll fail, and letting the pagefault handler drop back to the interrupt handler so the process gets killed.</message>
  <tree>62279b733cdf6f39061bcbfb36b725e65f418a37</tree>
  <committer>
    <name>Arlen Cuss</name>
    <email>celtic@sairyx.org</email>
  </committer>
</commit>
