mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 07:06:47 +00:00
parent
843e442971
commit
587086d3f2
@ -33,7 +33,7 @@
|
||||
  如果需要注册或取消注册某个具体文件系统到VFS之中,则需要以下两个接口:
|
||||
|
||||
```c
|
||||
#include<filesystem/VFS/VFS.h>
|
||||
#include<filesystem/vfs/VFS.h>
|
||||
|
||||
uint64_t vfs_register_filesystem(struct vfs_filesystem_type_t *fs);
|
||||
uint64_t vfs_unregister_filesystem(struct vfs_filesystem_type_t *fs);
|
||||
@ -45,7 +45,7 @@ uint64_t vfs_unregister_filesystem(struct vfs_filesystem_type_t *fs);
|
||||
|
||||
  这个数据结构描述了具体文件系统的一些信息。当我们挂载具体文件系统的时候,将会调用它的read_superblock方法,以确定要被挂载的文件系统的具体信息。
|
||||
|
||||
  该数据结构的定义在`kernel/filesystem/VFS/VFS.h`中,结构如下:
|
||||
  该数据结构的定义在`kernel/filesystem/vfs/VFS.h`中,结构如下:
|
||||
|
||||
```c
|
||||
struct vfs_filesystem_type_t
|
||||
@ -84,7 +84,7 @@ struct vfs_filesystem_type_t
|
||||
|
||||
  该数据结构为超级块结构体。
|
||||
|
||||
  该数据结构定义在`kernel/filesystem/VFS/VFS.h`中,结构如下:
|
||||
  该数据结构定义在`kernel/filesystem/vfs/VFS.h`中,结构如下:
|
||||
|
||||
```c
|
||||
struct vfs_superblock_t
|
||||
@ -111,7 +111,7 @@ struct vfs_superblock_t
|
||||
|
||||
  该数据结构为超级块的操作接口。VFS通过这些接口来操作具体的文件系统的超级块。
|
||||
|
||||
  该数据结构定义在`kernel/filesystem/VFS/VFS.h`中,结构如下:
|
||||
  该数据结构定义在`kernel/filesystem/vfs/VFS.h`中,结构如下:
|
||||
|
||||
```c
|
||||
struct vfs_super_block_operations_t
|
||||
@ -144,7 +144,7 @@ struct vfs_super_block_operations_t
|
||||
|
||||
  该数据结构为inode对象的数据结构,与文件系统中的具体的文件结点对象具有一对一映射的关系。
|
||||
|
||||
  该数据结构定义在`kernel/filesystem/VFS/VFS.h`中,结构如下:
|
||||
  该数据结构定义在`kernel/filesystem/vfs/VFS.h`中,结构如下:
