-
Notifications
You must be signed in to change notification settings - Fork 0
/
disastrOS_constants.h
62 lines (56 loc) · 1.59 KB
/
disastrOS_constants.h
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
61
62
#pragma once
#define MAX_NUM_PROCESSES 1024
#define MAX_NUM_RESOURCES 1024
#define MAX_NUM_SEMAPHORES 1024
#define MAX_NUM_RESOURCES_PER_PROCESS 32
#define MAX_NUM_DESCRIPTORS_PER_PROCESS 32
#define MAX_NUM_SEMAPHORES_PER_PROCESS 32
#define MAX_NUM_SEMDESCRIPTORS_PER_PROCESS 32
#define STACK_SIZE 16384
// signals
#define MAX_SIGNALS 32
#define DSOS_SIGCHLD 0x1
#define DSOS_SIGHUP 0x2
// errors
#define DSOS_ESYSCALL_ARGUMENT_OUT_OF_BOUNDS -1
#define DSOS_ESYSCALL_NOT_IMPLEMENTED -2
#define DSOS_ESYSCALL_OUT_OF_RANGE -3
#define DSOS_EFORK -4
#define DSOS_EWAIT -5
#define DSOS_ESPAWN -6
#define DSOS_ESLEEP -7
#define DSOS_ERESOURCECREATE -8
#define DSOS_ERESOURCEOPEN -9
#define DSOS_ERESOURCENOEXCL -10
#define DSOS_ERESOURCENOFD -11
#define DSOS_ERESOURCECLOSE -12
#define DSOS_ERESOURCEINUSE -13
#define DSOS_ESEMID -14
#define DSOS_ESEMDESC -15
#define DSOS_ESEMALLOC -16
#define DSOS_ENOSEM -17
// syscall numbers
#define DSOS_MAX_SYSCALLS 32
#define DSOS_MAX_SYSCALLS_ARGS 8
#define DSOS_CALL_PREEMPT 1
#define DSOS_CALL_FORK 2
#define DSOS_CALL_WAIT 3
#define DSOS_CALL_EXIT 4
#define DSOS_CALL_SPAWN 5
#define DSOS_CALL_SLEEP 6
#define DSOS_CALL_OPEN_RESOURCE 7
#define DSOS_CALL_CLOSE_RESOURCE 8
#define DSOS_CALL_DESTROY_RESOURCE 9
#define DSOS_CALL_SHUTDOWN 10
#define DSOS_CALL_SEMOPEN 11
#define DSOS_CALL_SEMCLOSE 12
#define DSOS_CALL_SEMWAIT 13
#define DSOS_CALL_SEMPOST 14
//resources
#define DSOS_CREATE 0x1
#define DSOS_READ 0x2
#define DSOS_WRITE 0x3
#define DSOS_EXCL 0x4
// scheduling
#define ALPHA 0.5f
#define INTERVAL 100 // milliseconds for timer tick