Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4] Implement argument passing #39

Merged
merged 1 commit into from
Apr 8, 2017
Merged

[#4] Implement argument passing #39

merged 1 commit into from
Apr 8, 2017

Conversation

Lment
Copy link
Contributor

@Lment Lment commented Apr 5, 2017

Merged branch [#38] in local, which fixed unintended argument manipulation.

Using pintos -v -k -T 60 --bochs --fs-disk=2 -p ../../examples/echo -a echo -- -q -f run 'echo xxx' and hex_dump(), current implementation is working well with argc = 2, and since implementation is based on make argument passing when argc = n, I expect this works well with another user programs.

Use hex_dump((uintptr_t)(PHYS_BASE - 200), (void **) (PHYS_BASE - 200), 250, true); in bottom of push_arg_on_stack().

@Lment Lment added the feature label Apr 5, 2017
@Lment Lment added this to the Project #2 milestone Apr 5, 2017
@Lment Lment requested a review from hangpark April 5, 2017 16:50
@Lment Lment force-pushed the iss/4 branch 3 times, most recently from 7411c0c to 98648fe Compare April 6, 2017 12:23

#define WORD_SIZE sizeof(uintptr_t)

struct arguments
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this static


#define WORD_SIZE sizeof(uintptr_t)

struct arguments
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write a comment.

static void argument_parser(char *str, struct arguments *args);

static void
argument_parser (char *string_input, struct arguments *argument)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this method below start_process() for consistency.

static void argument_parser(char *str, struct arguments *args);

static void
argument_parser (char *string_input, struct arguments *argument)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write a comment.


process_name = strtok_r (process_name, " ", &leftover);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use argument_parse() here. Duplicated.

{
arg_length = strlen (args->argv[i]) + 1;
dest = top - arg_length;
memcpy ((void *) dest, (void *) (args->argv[i]), arg_length);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(void *) is now useless.

for(i = 0; i < alignment ; i++)
{
memcpy ((top - 1), &zero, 1);
top--;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memcpy (--top, &zero, 1);

}

memcpy ((top - WORD_SIZE), &zero, WORD_SIZE);
top -= WORD_SIZE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch above two statements.

for(i = (args->argc -1); i >= 0; i--)
{
memcpy ((top - WORD_SIZE), &argument_pointers[i], WORD_SIZE);
top -= WORD_SIZE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch above two statements.

top -= WORD_SIZE;

memcpy ((top - WORD_SIZE), &zero, WORD_SIZE);
top -= WORD_SIZE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch two statements in each of 3 groups above.

Copy link
Owner

@hangpark hangpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add full commit message.

Copy link
Owner

@hangpark hangpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add little comment in

@@ -464,3 +513,55 @@ install_page (void *upage, void *kpage, bool writable)
return (pagedir_get_page (t->pagedir, upage) == NULL
&& pagedir_set_page (t->pagedir, upage, kpage, writable));
}

static void
push_arg_on_stack(struct arguments *args, void **esp)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename push_args_to_stack and rename all occurrence of argument and arg above to args appropriately.

int i;
char *dest;

for(i = (args->argc - 1); i >= 0; i--)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write little comment with // to specify which data is going to be pushed.

static bool load (const char *cmdline, void (**eip) (void), void **esp);
static bool load (struct arguments *argument, void (**eip) (void), void **esp);

static void argument_parser(char *str, struct arguments *args);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this prototype above start_process.

@@ -29,6 +41,7 @@ tid_t
process_execute (const char *file_name)
{
char *fn_copy;
struct arguments *args = malloc (sizeof *args);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change right-hand side to (struct arguments *) malloc (sizeof struct arguments).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I referenced here. Also, this doesn't work. Casting is o.k, but in sizeof, this code invokes syntax error before struct.

@@ -38,34 +51,66 @@ process_execute (const char *file_name)
return TID_ERROR;
strlcpy (fn_copy, file_name, PGSIZE);

argument_parser (fn_copy, args);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to give a short comment above this statement. How do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

if (tid == TID_ERROR)
palloc_free_page (fn_copy);
{
palloc_free_page (fn_copy);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be freed after below two frees.

return tid;
}

/* Starts string tokenizer, which cuts given input string into tokens
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to explain which library function did you use. Writing about what does this method do is better.

ex) Parse a given command line in string to strings of each argument by replacing every spaces to the null character. And then store them in the arguments structure.

static void
push_args_on_stack(struct arguments *args, void **esp)
{
void **arg_ptrs = calloc (args->argc, sizeof(uintptr_t));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use

void **arg_ptrs = (void **) calloc (args->argc, sizeof void *);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invokes syntax error before void, when following this problem.


alignment = ((uint32_t) curr) % WORD_SIZE;

/* Aligning, and push bytes required for aligning. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should move above alignment initialization.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use push, save. Not pushing, saving.

int i;
void *dest;

/* Pushing arguments on stack, saving their address in arg_ptrs. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use push, save. Not pushing, saving.

for(i = 0; i < alignment ; i++)
memcpy (--curr, &zero, 1);

curr -= WORD_SIZE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? missing comment.

curr -= WORD_SIZE;
memcpy (curr, &zero, WORD_SIZE);

for(i = (args->argc -1); i >= 0; i--)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? missing comment.

Copy link
Owner

@hangpark hangpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why indent is tab?


/* esp pointing bottom of the stack */
*esp = (void *) curr;
hex_dump((uintptr_t)(PHYS_BASE - 200), (void **) (PHYS_BASE - 200), 250, true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz......

return tid;
}

/* Parse arguments from given string, which removes whole adjacent spaces and replace it
with NULL. And then stores it in given argument struct by pointer. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not NULL. '\0' or null character.


for (curr = strtok_r (str_input, delim, &leftover);
curr != NULL; curr = strtok_r (NULL, delim, &leftover))
args->argv[args->argc ++] = curr;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space

delim = " ";

for (curr = strtok_r (str_input, delim, &leftover);
curr != NULL; curr = strtok_r (NULL, delim, &leftover))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does first line > 80? If not, move curr != NULL above.

args->argc = 0;
args->argv = (char **) calloc ((strlen (str_input) + 1), sizeof (char));

delim = " ";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use in strtok_r

struct intr_frame if_;
bool success;


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;;

/* Push arguments on newly initialized stack, following calling conventions.
This invention does not use esp dynamically, just making it point bottom of
stack frame after all push is done.*/

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;;

push_args_on_stack(struct arguments *args, void **esp)
{
void **arg_ptrs = (void **) calloc (args->argc, sizeof (void *));
void *curr = (char *) PHYS_BASE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use esp, not PHYS_BASE.

void *dest;

/* Push arguments on stack, save their address in arg_ptrs. */
for(i = (args->argc - 1); i >= 0; i--)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after for, remove parenthesis wrapping args->argc - 1.

{
arg_len = strlen (args->argv[i]) + 1;
dest = curr - arg_len;
memcpy (dest, (args->argv[i]), arg_len);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove parenthesis

Copy link
Owner

@hangpark hangpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're using curr -= WORD_SIZE and --curr both. Use just one. I prefer second one. And then you might not need WORD_SIZE.

int argc;
char **argv;
};

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blank line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault

static bool load (const char *cmdline, void (**eip) (void), void **esp);
static bool load (struct arguments *args, void (**eip) (void), void **esp);

static void argument_parser(char *str, struct arguments *args);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented that this method should be above start_process but this has not been fixed yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is now part of process_execute(), and not called in start_process(). And, in load(), all of its helper function prototypes are defined just above its declaration. So I placed this prototype here, just above process_execute().

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll follow you. then, plz remove gap between load() and argument_parser().

@@ -29,6 +43,7 @@ tid_t
process_execute (const char *file_name)
{
char *fn_copy;
struct arguments *args = (struct arguments *) malloc (sizeof *args);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw your reply now. Please tag me with # symbol for outdated comment 😃

But still, then does sizeof (struct arguments) invoke an error? If not, I'd like to recommend you to use this instead of getting size from variable args by sizeof *args. What do you think about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tried it, wondering why sizeof cannot calculate a size of structure pointers, but it still invoked an error, with same message. Following this now, since I can't figure out how I could get size of structure pointer without this syntax.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your error appearing during building?

struct arguments *args =  (struct arguments *) malloc (sizeof (struct arguments));

This works very well in my env. Please let me know your error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be problem with this. Since this problem was solved, the above solution now works. Changing it as suggested.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Be careful limit length of line (80)!!!!

@@ -38,19 +53,43 @@ process_execute (const char *file_name)
return TID_ERROR;
strlcpy (fn_copy, file_name, PGSIZE);

/* Parse argument, save it in structure. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about Parse arguments into the structure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay..

free(args);
palloc_free_page (fn_copy);
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault.

char *curr;

args->argc = 0;
args->argv = (char **) calloc ((strlen (str_input) + 1), sizeof (char));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you fix this code as I requested?

Copy link
Contributor Author

@Lment Lment Apr 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

char * is changed to char. Previously it was char *. It is a minimum memory for argv, I suppose.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean parenthesis.

args->argv = (char **) calloc ((strlen (str_input) + 1), sizeof (char));

for (curr = strtok_r (str_input, " ", &leftover);
curr != NULL; curr = strtok_r (NULL, " ", &leftover))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you fix this code as I requested? Please always write the reply why you disagree my request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is about 113 or more characters which is longer than 80, so it should be divided.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean CHANGE

  for (curr = strtok_r (str_input, " ", &leftover);
       curr != NULL; curr = strtok_r (NULL, " ", &leftover))

TO

  for (curr = strtok_r (str_input, " ", &leftover); curr != NULL;
       curr = strtok_r (NULL, " ", &leftover))

NOT

  for (curr = strtok_r (str_input, " ", &leftover); curr != NULL; curr = strtok_r (NULL, " ", &leftover))

push_args_on_stack(struct arguments *args, void **esp)
{
void **arg_ptrs = (void **) calloc (args->argc, sizeof (void *));
void *curr = (char *) *esp;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why (char *)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault.

alignment = ((uint32_t) curr) % WORD_SIZE;
for(i = 0; i < alignment ; i++)
{
curr -= 1;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that was my mistake. Sorry. Please combine these two into memcpy (--curr, ~~~~~).

@@ -17,9 +17,23 @@
#include "threads/palloc.h"
#include "threads/thread.h"
#include "threads/vaddr.h"
#include "threads/malloc.h"

#define WORD_SIZE sizeof(uintptr_t)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sizeof uintptr_t

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sizeof uintptr_t invokes syntax error when referencing WORD_SIZE. Similarly, sizeof char too. It seems it needs parenthesis to count something's size.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, why no spacing? 😠


#define WORD_SIZE sizeof(uintptr_t)

/* Structure for argument, which saves arguments in argv,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not count the number of args. Just saves it.

Structure for arguments. would be enough I think. And add right comment (//) for each member like in threads/thread.h

@Lment Lment force-pushed the iss/4 branch 2 times, most recently from 68b28f7 to 04e5c67 Compare April 7, 2017 18:30
Copy link
Owner

@hangpark hangpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should update your local branch to the origin.

@Lment Lment force-pushed the iss/4 branch 2 times, most recently from 9d13291 to 415d37b Compare April 7, 2017 18:55
struct arguments
{
int argc; /* Argument counter which saves calculated number of arguments. */
char **argv; /* Argument vector, which saves arguments in array of strings. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does these two lines fit in 80 letters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified.

#define WORD_SIZE sizeof (uintptr_t)

/* Structure for arguments, which saves arguments in argv,
and saves the number of arguments. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not need which saves ~~~ of arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified.

and saves the number of arguments. */
struct arguments
{
int argc; /* Argument counter which saves calculated number of arguments. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of arguments. is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified.

struct arguments
{
int argc; /* Argument counter which saves calculated number of arguments. */
char **argv; /* Argument vector, which saves arguments in array of strings. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array of arguments. is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified.

@@ -29,6 +41,7 @@ tid_t
process_execute (const char *file_name)
{
char *fn_copy;
struct arguments *args = (struct arguments *) malloc (sizeof (struct arguments));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this line fit in 80 letters?

Copy link
Contributor Author

@Lment Lment Apr 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hangpark this line has 84 characters, So it should be divided.
In my opinion :

  struct arguments *args = 
  (struct arguments *) malloc (sizeof (struct arguments));

   struct arguments *args = (struct arguments *) 
                            malloc (sizeof (struct arguments));

   struct arguments *args = (struct arguments *) malloc
                            (sizeof (struct arguments));

could be used to follow convention. What would you suggest? I think third one is most appropriate.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just separate declaration and initialization.

@@ -38,19 +51,42 @@ process_execute (const char *file_name)
return TID_ERROR;
strlcpy (fn_copy, file_name, PGSIZE);

/* Parse argument into the structure. */
argument_parser (fn_copy, args);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move initialization to here, between comment and caller.

Copy link
Owner

@hangpark hangpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost done....!! 😆

curr -= WORD_SIZE;
memcpy (curr, &arg_ptrs[i], WORD_SIZE);
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line would be better 😃

curr -= WORD_SIZE;
memcpy (curr, &zero, WORD_SIZE);

/* esp pointing bottom of the stack */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comma at the last and change esp to ESP.


/* Push arguments on newly initialized stack, following calling conventions.
This invention does not use esp dynamically, just making it point bottom of
stack frame after all push is done.*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second and third line are not aligned vertically with the first line.

curr -= WORD_SIZE;
memcpy (curr, &zero, WORD_SIZE);

/* Esp pointing bottom of the stack */
Copy link
Owner

@hangpark hangpark Apr 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why din't you fix all my requests?

curr -= WORD_SIZE;
memcpy (curr, &zero, WORD_SIZE);

/* esp pointing bottom of the stack. */
Copy link
Owner

@hangpark hangpark Apr 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code were
esp pointing bottom of the stack no comma
and I want
ESP pointing bottom of the stack .

But you changed yours to
Esp pointing bottom of the stack no comma

and I asked once again, you gave
esp pointing bottom of the stack .
without any reason.

What's the reason? If there is no reason, what's the problem with you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. I misunderstood the comment.

curr -= WORD_SIZE;
memcpy (curr, &zero, WORD_SIZE);

/* Esp pointing bottom of the stack. */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code were
esp pointing bottom of the stack no comma
and I want
ESP pointing bottom of the stack .

But you changed yours to
Esp pointing bottom of the stack no comma

and I asked once again, you gave
esp pointing bottom of the stack .

Finally, you still don't accept my request.
Esp pointing bottom of the stack .

Compare my suggestion and yours:
ESP pointing bottom of the stack .
Esp pointing bottom of the stack .

Is this too hard to understand?

Now an execution of process supports multiple arguments,
by pushing arguments onto stack that has been previously allocated,
but not used. esp now points bottom of the stack frame, which is extended
from PHYS_BASE to accommodate arguments and pointers to that
arguments.

This implementation is now following calling convention, which
is defined in pintos manual.
@hangpark hangpark merged commit d5a019f into develop Apr 8, 2017
@hangpark hangpark deleted the iss/4 branch April 8, 2017 12:28
@hangpark hangpark mentioned this pull request Apr 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants