Commit Graph

373 Commits

Author SHA1 Message Date
59e7a64f8e Only check user pages rather than all bytes in-between, for known-size pointers 2024-11-12 15:48:22 +00:00
cf4bf90cbb Implement user pointer checking for C strings 2024-11-12 15:34:45 +00:00
9a6abab95e Check access to user memory using page fault method (via get_user and put_user). 2024-11-12 15:00:16 +00:00
44f6a85163 Add get_user and put_user provided by spec. 2024-11-12 14:50:53 +00:00
83e044cf68 Let kernel handle its own page faults 2024-11-12 14:50:53 +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
Demetriades, Themis
7d9900c6d8 Merge branch 'exec-missing-validation' into 'master'
Add validation to check for missing files in exec() args

See merge request lab2425_autumn/pintos_22!36
2024-11-11 23:25:26 +00:00
EDiasAlberto
72afecfbda Add validation to check for missing files in exec() args 2024-11-11 23:10:02 +00:00
Demetriades, Themis
9e692ced9e Merge branch 'userprog-merge' into 'master'
Update variable references between conflicting merges to refer to the same...

See merge request lab2425_autumn/pintos_22!35
2024-11-11 22:59:45 +00:00
Demetriades, Themis
f194fa1fa8 Merge branch 'userprog-merge' into 'master'
Implement complete stack initialization, process_wait, and all system calls correctly except exec

See merge request lab2425_autumn/pintos_22!34
2024-11-11 22:56:28 +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
Demetriades, Themis
47c3657b65 Merge branch 'process-wait' into 'userprog-merge'
Fix race-condition in process result (memory leak), fix infinite loop in donors_list

See merge request lab2425_autumn/pintos_22!33
2024-11-11 22:24:39 +00:00
Demetriades, Themis
4eafdf10ba Merge branch 'read-only-exec' into 'userprog-merge'
Combine syscall code with final stack initialization code

See merge request lab2425_autumn/pintos_22!32
2024-11-11 22:23:20 +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
EDiasAlberto
98a5818406 add file_deny_write and file_allow_write to process creation and exiting to make executable read-only 2024-11-11 17:55:24 +00:00
18c884234d Fix race-condition in process result (memory leak), fix infinite loop in donors_list 2024-11-11 17:35:49 +00:00
EDiasAlberto
5b1e4b561b merge process-wait 2024-11-11 15:50:21 +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
EDiasAlberto
1bfd73b202 Comment syscall functions and handlers 2024-11-10 01:32:58 +00:00
7778e05aa4 Fix deadlock by release of lock and semaphore in the wrong order 2024-11-09 11:06:36 +00:00
sBubshait
115c650c55 Fix Bug in thread initialisation: only init hash if USERPROG is defined 2024-11-08 19:10:42 +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
sBubshait
e40794e672 Fix Bug in fd_get_file: In case fd not found, then returns NULL, w/ E 2024-11-08 16:48:19 +00:00
Themis Demetriades
a19f02fad7 Move user process stack initialization into a helper function 2024-11-08 16:46:18 +00:00
sBubshait
8912ef4660 Implement writing to file system files in the write system call, w/ E 2024-11-08 16:26:47 +00:00
EDiasAlberto
18694d7b62 Implement file reading syscall and fix fd validation w/ S. 2024-11-08 16:25:49 +00:00
sBubshait
2a1cc3c361 Implement filesize and tell system calls, w/ E 2024-11-08 16:14:53 +00:00
EDiasAlberto
3cfbe198e0 Implement syscall for seek w/ S. 2024-11-08 16:10:46 +00:00
EDiasAlberto
75bd3fbde0 Implement syscall for close() and fix typing bug in fd_get_file w/ S. 2024-11-08 16:02:51 +00:00
Themis Demetriades
b866fa88cd Refactor process.c to use FNAME_MAX_LEN constant 2024-11-08 15:54:47 +00:00
sBubshait
a80084e907 Fix Bug in fd_get_file declaration use open_file instead of file, w/ E 2024-11-08 15:54:28 +00:00
sBubshait
5424276603 Add a helper function to get a file from its descriptor (FD), w/ E 2024-11-08 15:50:48 +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
EDiasAlberto
92e93b8060 Implement syscall for file opening and refactor open_files initialisation in thread.c w/ S. 2024-11-08 15:33:47 +00:00
sBubshait
5bd94894e0 Update thread structure to add a hash table of open files and initialise it, w/ E 2024-11-08 15:13:04 +00:00
sBubshait
5bbe7a03c0 Add in syscall hash helper functions for open_file struct: fd_hash and fd_less, w/ E 2024-11-08 15:12:08 +00:00
sBubshait
b112824a64 Implement the exec system call through process_execute, w/ E 2024-11-08 14:41:27 +00:00
EDiasAlberto
dca9d8f5a3 Implement syscall for file removal w/ S. 2024-11-08 14:35:23 +00:00
EDiasAlberto
a8676f2e09 Implement syscall for file creation, with relevant locks w/ S. 2024-11-08 14:34:08 +00:00
sBubshait
26e38be761 Update validate_user_pointer to check if the ptr is mapped to a physical memory address, w/ E 2024-11-08 14:21:16 +00:00