🆕 sys_open系统调用

This commit is contained in:
fslongjin
2022-04-27 00:39:02 +08:00
parent d94d92f5ee
commit 966d67fcde
14 changed files with 343 additions and 144 deletions

View File

@ -71,13 +71,17 @@ struct vfs_index_node_t
void *private_inode_info;
};
/**
* @brief 文件描述符
*
*/
struct vfs_file_t
{
long position;
uint64_t mode;
struct vfs_dir_entry_t *dEntry;
struct vfs_file_opeartions_t *file_ops;
struct vfs_file_operations_t *file_ops;
void *private_data;
};
@ -147,4 +151,14 @@ uint64_t vfs_unregister_filesystem(struct vfs_filesystem_type_t *fs);
* @param buf 文件系统的引导扇区
* @return struct vfs_superblock_t*
*/
struct vfs_superblock_t *vfs_mount_fs(char *name, void *DPTE, uint8_t DPT_type, void *buf, int8_t ahci_ctrl_num, int8_t ahci_port_num, int8_t part_num);
struct vfs_superblock_t *vfs_mount_fs(char *name, void *DPTE, uint8_t DPT_type, void *buf, int8_t ahci_ctrl_num, int8_t ahci_port_num, int8_t part_num);
/**
* @brief 按照路径查找文件
*
* @param path 路径
* @param flags 1返回父目录项 0返回结果目录项
* @return struct vfs_dir_entry_t* 目录项
*/
struct vfs_dir_entry_t *vfs_path_walk(char *path, uint64_t flags);