Commit Graph

5 Commits

Author SHA1 Message Date
LoGin d1872d899a
feat(ext4): 修复死锁问题并增强文件系统功能 (#1509)
* feat(ext4): 修复死锁问题并增强文件系统功能

- 修复了ext4 inode读写操作中的自旋锁死锁问题
- 添加了父目录指针支持,实现parent()方法
- 改进了块设备寻址逻辑,统一使用512字节LBA
- 增强了根文件系统探测机制,支持ext4和FAT自动识别
- 修复了ELF加载器中解释器路径查找问题
- 更新了another_ext4依赖版本

Signed-off-by: longjin <longjin@DragonOS.org>

* feat(filesystem): 为ext4和fat文件系统添加探测方法并优化代码

- 在Ext4FileSystem和FATFileSystem中新增probe方法,用于探测gendisk是否包含对应文
件系统
- 重构vcore.rs中的文件系统探测逻辑,使用新的probe方法替代原有的独立探测函数
- 优化Ext4Inode构造函数中parent字段的默认值设置,使用unwrap_or_default替代unwrap
_or_else
- 在rcS启动脚本中添加PATH环境变量设置

Signed-off-by: longjin <longjin@DragonOS.org>

---------

Signed-off-by: longjin <longjin@DragonOS.org>
2025-12-21 21:04:12 +08:00
LoGin 5450a4bfc7
fix: fix chroot and tmpfs (#1480)
* feat(procfs): Add /proc/[pid]/mountinfo and /proc/[pid]/maps support

- Introduced new ProcFileType variants for /proc/[pid]/mountinfo and /proc/[pid]/maps.
- Implemented content generation for /proc/[pid]/mountinfo and /proc/[pid]/maps to align with Linux semantics.
- Updated ProcFS inode creation to include these new files for each process.
- Enhanced path handling in the VFS to ensure correct resolution based on process-specific root and current working directory.

This addition improves the process filesystem's functionality and compatibility with Linux behavior.

* feat(filesystem): Enhance page cache management in tmpfs

- Added an unevictable flag to the PageCache structure, allowing pages to be marked as unevictable to prevent reclamation.
- Updated the TmpfsInode structure to integrate page cache management, replacing direct data manipulation with page cache operations for read and write methods.
- Refactored truncate and resize methods to utilize the new page cache functionality, ensuring consistency and improved memory management.

* feat(filesystem): Enhance tmpfs functionality and VFS constraints

- Implemented support for readahead in tmpfs, allowing for optimized data retrieval.
- Added checks for filename length across various VFS operations to prevent errors related to excessively long names.
- Updated the tmpfs implementation to handle read and write operations directly through the page cache, improving memory management.
- Enhanced rename functionality to ensure type compatibility and empty directory checks during operations.
- Increased maximum path length and defined maximum single filename length for better filesystem compliance.

* refactor(fs): 重构tmpfs重命名逻辑并修复MountFSInode的move_to委托

- 将tmpfs跨目录移动逻辑提取为独立函数`tmpfs_move_entry_between_dirs`
- 优化锁顺序以避免死锁,按inode_id顺序锁定目录
- 修复MountFSInode::move_to中目标inode解包问题,确保正确委托给底层文件系统

Signed-off-by: longjin <longjin@DragonOS.org>

* feat(filesystem): Implement zero-page creation for tmpfs and enhance page fault handling

- Added `create_zero_pages` method to `InnerPageCache` for efficient zero-page creation, optimizing memory usage in tmpfs.
- Updated `Tmpfs` to utilize the new zero-page creation during read and write operations, ensuring seamless handling of page faults.
- Enhanced `PageFaultHandler` with `pagecache_fault_zero` to manage page faults specifically for tmpfs, allowing for direct page cache access without disk I/O.

This improves the performance and reliability of memory file systems by reducing unnecessary allocations and ensuring proper page management.

* refactor(syscall): Rename check_and_clone_cstr to vfs_check_and_clone_cstr for clarity

- Updated the user access module to introduce vfs_check_and_clone_cstr, enhancing clarity in its purpose for VFS operations.
- Refactored sys_openat and utimensat to utilize the new vfs_check_and_clone_cstr function, ensuring consistent handling of C string paths across the filesystem.

---------

Signed-off-by: longjin <longjin@DragonOS.org>
2025-12-16 14:05:27 +08:00
黄铭涛 b74420f48e
feat(test): 增加系统启动后执行syscall集成测试的make命令并将其加入流水线中 (#1306)
* feat(test): 增加系统启动后执行syscall集成测试的make命令并将其加入流水线中
2025-10-09 22:34:51 +08:00
火花 0bc74e16e0
fix:修改busybox编译选项,启用busybox作为初始引导程序以及shell程序 (#1161) 2025-05-10 20:56:36 +08:00
火花 bc9bb9607f
Feat(tty): Supplement process group logic (#1139)
* 添加busybox的编译

* 完善tty job control的逻辑

* 修改copy_sighand的逻辑,符合Linux语义

* 以busybox作为启动shell去运行

* 修改setsid的逻辑

* 解决前台进程组无法处理信号的问题

* 移除ProcessBasicInfo其中的pgid和sid信息

* 修改setsid

* 新增get_pcb_info

* 在etc目录下新增必要的文件

* 改用busybox init作为引导程序

* 恢复dragonreach文件

* 修改busybox编译选项,能够读取环境变量

* 先让SYS_RT_SIGTIMEDWAIT返回Ok(0),能够正常进入系统

* 一些小更改

* 删除get_pcb_info

* 增加对默认termios的判断

* 完成backspace的修复

* 更改inittab,在shell启动之后更改termios

* 增加executable_path信息

* 补充proc下的exe链接文件以及读取逻辑

* 更改PosixTermios,使用stty完成erase的设置

* 用busybox作为引导程序

* 修改波特率的获取

* 修改函数方法

* 在baud_rate方法中添加对于cbaud的与操作

* 为rv64下的SigSet实现From<Signal>

* refactor(driver): 移除`#[derive(Debug)]`并手动实现`Debug` trait

移除`VirtIOBlkDevice`、`VirtIOConsoleDevice`和`VirtIONetDevice`的`#[derive(Debug)]`,并手动实现`Debug` trait以提供更详细的调试信息。

Co-authored-by: longjin <longjin@DragonOS.org>
2025-05-08 15:05:02 +08:00