Modestus Moon OS  R4
CS 450 project
comm_list.h
Go to the documentation of this file.
1 #ifndef COMM_LIST_H
2 #define COMM_LIST_H
3 
4 #include <core/mcb.h>
5 #include <input.h>
6 
7 #define MAX_CMD_LIST_LENGTH 50
8 
9 typedef struct s_cmd_struct cmd_struct_t;
10 
12 {
13  const char* cmdName;
14  int (*cmdFunc)(char [][MAX_LENGTH]);
15 };
16 
18 
26 int getNumDaysInMonth(int month, int year);
27 
28 int isEmpty(char parameters[][MAX_LENGTH]);
29 
35 int helpFunc(char parameters[][MAX_LENGTH]);
36 
40 void help();
41 
48 int helpGetVersion();
49 
56 void helpGetDate();
57 
64 void helpSetDate();
65 
70 void helpLoadR3();
71 
78 void helpGetTime();
79 
86 void helpSetTime();
87 
94 void helpShutdown();
95 
100 void helpVersion();
101 
110 void helpDate(char parameters[][MAX_LENGTH]);
111 
120 void helpTime(char parameters[][MAX_LENGTH]);
121 
127 void helpPcb(char parameters[][MAX_LENGTH]);
128 
132 void helpPcbPrint();
133 
134 
135 
139 void helpSuspendPCB();
140 
144 void helpResumePCB();
145 
149 void helpSetPriority();
150 
151 void helpShowPCB();
152 
157 void helpShowAllProcesses();
158 
163 
168 
172 void helpCreatePCB();
173 
177 void helpDeletePCB();
178 
182 void helpBlockPCB();
183 
187 void helpUnblockPCB();
188 
189 
190 /* _______________________________________________ */
191 
198 int version(char parameters[][MAX_LENGTH]);
199 
200 int date(char parameters[][MAX_LENGTH]);
201 
207 void getDate();
208 
225 void setDate(char parameters[][MAX_LENGTH]);
226 
227 int time(char parameters[][MAX_LENGTH]);
228 
234 void getTime();
235 
248 void setTime(char parameters[][MAX_LENGTH]);
249 
255 int shutdownFunc(char parameters[][MAX_LENGTH]);
256 
257 
258 
264 int pcbFunc(char parameters[][MAX_LENGTH]);
265 
271 int suspendPCB(char parameters[][MAX_LENGTH]);
272 
278 int resumePCB(char parameters[][MAX_LENGTH]);
279 
288 int setPriority(char * procName, char * procPrio);
289 
294 int showPCB(char parameters[][MAX_LENGTH]);
295 
299 int showAllProcesses(char parameters[][MAX_LENGTH]);
300 
304 int showReadyProcesses(char parameters[][MAX_LENGTH]);
305 
310 int showBlockedProcesses(char parameters[][MAX_LENGTH]);
311 
319 int createPCB(const char* pcbName, const char* pcbPriority, const char* pcbClass);
320 
326 int deletePCB(char parameters[][MAX_LENGTH]);
327 
333 int blockPCB(char parameters[][MAX_LENGTH]);
334 
339 int unblockPCB(char parameters[][MAX_LENGTH]);
340 
346 int yield();
347 
353 int loadr3(char parameters[][MAX_LENGTH]);
354 
355 
356 /* MCB FUNCTIONS */
357 
358 
364 int mcbFunc(char parameters[][MAX_LENGTH]);
365 
366 /* HELP FUNCS */
367 
368 
374 void helpMCB(char parameters[][MAX_LENGTH]);
375 
376 
382 void helpMcbPrint();
383 
384 
390 void helpMCBInitHeap();
391 
392 
398 void helpMCBAllocate();
399 
400 
406 void helpMCBFreeMem();
407 
408 
414 void helpMCBIsEmpty();
415 
416 
422 void helpMCBShowFree();
423 
424 
430 void helpMCBShowAllocated();
431 
432 /* END MCB FUNCTIONS */
433 
434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 
445 
446 
447 
448 
449 
450 
451 #endif // COMM_LIST_H
void helpMCBFreeMem()
Prints the details for freeing an mcb.
Definition: comm_list.c:144
int showReadyProcesses(char parameters[][MAX_LENGTH])
showReadyProcesses shows all processes that are ready, in the ready queue (linked list)...
Definition: comm_list.c:759
void helpShowPCB()
Definition: comm_list.c:359
#define MAX_LENGTH
Definition: input.h:6
const char * procName
Definition: mcb.h:43
int time(char parameters[][MAX_LENGTH])
Definition: comm_list.c:479
void helpSetPriority()
helpSetPriority prints out to console the parameters and usage for –setpriority. ...
Definition: comm_list.c:351
int pcbFunc(char parameters[][MAX_LENGTH])
takes in parameters and makes sure its valid then runs what you want to.
Definition: comm_list.c:558
cmd_struct_t cmdArray[MAX_CMD_LIST_LENGTH]
Definition: commhand.c:15
int setPriority(char *procName, char *procPrio)
setPriority sets the priority of a particular process
Definition: comm_list.c:730
void helpBlockPCB()
helpBlockPCB prints out the parameters and usage for blocking a PCB.
Definition: comm_list.c:407
void helpSuspendPCB()
helpSuspendPCB prints the help instructions for the suspendPCB command.
Definition: comm_list.c:335
void helpShutdown()
helpShutdown prints the help instructions for set date. Tells the user what the command and arguments...
Definition: comm_list.c:222
void helpTime(char parameters[][MAX_LENGTH])
helpTime prints out the help information for time, for time –set and time –get
Definition: comm_list.c:261
void helpMCBInitHeap()
prints the all details about the initheap func
Definition: comm_list.c:128
int getNumDaysInMonth(int month, int year)
getNumDaysInMonth is a helper function to allow the easy retrieval of days in a month based on the mo...
Definition: comm_list.c:15
void helpCreatePCB()
helpCreatePCB prints out the parameters and usage for createPCB.
Definition: comm_list.c:391
void setDate(char parameters[][MAX_LENGTH])
setDate sets the system date using the input from the user.
Definition: comm_list.c:453
void getDate()
getDate Get the current date from the system.
Definition: comm_list.c:447
const char * cmdName
Definition: comm_list.h:13
int helpGetVersion()
helpGetVersion prints the help instructions for version. Tells the user what the command and argument...
Definition: comm_list.c:181
int createPCB(const char *pcbName, const char *pcbPriority, const char *pcbClass)
createPCB creates a new PCB and allocates memory for the PCB.
Definition: comm_list.c:773
void helpGetTime()
helpGetTime prints the help instructions for get time. Tells the user what the commands and arguments...
Definition: comm_list.c:206
void help()
help prints out a list of all possible commands and a brief description of what they do...
Definition: comm_list.c:72
int blockPCB(char parameters[][MAX_LENGTH])
blockPCB blocks the specified PCB
Definition: comm_list.c:794
void helpSetDate()
helpSetDate prints the help instructions for set date. Tells the user what the command and arguments ...
Definition: comm_list.c:197
int resumePCB(char parameters[][MAX_LENGTH])
resumePCB resumes the PCB passed in by the user
Definition: comm_list.c:709
void helpVersion()
helpVersion prints the help instructions for using the version command. No arguments are required...
Definition: comm_list.c:231
void helpMCBShowAllocated()
Prints details for showing all the allocated memory blocks in the heap.
Definition: comm_list.c:166
void helpPcb(char parameters[][MAX_LENGTH])
helpPcb takes in the command to print the help information for. Calls the proper function to print th...
Definition: comm_list.c:284
#define MAX_CMD_LIST_LENGTH
Definition: comm_list.h:7
int yield()
stops the exection of commhand and executes each process in the ready queue
Definition: comm_list.c:820
void helpDeletePCB()
helpDeletePCB prints out the parameters and usage for deleting a PCB.
Definition: comm_list.c:399
void helpResumePCB()
helpResumePCB prints out the parameters and usage of the resume pcb command.
Definition: comm_list.c:343
int loadr3(char parameters[][MAX_LENGTH])
loads all processes into memory in a suspended ready state at any priority of the users choosing ...
Definition: comm_list.c:825
void helpSetTime()
helpSetTime prints the help instructions for set time. Tells the user what the command and arguments ...
Definition: comm_list.c:213
void helpShowAllProcesses()
helpShowAllProcesses shows all processes in the system. Takes in no parameters and prints out to the ...
Definition: comm_list.c:367
int mcbFunc(char parameters[][MAX_LENGTH])
takes in whatever you are looking for and checks to see if it can be done for mcb ...
Definition: comm_list.c:904
int deletePCB(char parameters[][MAX_LENGTH])
deletePCB deletes the PCB requested by the user.
Definition: comm_list.c:782
int suspendPCB(char parameters[][MAX_LENGTH])
suspendPCB suspends the pcb passed in by the user
Definition: comm_list.c:688
int unblockPCB(char parameters[][MAX_LENGTH])
unblockPCB unblocks the specified PCB.
Definition: comm_list.c:807
void helpMCB(char parameters[][MAX_LENGTH])
The command handler for mcb&#39;s checking for valid input.
Definition: comm_list.c:93
int version(char parameters[][MAX_LENGTH])
version prints out the current version of the operating system. It will print out R1...
Definition: comm_list.c:425
void helpLoadR3()
helpLoadR3 prints out the help commands for helpLoadR3 Loads all of the processes from procsr3 ...
Definition: comm_list.c:174
void helpGetDate()
helpGetDate prints the help instructions for get date. Tells the user what the command and arguments ...
Definition: comm_list.c:190
void helpMCBAllocate()
Prints the details for Allocating an mcb.
Definition: comm_list.c:136
void helpMCBIsEmpty()
Prints details for IsEmpty func.
Definition: comm_list.c:152
int(* cmdFunc)(char[][MAX_LENGTH])
Definition: comm_list.h:14
int date(char parameters[][MAX_LENGTH])
Definition: comm_list.c:436
void helpPcbPrint()
helpPcbPrint prints out the commands for PCBs.
Definition: comm_list.c:314
int shutdownFunc(char parameters[][MAX_LENGTH])
shutdownFunc shuts down the OS.
Definition: comm_list.c:521
void helpShowReadyProcesses()
helpShowReadyProcesses shows the parameters and usage for showing ready PCBs.
Definition: comm_list.c:375
void helpShowBlockedProcesses()
helpShowBlockedProcesses shows the parameters and usage for showing the blocked PCBs.
Definition: comm_list.c:383
int isEmpty(char parameters[][MAX_LENGTH])
Definition: comm_list.c:35
void helpMCBShowFree()
Prints details for showing all the free memory blocks in the heap.
Definition: comm_list.c:159
int showAllProcesses(char parameters[][MAX_LENGTH])
showAllProcesses shows all processes in the system.
Definition: comm_list.c:746
int helpFunc(char parameters[][MAX_LENGTH])
helpFunc calls the other help functions
Definition: comm_list.c:49
void helpMcbPrint()
Prints the help menu for all mcb functions.
Definition: comm_list.c:116
void helpUnblockPCB()
helpUnblockPCB prints out the parameters and usage for unblocking a PCB.
Definition: comm_list.c:415
void getTime()
getTime this function has the side-effect of printing the current time to the terminal.
Definition: comm_list.c:490
int showBlockedProcesses(char parameters[][MAX_LENGTH])
showBlockedProcesses shows all processes that are blocked.
Definition: comm_list.c:766
int showPCB(char parameters[][MAX_LENGTH])
showPCB shows the process information for the process requested by the user
Definition: comm_list.c:737
void setTime(char parameters[][MAX_LENGTH])
setTime sets the current system time from the users input.
Definition: comm_list.c:500
void helpDate(char parameters[][MAX_LENGTH])
helpDate prints out the help information for date, for date –set and date –get
Definition: comm_list.c:238