1 #define _SYSTEM 1 /* tell headers that this is the kernel */
3 #include <minix/config.h>
10 #include <minix/timers.h>
12 #include <minix/callnr.h>
13 #include <minix/type.h>
14 #include <minix/const.h>
15 #include <minix/com.h>
16 #include <minix/syslib.h>
17 #include <minix/sysutil.h>
18 #include <minix/vfsif.h>
19 #include <minix/endpoint.h>
20 #include <minix/sysinfo.h>
21 #include <minix/u64.h>
22 #include <minix/sysinfo.h>
23 #include <minix/type.h>
24 #include <minix/ipc.h>
27 #include <sys/times.h>
28 #include <sys/types.h>
32 #include <minix/vtreefs.h>
36 static void init_hook(void) {
40 devman_init_devices();
46 static void message_hook(message
*m
, int __unused ipc_status
)
62 (struct inode
*inode
, char *ptr
, size_t len
, off_t offset
, cbdata_t cbdata
)
64 struct devman_inode
*d_inode
= (struct devman_inode
*) cbdata
;
66 return d_inode
->read_fn(ptr
, len
, offset
, d_inode
->data
);
70 int main (int argc
, char* argv
[])
73 static struct fs_hooks hooks
;
74 static struct inode_stat root_stat
;
76 /* fill in the hooks */
77 memset(&hooks
, 0, sizeof(hooks
));
78 hooks
.init_hook
= init_hook
;
79 hooks
.read_hook
= read_hook
;
80 hooks
.message_hook
= message_hook
; /* handle the ds_update call */
82 root_stat
.mode
= S_IFDIR
| S_IRUSR
| S_IRGRP
| S_IROTH
;
86 root_stat
.dev
= NO_DEV
;
89 run_vtreefs(&hooks
, 1024, 0, &root_stat
, 0, BUF_SIZE
);