-*- text -*-
-* FS and GS:
-
- - struct intr_frame: Add members.
-
- - intr_entry(): Save, reset.
-
- - intr_exit(): Restore.
-
- - execute_thread(): Initialize.
-
* Userprog project:
- Move `join' implementation here, from `threads' project, to help
uint32_t edx; /* Saved EDX. */
uint32_t ecx; /* Saved ECX. */
uint32_t eax; /* Saved EAX. */
+ uint16_t gs, :16; /* Saved GS segment register. */
+ uint16_t fs, :16; /* Saved FS segment register. */
uint16_t es, :16; /* Saved ES segment register. */
uint16_t ds, :16; /* Saved DS segment register. */
# Save caller's registers.
push ds
push es
+ push fs
+ push gs
pusha
# Set up kernel environment.
intr_exit:
# Restore caller's registers.
popa
+ pop gs
+ pop fs
pop es
pop ds
add esp, 8
/* Initialize interrupt frame and load executable. */
memset (&if_, 0, sizeof if_);
+ if_.gs = SEL_UDSEG;
+ if_.fs = SEL_UDSEG;
if_.es = SEL_UDSEG;
if_.ds = SEL_UDSEG;
if_.cs = SEL_UCSEG;