2019-07-13 10:18:41 -05:00
|
|
|
#include <tasking.h>
|
2019-07-13 10:40:23 -05:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <mailboxes.h>
|
|
|
|
#include <ipc/vfs.h>
|
2019-07-13 10:18:41 -05:00
|
|
|
#include <memory.h>
|
2019-07-31 19:46:01 -05:00
|
|
|
#include <grub/text_fb_info.h>
|
|
|
|
#include "vga.h"
|
2019-08-03 15:50:23 -05:00
|
|
|
#include <vfs.h>
|
2019-07-13 10:18:41 -05:00
|
|
|
|
|
|
|
int main() {
|
2019-07-31 19:46:01 -05:00
|
|
|
text_fb_info info;
|
|
|
|
info.address=map_phys((void*)0xB8000,10);
|
|
|
|
info.width=80;
|
|
|
|
info.height=25;
|
|
|
|
vga_init(info);
|
2019-07-13 10:40:23 -05:00
|
|
|
uint32_t box=mailbox_new(16);
|
2019-08-25 13:53:44 -05:00
|
|
|
register_fs("devfs",box);
|
|
|
|
mount("","devfs","/dev");
|
2019-07-13 10:40:23 -05:00
|
|
|
for (;;) {
|
2019-07-13 10:18:41 -05:00
|
|
|
yield();
|
2019-07-13 10:40:23 -05:00
|
|
|
Message msg;
|
|
|
|
msg.msg=malloc(sizeof(vfs_message));
|
|
|
|
mailbox_get_msg(box,&msg,sizeof(vfs_message));
|
|
|
|
if (msg.from==0) {
|
2019-07-20 11:03:27 -05:00
|
|
|
yield();
|
2019-07-13 10:40:23 -05:00
|
|
|
} else {
|
|
|
|
vfs_message* vfs_msg=(vfs_message*)msg.msg;
|
2019-07-31 19:46:01 -05:00
|
|
|
char str[]={(char)vfs_msg->data,'\0'};
|
|
|
|
vga_write_string(&str[0]);
|
2019-07-13 10:40:23 -05:00
|
|
|
msg.to=msg.from;
|
|
|
|
msg.from=box;
|
2019-07-20 11:03:27 -05:00
|
|
|
vfs_msg->flags=0;
|
2019-07-13 10:40:23 -05:00
|
|
|
mailbox_send_msg(&msg);
|
|
|
|
yield();
|
|
|
|
}
|
|
|
|
free(msg.msg);
|
2019-07-13 10:18:41 -05:00
|
|
|
}
|
|
|
|
}
|