X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fuserprog%2Fprocess.c;h=c0a6547acb0e09a7717d43ab8fb7199e8ae7248b;hb=2f3628001838a081d81429d658af350c7054078e;hp=90ff18b14ddaae54563ee7d53d6c0cef538fe5aa;hpb=391b0ad376d5254ff321fe294b93cd5ed616cb96;p=pintos-anon diff --git a/src/userprog/process.c b/src/userprog/process.c index 90ff18b..c0a6547 100644 --- a/src/userprog/process.c +++ b/src/userprog/process.c @@ -54,6 +54,8 @@ execute_thread (void *filename_) /* 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; @@ -75,10 +77,7 @@ execute_thread (void *filename_) arguments on the stack in the form of a `struct intr_frame', we just point the stack pointer (%esp) to our stack frame and jump to it. */ - asm ("mov %0, %%esp\n" - "jmp intr_exit\n" - : /* no outputs */ - : "g" (&if_)); + asm ("mov %%esp, %0; jmp intr_exit" :: "g" (&if_)); NOT_REACHED (); }