diff --git a/Makefile.build b/Makefile.build index e997d2787543cb4860edff352660dea9ae350bcf..2989dec293f4810e3699e1ed16fda46804dfb59b 100644 --- a/Makefile.build +++ b/Makefile.build @@ -55,6 +55,7 @@ lib/kernel_SRC += lib/kernel/console.c # printf(), putchar(). # User process code. userprog_SRC = userprog/process.c # Process loading. +userprog_SRC += userprog/populate_stack.c # Populates stack with program arguments. userprog_SRC += userprog/pagedir.c # Page directories. userprog_SRC += userprog/exception.c # User exception handler. userprog_SRC += userprog/syscall.c # System call handler. diff --git a/userprog/argument_parsing.h b/userprog/argument_parsing.h new file mode 100644 index 0000000000000000000000000000000000000000..78be27f44035bdf14e2f6f9dbb867978bd527a99 --- /dev/null +++ b/userprog/argument_parsing.h @@ -0,0 +1,12 @@ +#ifndef USERPROG_ARGUMENT_PARSING_H +#define USERPROG_ARGUMENT_PARSING_H + +/* + * Given stack pointer `esp`, argument count `argc` and arguments array `argv`, + * Populates the stack pointed to by the stack pointer with the given arguments. + * TODO: clarify what, if anything, `esp` stands for and rename it to something + * clearer if possible. + */ +void populate_stack(void* esp, int argc, char** argv); + +#endif /* userprog/argument_parsing.h */ diff --git a/userprog/populate_stack.c b/userprog/populate_stack.c new file mode 100644 index 0000000000000000000000000000000000000000..6a7bb2e4897aa6e05b7cd050e2ebff4e41445525 --- /dev/null +++ b/userprog/populate_stack.c @@ -0,0 +1,6 @@ +#include "userprog/argument_parsing.h" + + +void populate_stack(void* esp, int argc, char** argv) { + #warning "Implement me" +}