/DragonOS-0.1.2/kernel/src/driver/tty/ |
D | tty.c | 15 long tty_open(struct vfs_index_node_t *inode, struct vfs_file_t *filp) in tty_open() 28 long tty_close(struct vfs_index_node_t *inode, struct vfs_file_t *filp) in tty_close() 43 long tty_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *filp, uint64_t cmd, uint64_t arg) in tty_ioctl() 62 long tty_read(struct vfs_file_t *filp, char *buf, int64_t count, long *position) in tty_read() 76 long tty_write(struct vfs_file_t *filp, char *buf, int64_t count, long *position) in tty_write()
|
/DragonOS-0.1.2/kernel/src/ipc/ |
D | pipe.c | 30 long pipe_read(struct vfs_file_t *file_ptr, char *buf, in pipe_read() 63 long pipe_write(struct vfs_file_t *file_ptr, char *buf, in pipe_write() 97 long pipe_close(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in pipe_close() 139 struct vfs_file_t *read_file = NULL; in sys_pipe() 140 struct vfs_file_t *write_file = NULL; in sys_pipe() 147 read_file = (struct vfs_file_t *)kzalloc(sizeof(struct vfs_file_t), 0); in sys_pipe() 156 write_file = (struct vfs_file_t *)kzalloc(sizeof(struct vfs_file_t), 0); in sys_pipe()
|
/DragonOS-0.1.2/kernel/src/filesystem/VFS/ |
D | VFS.h | 102 struct vfs_file_t struct 186 long (*open)(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr); 187 long (*close)(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr); 188 long (*read)(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position); 189 long (*write)(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position); 190 long (*lseek)(struct vfs_file_t *file_ptr, long offset, long origin); 191 …long (*ioctl)(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr, uint64_t cmd, uint64_t … 193 long (*readdir)(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir_t filler); // 读取文件夹
|
D | VFS.c | 494 struct vfs_file_t *file_ptr = (struct vfs_file_t *)kzalloc(sizeof(struct vfs_file_t), 0); in do_open() 556 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in vfs_close()
|
/DragonOS-0.1.2/kernel/src/driver/keyboard/ |
D | ps2_keyboard.c | 49 long ps2_keyboard_open(struct vfs_index_node_t *inode, struct vfs_file_t *filp) in ps2_keyboard_open() 63 long ps2_keyboard_close(struct vfs_index_node_t *inode, struct vfs_file_t *filp) in ps2_keyboard_close() 79 long ps2_keyboard_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *filp, uint64_t cmd, uint… in ps2_keyboard_ioctl() 102 long ps2_keyboard_read(struct vfs_file_t *filp, char *buf, int64_t count, long *position) in ps2_keyboard_read() 121 long ps2_keyboard_write(struct vfs_file_t *filp, char *buf, int64_t count, long *position) in ps2_keyboard_write()
|
/DragonOS-0.1.2/kernel/src/filesystem/rootfs/ |
D | rootfs.c | 41 static long rootfs_open(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in rootfs_open() 45 static long rootfs_close(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) { return 0; } in rootfs_close() 46 static long rootfs_read(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) { re… in rootfs_read() 47 static long rootfs_write(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) { r… in rootfs_write() 48 static long rootfs_lseek(struct vfs_file_t *file_ptr, long offset, long origin) { return 0; } in rootfs_lseek() 49 static long rootfs_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr, uint64_t cmd,… in rootfs_ioctl() 51 static long rootfs_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir_t filler) in rootfs_readdir()
|
/DragonOS-0.1.2/kernel/src/filesystem/devfs/ |
D | devfs.c | 74 static long devfs_open(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in devfs_open() 78 static long devfs_close(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) { return 0; } in devfs_close() 79 static long devfs_read(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) { ret… in devfs_read() 80 static long devfs_write(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) { re… in devfs_write() 81 static long devfs_lseek(struct vfs_file_t *file_ptr, long offset, long origin) { return 0; } in devfs_lseek() 82 static long devfs_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr, uint64_t cmd, … in devfs_ioctl() 84 static long devfs_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir_t filler) in devfs_readdir()
|
/DragonOS-0.1.2/kernel/src/filesystem/procfs/ |
D | procfs.c | 105 static long procfs_open(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in procfs_open() 171 static long procfs_close(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in procfs_close() 175 static long procfs_read(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) in procfs_read() 218 static long procfs_write(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) in procfs_write() 230 static long procfs_lseek(struct vfs_file_t *file_ptr, long offset, long whence) in procfs_lseek() 258 static long procfs_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr, uint64_t cmd,… in procfs_ioctl() 272 static long procfs_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir_t filler) in procfs_readdir()
|
/DragonOS-0.1.2/kernel/src/process/ |
D | process.c | 132 struct vfs_file_t *process_open_exec_file(char *path) in process_open_exec_file() 135 struct vfs_file_t *filp = NULL; in process_open_exec_file() 145 filp = (struct vfs_file_t *)kmalloc(sizeof(struct vfs_file_t), 0); in process_open_exec_file() 168 struct vfs_file_t *filp = process_open_exec_file(path); in process_load_elf_file() 726 memset(pcb->fds, 0, sizeof(struct vfs_file_t *) * PROC_MAX_FD_NUM); in process_exit_files() 830 int process_fd_alloc(struct vfs_file_t *file) in process_fd_alloc() 833 struct vfs_file_t **f = current_pcb->fds; in process_fd_alloc()
|
D | proc-types.h | 110 struct vfs_file_t *fds[PROC_MAX_FD_NUM];
|
D | process.h | 159 int process_fd_alloc(struct vfs_file_t *file);
|
D | fork.c | 197 pcb->fds[i] = (struct vfs_file_t *)kmalloc(sizeof(struct vfs_file_t), 0); in process_copy_files() 198 memcpy(pcb->fds[i], current_pcb->fds[i], sizeof(struct vfs_file_t)); in process_copy_files()
|
/DragonOS-0.1.2/kernel/src/syscall/ |
D | syscall.c | 175 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in sys_read() 214 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in sys_write() 247 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in sys_lseek() 437 struct vfs_file_t *filp = current_pcb->fds[fd]; in sys_getdents()
|
/DragonOS-0.1.2/kernel/src/filesystem/fat32/ |
D | fat32.h | 221 int64_t fat32_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir_t filler);
|
D | fat32.c | 553 long fat32_open(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in fat32_open() 559 long fat32_close(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr) in fat32_close() 573 long fat32_read(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) in fat32_read() 662 long fat32_write(struct vfs_file_t *file_ptr, char *buf, int64_t count, long *position) in fat32_write() 793 long fat32_lseek(struct vfs_file_t *file_ptr, long offset, long whence) in fat32_lseek() 823 long fat32_ioctl(struct vfs_index_node_t *inode, struct vfs_file_t *file_ptr, uint64_t cmd, uint64_… in fat32_ioctl() 1157 int64_t fat32_readdir(struct vfs_file_t *file_ptr, void *dirent, vfs_filldir_t filler) in fat32_readdir()
|