It's UWAweek 19

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected announcement
Showing 1 of 1168 articles.
Currently 24 other people reading this forum.


SVG not supported

Login to reply

👍?
helpful
5:14am Sun 24th Sep, Christopher M.

You may find a copy of the 1st project's sample solution from [CITS2002] Please review the sample; it's written with (only) arrays and structures, and (as promised) does not employ any pointers to define or manage its data-structures. (With all comments, blank lines, extra functions, and debug printing removed) the solution is about 480 lines long. Hopefully the use of (32) clear function names makes their use and control-flow easy to follow: int main(int argc, char *argv[]) void read_sysconfig(char argv0[], char filename[]) void add_device(char name[], int read_speed, int write_speed) void dump_sysconfig(void) void read_commands(char argv0[], char filename[]) void add_command(char line[]) void add_syscall_to_command(char line[]) int find_command_byname(char name[]) int find_device_byname(char name[]) int find_syscall_byname(char name[]) void dump_commands(void) void init_READY_queue(void) void init_SLEEPING_queue(void) void init_WAITING_queue(void) void init_devices_and_IO_BLOCKED_queues(void) void init_processes(void) int execute_commands(int first) void append_to_READY_queue(int proc, char came_from[]) int dequeue_READY_queue(void) void advance_time(int inc) void spawn_process(int command, int ppid) void append_to_SLEEPING_queue(int proc_on_CPU, int duration) void append_to_WAITING_queue(int proc_on_CPU) void append_to_IO_BLOCKED_queue(int proc_on_CPU, int syscall, int device, int nbytes) void exit_process(int proc_on_CPU) void unblock_SLEEPING(void) void unblock_WAITING(void) void unblock_completed_IO(void) void start_pending_IO(void) int find_fastest_ready_device(void) Comments and feedback always welcome. At the conclusion of all deadlines, there are 260 submissions, 126 from teams-of-2.



This article has 1 attachment:

 

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy