forked from yhzhang0128/egos-2000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
egos.h
33 lines (24 loc) · 855 Bytes
/
egos.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
#pragma once
/* Interface between earth and grass */
#define TIMER_INTR_ID 7
#define QUANTUM_NCYCLES 2000
#define EARTH_ADDR (0x8004000 - 0x40)
typedef void (*handler_t)(int, void*);
struct dev_log {
int (*log_info)(const char *format, ...);
int (*log_highlight)(const char *format, ...);
int (*log_success)(const char *format, ...);
int (*log_error)(const char *format, ...);
int (*log_fatal)(const char *format, ...);
};
struct earth {
int (*tty_read)(char* buf, int len);
int (*tty_write)(const char *format, ...);
int (*disk_read)(int block_no, int nblocks, char* dst);
int (*disk_write)(int block_no, int nblocks, char* src);
int (*intr_enable)();
int (*intr_disable)();
int (*intr_register)(int id, handler_t handler);
struct dev_log log;
};
/* Interface between grass and apps */