-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTechOS.c
More file actions
52 lines (46 loc) · 1.35 KB
/
TechOS.c
File metadata and controls
52 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Names: Logan Bland
John Clay
Jalen Wayt
Assignment: Module 2 - Process Scheduling
Purpose: Implement Scheduling queues and process creation
Due Date: September 28, 2021
*/
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <ctype.h>
#include "HeaderFiles/login.h"
#include "HeaderFiles/comhan.h"
#include "HeaderFiles/customprocess.h"
#include "HeaderFiles/linkedlist.h"
//Main method that calls COMHAN function
int main() {
//Initialize Ready Queue
readyQueue = (PQueue *)malloc(sizeof(PQueue));
initializePQueue(readyQueue);
//Initialize Blocked Queue
blockedQueue = (FQueue *)malloc(sizeof(FQueue));
initializeFQueue(blockedQueue);
//Initialize History Queue
history = (HQueue *)malloc(sizeof(HQueue));
initializeHQueue(history);
// Initialize the user queue
userQueue = (LQueue *)malloc(sizeof(LQueue));
initializeLQueue(userQueue);
User * validUser = (User *)malloc(sizeof(User));
int terminate = 0;
do {
validUser = LOGIN();
// Read all account after each login? If no, fix
// If yes, write changes to user.txt during session
if(validUser != NULL){
COMHAN(validUser);
} else {
printf("\nInvalid Login");
}
free(userQueue);
} while(true);
return 0;
}