-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.cpp
More file actions
60 lines (41 loc) · 1.03 KB
/
Test.cpp
File metadata and controls
60 lines (41 loc) · 1.03 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
52
53
54
55
56
57
58
59
60
/*
* Test.cpp
*
* Created on: Jun 22, 2015
* Author: OS1
*/
#include <iostream.h>
#include <stdio.h>
#include <dos.h>
#include "PCB.h"
#include "util.h"
#include "SysCall.h"
#include "KernQue.h"
#include "SCHEDULE.h"
#include "Semaphor.h"
#include "user.h"
#include "Idle.h"
extern int userMain(int argc, char* argv[]);
int main(int argc, char* argv[]) {
#ifndef BCC_BLOCK_IGNORE
SysCall::oldTimer = getvect(8);
setvect(8, SysCall::newTimer);
SysCall::oldroutine = getvect(60);
setvect(60, SysCall::startSysCall);
#endif
PCB* pocetna = new PCB(4096, 1, 0);
pocetna->state = READY;
PCB::running = pocetna;
KernelQueues::pcbQQ->put(PCB::running, 0);
SysCall::SysPCB = new PCB(4096);
SysCall::SysPCB->createKernelStack();
Idle* idl = new Idle();
idl->start();
KernelQueues::pcbQQ->put(SysCall::SysPCB, 0);
userMain(argc, argv);
#ifndef BCC_BLOCK_IGNORE
setvect(8, SysCall::oldTimer);
setvect(60, SysCall::oldroutine);
#endif
return 0;
}