-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisastrOS.h
36 lines (25 loc) · 997 Bytes
/
disastrOS.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
#pragma once
#include "disastrOS_pcb.h"
#include "linked_list.h"
#ifdef _DISASTROS_DEBUG_
#include <stdio.h>
#define disastrOS_debug(...) printf(__VA_ARGS__)
#else //_DISASTROS_DEBUG_
#define disastrOS_debug(...) ;
#endif //_DISASTROS_DEBUG_
// initializes the structures and spawns a fake init process
void disastrOS_start(void (*f)(void*), void* args, char* logfile);
// generic syscall
int disastrOS_syscall(int syscall_num, ...);
// classical process control
int disastrOS_getpid(); // this should be a syscall, but we have no memory separation, so we return just the running pid
int disastrOS_fork();
void disastrOS_exit(int exit_value);
int disastrOS_wait(int pid, int* retval);
void disastrOS_preempt();
void disastrOS_spawn(void (*f)(void*), void* args );
void disastrOS_shutdown();
void disastrOS_sleep(int);
//void disastrOS_pseudoexec(char* lib, char* func, double* argument_list[]);
// debug function, prints the state of the internal system
void disastrOS_printStatus();