|
||||
|
||||
```c
|
||||
struct vfs_index_node_t
|
||||
@ -199,7 +199,7 @@ struct vfs_index_node_t
|
||||
|
||||
  该接口为inode的操作方法接口,由具体文件系统实现。并与具体文件系统之中的inode相互绑定。
|
||||
|
||||
  该接口定义于`kernel/filesystem/VFS/VFS.h`中,结构如下:
|
||||
  该接口定义于`kernel/filesystem/vfs/VFS.h`中,结构如下:
|
||||
|
||||
```c
|
||||
struct vfs_inode_operations_t
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <mm/mm.h>
|
||||
#include <mm/slab.h>
|
||||
#include <common/printk.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <filesystem/devfs/devfs.h>
|
||||
#include <common/wait_queue.h>
|
||||
#include <common/spinlock.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <filesystem/devfs/devfs.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include "tty.h"
|
||||
|
||||
static struct devfs_private_inode_info_t * tty_inode_private_data_ptr; // 由devfs创建的inode私有信息指针
|
||||
|
@ -3,7 +3,7 @@ CFLAGS += -I .
|
||||
|
||||
|
||||
kernel_fs_objs:= $(shell find ./*.c)
|
||||
kernel_fs_subdirs:= devfs VFS fat32 rootfs procfs
|
||||
kernel_fs_subdirs:= devfs vfs fat32 rootfs procfs
|
||||
|
||||
ECHO:
|
||||
@echo "$@"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "chardev.h"
|
||||
#include "internal.h"
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
|
||||
#include <common/mutex.h>
|
||||
#include <common/stdlib.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
|
||||
/**
|
||||
* @brief devfs_private_file_info_t的type字段值
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "devfs.h"
|
||||
#include "internal.h"
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <common/glib.h>
|
||||
#include <common/string.h>
|
||||
#include <mm/slab.h>
|
||||
|
0
kernel/src/filesystem/devfs/mod.rs
Normal file
0
kernel/src/filesystem/devfs/mod.rs
Normal file
@ -12,7 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem/MBR.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
|
||||
#define FAT32_MAX_PARTITION_NUM 128 // 系统支持的最大的fat32分区数量
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "fat32.h"
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
|
0
kernel/src/filesystem/fat32/mod.rs
Normal file
0
kernel/src/filesystem/fat32/mod.rs
Normal file
5
kernel/src/filesystem/mod.rs
Normal file
5
kernel/src/filesystem/mod.rs
Normal file
@ -0,0 +1,5 @@
|
||||
pub mod devfs;
|
||||
pub mod fat32;
|
||||
pub mod procfs;
|
||||
pub mod rootfs;
|
||||
pub mod vfs;
|
0
kernel/src/filesystem/procfs/mod.rs
Normal file
0
kernel/src/filesystem/procfs/mod.rs
Normal file
@ -6,7 +6,7 @@
|
||||
#include <common/stdio.h>
|
||||
#include <common/stdlib.h>
|
||||
#include <common/string.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <process/process.h>
|
||||
|
||||
/**
|
||||
|
0
kernel/src/filesystem/rootfs/mod.rs
Normal file
0
kernel/src/filesystem/rootfs/mod.rs
Normal file
@ -1,7 +1,7 @@
|
||||
#include "rootfs.h"
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <common/string.h>
|
||||
#include <filesystem/VFS/mount.h>
|
||||
#include <filesystem/vfs/mount.h>
|
||||
|
||||
static struct vfs_superblock_t rootfs_sb = {0};
|
||||
extern struct vfs_superblock_t *vfs_root_sb;
|
||||
|
0
kernel/src/filesystem/vfs/mod.rs
Normal file
0
kernel/src/filesystem/vfs/mod.rs
Normal file
@ -2,7 +2,7 @@
|
||||
#include <common/spinlock.h>
|
||||
#include <process/process.h>
|
||||
#include <process/ptrace.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <filesystem/fat32/fat32.h>
|
||||
#include <common/atomic.h>
|
||||
#include <mm/slab.h>
|
||||
|
@ -16,13 +16,13 @@ use core::panic::PanicInfo;
|
||||
#[macro_use]
|
||||
mod arch;
|
||||
|
||||
mod driver;
|
||||
mod filesystem;
|
||||
#[macro_use]
|
||||
mod include;
|
||||
mod ipc;
|
||||
|
||||
#[macro_use]
|
||||
mod libs;
|
||||
mod driver;
|
||||
mod mm;
|
||||
mod process;
|
||||
mod sched;
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <sched/sched.h>
|
||||
#include <smp/ipi.h>
|
||||
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <filesystem/devfs/devfs.h>
|
||||
#include <filesystem/procfs/procfs.h>
|
||||
#include <filesystem/fat32/fat32.h>
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <common/errno.h>
|
||||
#include <common/glib.h>
|
||||
#include <common/wait_queue.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <mm/mm-types.h>
|
||||
#include <syscall/syscall.h>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <driver/disk/ahci/ahci.h>
|
||||
#include <exception/gate.h>
|
||||
#include <exception/irq.h>
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <filesystem/vfs/VFS.h>
|
||||
#include <filesystem/fat32/fat32.h>
|
||||
#include <mm/slab.h>
|
||||
#include <process/process.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user