+
+ /* Interrupt frame. */
+ if_ = alloc_frame (t, sizeof *if_);
+ if_->es = SEL_UDSEG;
+ if_->ds = SEL_UDSEG;
+ if_->eip = start;
+ if_->cs = SEL_UCSEG;
+ if_->eflags = FLAG_IF | 2;
+ if_->esp = PHYS_BASE;
+ if_->ss = SEL_UDSEG;
+
+ /* Stack frame for switch_entry(). */
+ ef = alloc_frame (t, sizeof *ef);
+ ef->eip = intr_exit;
+
+ /* Stack frame for thread_switch(). */
+ sf = alloc_frame (t, sizeof *sf);
+ sf->eip = switch_entry;
+
+ /* Add to run queue. */
+ thread_ready (t);
+