#include #include "vga.h" #include #include #include #include #include #include #include typedef struct { char filename[100]; char mode[8]; char uid[8]; char gid[8]; char size[12]; char mtime[12]; char chksum[8]; char typeflag[1]; } tar_header; uint32_t getsize(const char *in) { uint32_t size=0; uint32_t j; uint32_t count=1; for (j=11;j>0;j--,count*=8) { size+=((in[j-1]-'0')*count); } return size; } int main(char* initrd, uint32_t initrd_sz) { text_fb_info info; info.address=map_phys((void*)0xB8000,10); info.width=80; info.height=25; vga_init(info); vga_write_string("INIT VGA\n"); int pos=0; uint32_t datapos; tar_header tar_hdr; for (int i=0;;i++) { char* tar_hdr_ptr=(char*)&tar_hdr; for (size_t i=0;i0) { pos=pheader.offset+datapos; for (size_t i=0;itype=VFS_OPEN; msg_data->id=1; strcpy(&msg_data->mode[0],"r"); strcpy(&msg_data->path[0],"/dev/sda"); Message msg; msg.from=box; msg.to=1; msg.msg=msg_data; msg.size=sizeof(vfs_message); mailbox_send_msg(&msg); vga_write_string("Sent test message, yielding to task\n"); yield(); vga_write_string("Yielded and got control, getting message\n"); msg.msg=malloc(sizeof(vfs_message)); mailbox_get_msg(box,&msg,sizeof(vfs_message)); vfs_message* vfs_msg=(vfs_message*)msg.msg; vga_write_string("Message of type "); char str[256]; str[0]='\0'; int_to_ascii(vfs_msg->type,str); vga_write_string(str); vga_write_string("\n"); vga_write_string("ID "); str[0]='\0'; int_to_ascii(vfs_msg->id,str); vga_write_string(str); vga_write_string("\n"); vga_write_string("Mode "); vga_write_string(&vfs_msg->mode[0]); vga_write_string("\n"); vga_write_string("FD "); str[0]='\0'; int_to_ascii(vfs_msg->fd,str); vga_write_string(str); vga_write_string("\n"); vga_write_string("Path "); vga_write_string(&vfs_msg->path[0]); vga_write_string("\n"); vga_write_string("Flags "); str[0]='\0'; hex_to_ascii(vfs_msg->flags,str); vga_write_string(str); vga_write_string("\n"); } for(;;); }