Commit Graph

  • a69b9c808e Update start_process to acquire filesys lock when loading user process file Themis Demetriades 2024-11-12 14:21:33 +00:00
  • 7d9900c6d8 Merge branch 'exec-missing-validation' into 'master' Demetriades, Themis 2024-11-11 23:25:26 +00:00
  • 72afecfbda Add validation to check for missing files in exec() args EDiasAlberto 2024-11-11 23:10:02 +00:00
  • 9e692ced9e Merge branch 'userprog-merge' into 'master' Demetriades, Themis 2024-11-11 22:59:45 +00:00
  • f194fa1fa8 Merge branch 'userprog-merge' into 'master' Demetriades, Themis 2024-11-11 22:56:28 +00:00
  • e8713e26c6 Update variable references between conflicting merges to refer to the same data in stack initialization userprog-merge Themis Demetriades 2024-11-11 22:51:19 +00:00
  • 47c3657b65 Merge branch 'process-wait' into 'userprog-merge' Demetriades, Themis 2024-11-11 22:24:39 +00:00
  • 4eafdf10ba Merge branch 'read-only-exec' into 'userprog-merge' Demetriades, Themis 2024-11-11 22:23:20 +00:00
  • 14a4841772 Fix bug where size of file name buffer was less than maximum file name size userprog-stack-init Themis Demetriades 2024-11-11 22:13:10 +00:00
  • 52fdd47e0c Fix race condition in the passing of data from thread executing process_execute to its child Themis Demetriades 2024-11-11 21:51:38 +00:00
  • 049fc5559c Reformat stack initialization code to follow style for length and spacing Themis Demetriades 2024-11-11 21:20:53 +00:00
  • 98a5818406 add file_deny_write and file_allow_write to process creation and exiting to make executable read-only EDiasAlberto 2024-11-11 17:55:24 +00:00
  • 18c884234d Fix race-condition in process result (memory leak), fix infinite loop in donors_list Gleb Koval 2024-11-11 17:35:49 +00:00
  • 5b1e4b561b merge process-wait EDiasAlberto 2024-11-11 15:50:21 +00:00
  • b8d358ecb2 Update stack initialization to handle overflow by allocating a second page for argument pointers Themis Demetriades 2024-11-11 13:13:21 +00:00
  • 8b2fc86b51 Refactor process_init_stack to reduce code duplication Themis Demetriades 2024-11-10 14:34:38 +00:00
  • 324301e7b3 Update process_execute function comment to reflect new function arguments Themis Demetriades 2024-11-10 13:43:22 +00:00
  • 0ac46db2e4 Refactor process initialization to obtain name of process file in process_execute Themis Demetriades 2024-11-10 13:41:08 +00:00
  • 795d81b7ad Update process_init_tack saveptr argument name to cmd_savetpr for clarity Themis Demetriades 2024-11-10 11:33:29 +00:00
  • 6018c0f6ec Refactor process_init_stack to not surpass 80 character limit Themis Demetriades 2024-11-10 11:25:20 +00:00
  • f0dae74cf3 Update stack initialization alignment calculation to use WORD_SIZE constant for clarity Themis Demetriades 2024-11-10 11:24:51 +00:00
  • a165107f5f Update process execution related function argument names to be more accurate Themis Demetriades 2024-11-10 11:17:22 +00:00
  • b37f205334 Update process_init_stack to return success, refactoring error handling to occur inside start_process Themis Demetriades 2024-11-10 11:13:11 +00:00
  • 1bfd73b202 Comment syscall functions and handlers EDiasAlberto 2024-11-10 01:32:48 +00:00
  • 7778e05aa4 Fix deadlock by release of lock and semaphore in the wrong order Gleb Koval 2024-11-09 11:06:36 +00:00
  • 115c650c55 Fix Bug in thread initialisation: only init hash if USERPROG is defined sBubshait 2024-11-08 19:10:42 +00:00
  • 5ed999bc9c Refactor push_to_stack helper to match style of other helper functions Themis Demetriades 2024-11-08 16:53:30 +00:00
  • e40794e672 Fix Bug in fd_get_file: In case fd not found, then returns NULL, w/ E sBubshait 2024-11-08 16:48:19 +00:00
  • a19f02fad7 Move user process stack initialization into a helper function Themis Demetriades 2024-11-08 16:46:18 +00:00
  • 8912ef4660 Implement writing to file system files in the write system call, w/ E sBubshait 2024-11-08 16:26:40 +00:00
  • 18694d7b62 Implement file reading syscall and fix fd validation w/ S. EDiasAlberto 2024-11-08 16:25:49 +00:00
  • 2a1cc3c361 Implement filesize and tell system calls, w/ E sBubshait 2024-11-08 16:14:41 +00:00
  • 3cfbe198e0 Implement syscall for seek w/ S. EDiasAlberto 2024-11-08 16:10:46 +00:00
  • 75bd3fbde0 Implement syscall for close() and fix typing bug in fd_get_file w/ S. EDiasAlberto 2024-11-08 16:02:51 +00:00
  • b866fa88cd Refactor process.c to use FNAME_MAX_LEN constant Themis Demetriades 2024-11-08 15:54:47 +00:00
  • a80084e907 Fix Bug in fd_get_file declaration use open_file instead of file, w/ E sBubshait 2024-11-08 15:54:28 +00:00
  • 5424276603 Add a helper function to get a file from its descriptor (FD), w/ E sBubshait 2024-11-08 15:50:48 +00:00
  • b64434fb9d Move definition of maximum file name length from <syscall> to file.h Themis Demetriades 2024-11-08 15:41:35 +00:00
  • 92e93b8060 Implement syscall for file opening and refactor open_files initialisation in thread.c w/ S. EDiasAlberto 2024-11-08 15:33:47 +00:00
  • 5bd94894e0 Update thread structure to add a hash table of open files and initialise it, w/ E sBubshait 2024-11-08 15:13:04 +00:00
  • 5bbe7a03c0 Add in syscall hash helper functions for open_file struct: fd_hash and fd_less, w/ E sBubshait 2024-11-08 15:12:08 +00:00
  • b112824a64 Implement the exec system call through process_execute, w/ E sBubshait 2024-11-08 14:41:27 +00:00
  • dca9d8f5a3 Implement syscall for file removal w/ S. EDiasAlberto 2024-11-08 14:35:23 +00:00
  • a8676f2e09 Implement syscall for file creation, with relevant locks w/ S. EDiasAlberto 2024-11-08 14:34:08 +00:00
  • 26e38be761 Update validate_user_pointer to check if the ptr is mapped to a physical memory address, w/ E sBubshait 2024-11-08 14:21:16 +00:00
  • 6ed1ccd21e Fix process_result locking by acquiring in process_wait as well to prevent freeing memory too early Gleb Koval 2024-11-08 10:50:10 +00:00
  • 84fe637c7e Remove process_result lock since it is an invalid solution Gleb Koval 2024-11-08 09:16:18 +00:00
  • d95894085b Implement syscall_exec via process_execute Gleb Koval 2024-11-08 09:15:22 +00:00
  • fde70dcf59 Implement process_wait. Gleb Koval 2024-11-08 03:56:05 +00:00
  • 7349b4e66f Fix typo list_insert -> list_push_back for thread.child_results Gleb Koval 2024-11-08 03:55:34 +00:00
  • ec8547aec9 Implement creation of process results Gleb Koval 2024-11-08 03:31:48 +00:00
  • ddcd59fdf8 Add child and own process result information to struct thread Gleb Koval 2024-11-08 02:52:38 +00:00
  • ed09e0b08e Merge branch 'system-calls' into 'master' Demetriades, Themis 2024-11-07 19:36:29 +00:00
  • 39018419cd Fix Bug in Process.c to print the exit statement in process_exit instead of exit syscall to handle unexpected/bad exits sBubshait 2024-11-07 12:15:29 +00:00
  • 6a3cf67d33 Fix Bug in process.c initialising a char to NULL sBubshait 2024-11-07 11:55:26 +00:00
  • 2bfde66d22 Merge remote-tracking branch 'origin/user-programs-stdout' into system-calls sBubshait 2024-11-07 11:45:36 +00:00
  • 273fb48b31 Fix stack initialization to pass stack addreses (rather than thread addresses) for the arguments and only pass name a single time Themis Demetriades 2024-11-07 00:40:52 +00:00
  • 26ae7ac02e Fix bug in stack creation which would count one extra argument for argc Themis Demetriades 2024-11-06 23:57:48 +00:00
  • 1ca9d09512 Update exit () syscall to print correct termination message Themis Demetriades 2024-11-06 23:01:10 +00:00
  • b2764cfa0c Revert setup_stack pointer decrement 'hack' faking stack initialization Themis Demetriades 2024-11-06 22:46:11 +00:00
  • 4020a140d2 Fix removal of 'timer.h' include needed for calling timer_sleep in process module Themis Demetriades 2024-11-06 22:36:43 +00:00
  • 87dd84a9b9 Merge branch 'user-programs' into 'user-programs-stdout' Demetriades, Themis 2024-11-06 22:21:28 +00:00
  • 014642c789 Merge branch 'user-programs-stdout' into 'user-programs' Demetriades, Themis 2024-11-06 22:20:48 +00:00
  • dfa42b9d25 Merge branch 'user-programs' into 'system-calls' Dias Alberto, Ethan 2024-11-06 16:57:10 +00:00
  • 1a4afc9ec7 Merge branch 'system-calls' into 'user-programs' Dias Alberto, Ethan 2024-11-06 16:56:43 +00:00
  • 5535cbae24 Merge branch 'master' into 'system-calls' Dias Alberto, Ethan 2024-11-06 16:45:53 +00:00
  • f685086d05 Merge branch 'refactor-semaphore' into 'master' Dias Alberto, Ethan 2024-11-06 16:42:26 +00:00
  • 2fefdef605 Merge branch 'user-programs-temporary-fix' into 'user-programs' Dias Alberto, Ethan 2024-11-06 16:41:49 +00:00
  • fcb7e9e441 Update setup_stack to temporarily fake set-up for a stack to prevent page faults in no arg user programs sBubshait 2024-11-06 15:48:27 +00:00
  • ab716de0a6 Update process_wait to temporarily sleep for 1 second to allow user programs to run sBubshait 2024-11-06 15:46:47 +00:00
  • 91cef4d650 Refactor lock release and sema up to remove unnecessary code sBubshait 2024-11-06 15:36:56 +00:00
  • b0c1923d44 Update stack argument initialization behaviour to terminate creation of process on failing memory allocations Themis Demetriades 2024-11-06 12:28:58 +00:00
  • 5aac37d167 Add temporary fixes to process_wait and setup stack, w/ E sBubshait 2024-11-05 23:28:17 +00:00
  • 02fff62ca2 Refactor syscall.c to follow PintOS styling, w/ E sBubshait 2024-11-05 23:24:41 +00:00
  • f4290c31f3 Implement syscall_read for console input w/ S. EDiasAlberto 2024-11-05 23:20:18 +00:00
  • 01933cb5de Implement the write system call, w/ E sBubshait 2024-11-05 23:07:07 +00:00
  • b3e23eb1cc Implement system call wait w/ S. EDiasAlberto 2024-11-05 22:48:35 +00:00
  • 421f2c1206 Refactor function names and includes in syscall.c to avoid conflicts w/ S. EDiasAlberto 2024-11-05 22:46:21 +00:00
  • e9c4061531 Implement the exit system call, w/ E sBubshait 2024-11-05 22:38:45 +00:00
  • 2dccd87a76 Update thread to add exit_status, intialised to -1, into the thread structure, w/ E sBubshait 2024-11-05 22:38:09 +00:00
  • b4c41b0a6a Remove superfluous include in process.c Themis Demetriades 2024-11-04 12:57:29 +00:00
  • 2a890d5bd2 Reformat calculation of padding size in stack set-up to increase clarity Themis Demetriades 2024-11-04 12:54:18 +00:00
  • 6c6ce77824 Implement complete stack initialization for user processes, without accounting for overflow Themis Demetriades 2024-11-04 01:11:19 +00:00
  • f8e529e877 Add UNUSED tag to system call function skeletons w/ S. EDiasAlberto 2024-11-04 01:02:04 +00:00
  • 2a9ab5ec97 fix merge conflicts EDiasAlberto 2024-11-04 01:00:33 +00:00
  • 4c27aa0203 Complete syscall lookup table, and syscall stubs and skeletons w/ S. EDiasAlberto 2024-11-04 00:57:19 +00:00
  • 5e2342fad7 Update syscall to make syscall_number an unsigned integer instead of an int sBubshait 2024-11-04 00:49:47 +00:00
  • 0d057da3dc Refactor syscall to follow PintOS style in adding space after after function name in calls sBubshait 2024-11-04 00:48:36 +00:00
  • 79f6a8e808 Fix Bug in syscall handler related to pointer arithmetic: add sizeof uintptr_t instead of 1 sBubshait 2024-11-04 00:44:55 +00:00
  • 3a258cf064 Update validate_user_pointer to perform no memory checks when size is 0 sBubshait 2024-11-04 00:38:58 +00:00
  • e718159ed8 Update syscall to use screaming uppercase casing for a constant sBubshait 2024-11-04 00:29:07 +00:00
  • ade8faf0f4 Update syscall to add more comments explaining the basic handler sBubshait 2024-11-04 00:20:09 +00:00
  • 6f9c911ebe Update start_process to pad process stack before pushing argv elements for performance Themis Demetriades 2024-11-04 00:19:36 +00:00
  • 62d2cb54e5 Update start_process to push pointers to process arguments onto the process thread's stack Themis Demetriades 2024-11-04 00:16:04 +00:00
  • 92c681ff02 Reformat start_process stack initialization code to follow style Themis Demetriades 2024-11-04 00:04:08 +00:00
  • 34d6c15d73 Update start_process to push process argument values to its thread's stack Themis Demetriades 2024-11-04 00:00:56 +00:00
  • d626b7a392 Implement basic syscall_handler using the lookup table, w/ E sBubshait 2024-11-03 23:47:22 +00:00
  • 87126237ad Implement function to validate user memory pointers w/ S. EDiasAlberto 2024-11-03 23:20:42 +00:00
  • 62453ef432 Add a look up table from system call numbers to their handler functions, w/ E sBubshait 2024-11-03 22:54:03 +00:00
  • c0f85a6bcc Implement skeleton for exit command w/ S. EDiasAlberto 2024-11-03 22:36:22 +00:00