Commit Graph
85 Commits
Author SHA1 Message Date
Themis Demetriades df7d847978 fix: remove stack fault checks for page faults outside user non-present addresses 2024-12-02 21:07:17 +00:00
Themis Demetriades 6190d1bee6 fix: disable dynamic stack growth when VM flag is disabled 2024-12-02 20:44:54 +00:00
Themis Demetriades 6adf2e743b refactor: dynamic stack growth functions to follow code style 2024-12-02 19:50:40 +00:00
Themis Demetriades 05a48cf9c6 refactor: page fault exception handler follows code style 2024-12-01 23:36:55 +00:00
Themis Demetriades bb16abdc0d refactor: supplemental page table helper functions follow code style 2024-12-01 23:30:50 +00:00
Themis Demetriades 7ce512305e fix: remove DVM flag when compiling outside of vm directory 2024-12-01 00:41:09 +00:00
Themis Demetriades 6f85d7642d feat: implement clock (second-chance) page eviction algorithm 2024-11-30 22:40:13 +00:00
Themis Demetriades 149bb42889 feat: implement clock (second-chance) page eviction algorithm 2024-11-29 19:30:47 +00:00
Themis Demetriades ea2725f606 feat: implement frame table without thread safety 2024-11-26 15:17:11 +00:00
Themis Demetriades 7947ac78e8 Remove args-ovf user program binary, replacing with source for testing 2024-11-15 13:40:21 +00:00
Themis Demetriades eff0837fdc Update stack initialization code to handle all possible overflows and implement a user program to test this 2024-11-15 13:35:58 +00:00
Themis Demetriades 5e2e7199f2 Fix memory leak in start_process 2024-11-14 21:03:55 +00:00
Themis Demetriades e4036c715f Refactor start_process to hold file system lock for less time 2024-11-14 16:05:15 +00:00
Themis Demetriades 3a46e0f73a Update user proc stack initialization comments to be more helpful 2024-11-14 15:54:34 +00:00
Themis Demetriades 8821851459 Refactor process_execute to remove use of 'goto' 2024-11-14 14:42:26 +00:00
Themis Demetriades 1a2ff35231 Refactor process_execute to pass process start data as a local reference rather than perform memory allocation on the heap 2024-11-14 14:32:48 +00:00
Themis Demetriades d878dbc132 Fix bug in userprog-merge where file writes were denied in the wrong thread 2024-11-12 16:22:32 +00:00
Themis Demetriades b0400693ae Update process_execute to acquire lock when checking if file exists 2024-11-12 16:12:24 +00:00
Themis Demetriades 3418425f20 Don't acquire filesys lock when calling exec 2024-11-12 16:08:27 +00:00
Themis Demetriades a69b9c808e Update start_process to acquire filesys lock when loading user process file 2024-11-12 14:21:33 +00:00
Themis Demetriades e8713e26c6 Update variable references between conflicting merges to refer to the same data in stack initialization 2024-11-11 22:51:19 +00:00
Themis Demetriades 14a4841772 Fix bug where size of file name buffer was less than maximum file name size 2024-11-11 22:13:10 +00:00
Themis Demetriades 52fdd47e0c Fix race condition in the passing of data from thread executing process_execute to its child 2024-11-11 21:51:38 +00:00
Themis Demetriades 049fc5559c Reformat stack initialization code to follow style for length and spacing 2024-11-11 21:20:53 +00:00
Themis Demetriades b8d358ecb2 Update stack initialization to handle overflow by allocating a second page for argument pointers 2024-11-11 13:13:21 +00:00
Themis Demetriades 8b2fc86b51 Refactor process_init_stack to reduce code duplication 2024-11-10 14:34:38 +00:00
Themis Demetriades 324301e7b3 Update process_execute function comment to reflect new function arguments 2024-11-10 13:43:22 +00:00
Themis Demetriades 0ac46db2e4 Refactor process initialization to obtain name of process file in process_execute 2024-11-10 13:41:08 +00:00
Themis Demetriades 795d81b7ad Update process_init_tack saveptr argument name to cmd_savetpr for clarity 2024-11-10 11:33:29 +00:00
Themis Demetriades 6018c0f6ec Refactor process_init_stack to not surpass 80 character limit 2024-11-10 11:25:20 +00:00
Themis Demetriades f0dae74cf3 Update stack initialization alignment calculation to use WORD_SIZE constant for clarity 2024-11-10 11:24:51 +00:00
Themis Demetriades a165107f5f Update process execution related function argument names to be more accurate 2024-11-10 11:17:22 +00:00
Themis Demetriades b37f205334 Update process_init_stack to return success, refactoring error handling to occur inside start_process 2024-11-10 11:13:11 +00:00
Themis Demetriades 5ed999bc9c Refactor push_to_stack helper to match style of other helper functions 2024-11-08 16:53:30 +00:00
Themis Demetriades a19f02fad7 Move user process stack initialization into a helper function 2024-11-08 16:46:18 +00:00
Themis Demetriades b866fa88cd Refactor process.c to use FNAME_MAX_LEN constant 2024-11-08 15:54:47 +00:00
Themis Demetriades b64434fb9d Move definition of maximum file name length from <syscall> to file.h 2024-11-08 15:41:35 +00:00
Themis Demetriades 273fb48b31 Fix stack initialization to pass stack addreses (rather than thread addresses) for the arguments and only pass name a single time 2024-11-07 00:40:52 +00:00
Themis Demetriades 26ae7ac02e Fix bug in stack creation which would count one extra argument for argc 2024-11-06 23:57:48 +00:00
Themis Demetriades 1ca9d09512 Update exit () syscall to print correct termination message 2024-11-06 23:01:10 +00:00
Themis Demetriades b2764cfa0c Revert setup_stack pointer decrement 'hack' faking stack initialization 2024-11-06 22:46:11 +00:00
Themis Demetriades 4020a140d2 Fix removal of 'timer.h' include needed for calling timer_sleep in process module 2024-11-06 22:36:43 +00:00
Themis Demetriades b0c1923d44 Update stack argument initialization behaviour to terminate creation of process on failing memory allocations 2024-11-06 12:28:58 +00:00
Themis Demetriades b4c41b0a6a Remove superfluous include in process.c 2024-11-04 12:57:29 +00:00
Themis Demetriades 2a890d5bd2 Reformat calculation of padding size in stack set-up to increase clarity 2024-11-04 12:54:18 +00:00
Themis Demetriades 6c6ce77824 Implement complete stack initialization for user processes, without accounting for overflow 2024-11-04 01:11:19 +00:00
Themis Demetriades 6f9c911ebe Update start_process to pad process stack before pushing argv elements for performance 2024-11-04 00:19:36 +00:00
Themis Demetriades 62d2cb54e5 Update start_process to push pointers to process arguments onto the process thread's stack 2024-11-04 00:16:04 +00:00
Themis Demetriades 92c681ff02 Reformat start_process stack initialization code to follow style 2024-11-04 00:04:08 +00:00
Themis Demetriades 34d6c15d73 Update start_process to push process argument values to its thread's stack 2024-11-04 00:00:56 +00:00
Themis Demetriades e26b11cce6 Update setup_stack skeleton to fake minimal stack set-up for testing purposes 2024-11-03 18:04:42 +00:00
Themis Demetriades eb458efa59 Update process_wait skeleton to loop infinitely for testing purposes 2024-11-03 17:38:38 +00:00
Themis Demetriades 4066354f8a Refactor thread_create () to call thread_get_priority in order to retrieve priority 2024-10-25 17:03:18 +01:00
Themis Demetriades 95386971e2 Update lock_release to disable interrupts in critical sections w/ S 2024-10-23 16:45:42 +01:00
Themis Demetriades f9d82c92de Update thread_recalculate_priority to disable interrupts preventing race conditions for access to donors and priorities w/ S 2024-10-23 16:16:25 +01:00
Themis Demetriades 5f8dea21be Fix donate_priority to disable interrupts for entire update of possibly-ready donatee's priority 2024-10-23 14:10:48 +01:00
Themis Demetriades b0074c80f0 Refactor ready_list_reinsert to require being called with interrupts disabled 2024-10-23 13:51:07 +01:00
Themis Demetriades 2cd4da17a4 Refactor donate_priority to only allow for the current thread to donate its priority 2024-10-23 13:42:36 +01:00
Themis Demetriades a875d5fcb4 Update donate_priority to only attempt to sort position of the donee that isn't waiting for a lock 2024-10-23 13:37:43 +01:00
Themis Demetriades 7aec2e6862 Refactor donate_priority to include comments explaining its purpose and logic w/ S 2024-10-22 21:15:30 +01:00
Themis Demetriades 48104b3a41 Refactor cond_signal to add comment clarifying the logic w/ S 2024-10-22 20:57:18 +01:00
Themis Demetriades 6983ccdd3b Update thread_get_priority description comment to be more specific w/ S 2024-10-22 20:41:44 +01:00
Themis Demetriades fc1691f994 Refactor thread.h to remove superfluous thread priority comparison function w/ S 2024-10-22 20:36:37 +01:00
Themis Demetriades 21cbfc9fe0 Implement transfer of orphaned donors when releasing lock w/ S 2024-10-22 20:06:21 +01:00
Themis Demetriades a19d40bcca Reformat priority_more to obey code style 2024-10-22 19:01:55 +01:00
Themis Demetriades f10514f4cc Update priority_more comment description to specify which list_elem member it is compatible with 2024-10-22 18:59:19 +01:00
Themis Demetriades dae5b0d097 Update semaphore priority scheduling to use linear search on unordered list w/ S 2024-10-20 22:50:31 +01:00
Themis Demetriades 840df8af78 Fix bug in donate_priority that wouldn't update the list of donors w/ S 2024-10-20 22:29:20 +01:00
Themis Demetriades afcb12cef0 Reformat thread priority changing functions to follow style w/ S 2024-10-20 20:38:28 +01:00
Themis Demetriades 8e20884a23 Update releasing of locks to update donation information w/ S 2024-10-20 20:17:27 +01:00
Themis Demetriades ee0cf632b9 Fix attempt to donate priority within lock acquisition w/ S 2024-10-20 19:45:05 +01:00
Themis Demetriades f98e4bc81c Update lock_acquire to attempt donation of priorities, w/ S 2024-10-20 19:20:26 +01:00
Themis Demetriades fcc8cbb71e Implement initialization of new threads to track donation information, w/ S 2024-10-20 17:11:44 +01:00
Themis 6b9b671368 Update sema_up to properly yield during execution of an interrupt handler 2024-10-17 20:01:55 +01:00
Themis 711efdc78a Implement priority scheduling for condition variables 2024-10-17 19:43:35 +01:00
Themis Demetriades c32a69a368 Update repository settings to ignore shell scripts 2024-10-15 17:00:02 +01:00
Themis Demetriades 163b7f9016 Update setting of priority of threads to only yield when current thread's priority has been lowered 2024-10-15 15:38:31 +01:00
Themis Demetriades 3c1a26b668 Update setting of thread priorities to yield in case a higher priority thread requires control 2024-10-15 15:14:05 +01:00
Themis Demetriades 54b46806ba Update thread creation to yield thread in case it's no longer the highest priority 2024-10-15 15:12:01 +01:00
Themis Demetriades 6855a48603 Update semaphore code to wake highest priority thread, and run if required 2024-10-15 13:53:48 +01:00
Themis Demetriades 79061fcb9b Update thread module to maintain list of ready threads in descending order of priority 2024-10-15 13:51:41 +01:00
Themis Demetriades d4d5a7a937 Update thread_priority_greater function signature to explicitly signal unused parameter 2024-10-15 12:01:03 +01:00
Themis Demetriades f1fa7d2ffb Reformat thread_priority_greater to fit code style 2024-10-15 11:51:40 +01:00
Themis Demetriades 1821d73b09 Add comparison function for thread list elements based on thread priority 2024-10-15 11:50:04 +01:00
Themis Demetriades 4ed64cf173 Add guard in thread_set_priority ensuring priority values are within correct range 2024-10-15 10:47:38 +01:00