object_t normal_open(struct inode *inode,String name,int flag,umode_t unused(mode)) { if(inode) { object_t id = fork(); if(0 == id) { struct file *file = kalloc(sizeof(struct file)); strcpy(self()->name,name); file->flags = flag; file->offset = 0; if(flag & O_APPEND) file->offset = inode->i_size; file->inode = inode; file->cnt = 1; self()->private_data = file; hook(FIF_OPEN,minix_open); hook(FIF_READ,minix_read); hook(FIF_WRITE,minix_write); hook(FIF_CLOSE,minix_close); hook(FIF_SEEK,generic_seek); hook(FIF_MOUNT,generic_mount); workloop(); } else { return id; } } return -ENFILE; }
int rootfs_main(void ) { rootfs_init(); fs_log("Workloop\n"); workloop(); return 0; }
int ramdisk_main(void){ ramdisk_init(); workloop(); return 0; }
int main(void){ sr_log("serial startup...\n"); rs_init(); workloop(); return 0; }