Discussion:
Create_User_Context : code/data descriptors
(too old to reply)
Tom Brubaker
2005-02-18 04:20:52 UTC
Permalink
The slides for this project show

Init_Code_Segement_Descriptor() and
Init_Data_Segment_Descriptor()

as step 5 of Create_User_Process(), but don't these functions require
information from exeFormat->segementList ?

Is it ok/necessary then just to perform these steps back in
Load_User_Program() instead of in Create_User_Context() ?

-Tom-
Drew Chen
2005-02-18 04:52:05 UTC
Permalink
from what i figured, the prototype for Create_User_Context was commented out
because it was only required if you wanted to put that section of code into it.

i figure it is fine if you just put all the contents of Create_User_Context within
Load_User_Program, since L_U_P() is the only function that calls C_U_C().

as long as it works, i say.

-Drew
cs412052
2005-02-18 05:01:53 UTC
Permalink
I *think* you're right.

From the description...
"Even though the vaddr for the data segment indicates that the start of
the data segment is offset from the start of the executable image, the
data segment you create should always have its base at the start of the
executable image."

So, you only need to pass the 'size' to Create_User_Context(..). Then, do
all your mem allocations back in Load_User_Program(..).

Andrew
Post by Tom Brubaker
The slides for this project show
Init_Code_Segement_Descriptor() and
Init_Data_Segment_Descriptor()
as step 5 of Create_User_Process(), but don't these functions require
information from exeFormat->segementList ?
Is it ok/necessary then just to perform these steps back in
Load_User_Program() instead of in Create_User_Context() ?
-Tom-
Loading...