-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInit.c
More file actions
47 lines (38 loc) · 635 Bytes
/
Copy pathInit.c
File metadata and controls
47 lines (38 loc) · 635 Bytes
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
#include <stdio.h>
#include <stdlib.h>
#include "Init.h"
int Quanta = 4;
//Local Scope Declaration
void TimerInterrupt();
void Init();
void Raise(char *Msg)
{
printf("\nError: %s\n",Msg);
exit(1);
}
void Message(char *Msg)
{
printf("%s",Msg);
}
void TimerInterrupt()
{
DisableInterrupt();
Schedule();
EnableInterrupt();
}
void Init()
{
SetHandler(intTimer,TimerInterrupt);
ThreadInit();
Message("Status: Executing Threads\n");
Schedule();
}
void main()
{
printf("Enter the time quantum: ");
scanf("%d",&Quanta);
printf("\n");
MachineInit();
Init();
machine();
}