Commit Graph

350 Commits

Author SHA1 Message Date
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
6ed1ccd21e Fix process_result locking by acquiring in process_wait as well to prevent freeing memory too early 2024-11-08 10:50:10 +00:00
84fe637c7e Remove process_result lock since it is an invalid solution
TODO : synchronise process_result in another way
2024-11-08 09:16:18 +00:00
d95894085b Implement syscall_exec via process_execute 2024-11-08 09:15:22 +00:00
fde70dcf59 Implement process_wait. 2024-11-08 03:56:15 +00:00
7349b4e66f Fix typo list_insert -> list_push_back for thread.child_results 2024-11-08 03:55:34 +00:00
ec8547aec9 Implement creation of process results 2024-11-08 03:31:48 +00:00
ddcd59fdf8 Add child and own process result information to struct thread 2024-11-08 03:30:58 +00:00
Demetriades, Themis
ed09e0b08e Merge branch 'system-calls' into 'master'
Add support for some basic system calls and args handling correctly.

See merge request lab2425_autumn/pintos_22!29
2024-11-07 19:36:29 +00:00
sBubshait
39018419cd Fix Bug in Process.c to print the exit statement in process_exit instead of exit syscall to handle unexpected/bad exits 2024-11-07 12:15:29 +00:00
sBubshait
6a3cf67d33 Fix Bug in process.c initialising a char to NULL 2024-11-07 11:55:26 +00:00
sBubshait
2bfde66d22 Merge remote-tracking branch 'origin/user-programs-stdout' into system-calls 2024-11-07 11:45:36 +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
Demetriades, Themis
87dd84a9b9 Merge branch 'user-programs' into 'user-programs-stdout'
Merge basic system calls with stack set-up infrastructure

See merge request lab2425_autumn/pintos_22!27
2024-11-06 22:21:28 +00:00
Demetriades, Themis
014642c789 Merge branch 'user-programs-stdout' into 'user-programs'
# Conflicts:
#   src/userprog/process.c
2024-11-06 22:20:48 +00:00
Dias Alberto, Ethan
dfa42b9d25 Merge branch 'user-programs' into 'system-calls'
Implement fake stack and temporary timer change

See merge request lab2425_autumn/pintos_22!26
2024-11-06 16:57:10 +00:00
Dias Alberto, Ethan
1a4afc9ec7 Merge branch 'system-calls' into 'user-programs'
# Conflicts:
#   src/userprog/process.c

Fix conflict in differing placeholder process_wait implementations
2024-11-06 16:56:43 +00:00
Dias Alberto, Ethan
5535cbae24 Merge branch 'master' into 'system-calls'
Merge refactor and removal of duplicated code into section-specific branch

See merge request lab2425_autumn/pintos_22!25
2024-11-06 16:45:53 +00:00
Dias Alberto, Ethan
f685086d05 Merge branch 'refactor-semaphore' into 'master'
Refactor synch.c to remove code duplication in lock release

See merge request lab2425_autumn/pintos_22!23
2024-11-06 16:42:26 +00:00
Dias Alberto, Ethan
2fefdef605 Merge branch 'user-programs-temporary-fix' into 'user-programs'
Temporary fixes for process waiting and stack setup to allow simple user programs to run

See merge request lab2425_autumn/pintos_22!24
2024-11-06 16:41:49 +00:00