Skip to content

feat(kexec & initram):Add kexec and initram support for x86 architecture#1303

Merged
fslongjin merged 1 commit intoDragonOS-Community:masterfrom
JensenWei007:dev
Oct 30, 2025
Merged

feat(kexec & initram):Add kexec and initram support for x86 architecture#1303
fslongjin merged 1 commit intoDragonOS-Community:masterfrom
JensenWei007:dev

Conversation

@JensenWei007
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the ambiguous The title of PR/issue doesn't match the format label Sep 29, 2025
@fslongjin
Copy link
Member

这里怎么这么多二进制文件

Copilot AI review requested due to automatic review settings October 20, 2025 06:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for initramfs (initial RAM filesystem) and kexec (kernel execution) functionality to DragonOS. The changes enable the kernel to boot from an embedded compressed initramfs and provide the ability to execute a new kernel without going through the bootloader.

Key changes:

  • Implements initramfs support with XZ compression and CPIO archive handling
  • Adds kexec system call and related infrastructure for kernel switching
  • Introduces architecture-specific kexec implementations (primarily x86_64)
  • Refactors file descriptor management to use trait objects instead of concrete File types

Reviewed Changes

Copilot reviewed 83 out of 84 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
kernel/src/filesystem/vfs/file.rs Refactors File to implement FileOperations trait and changes FD table to use trait objects
kernel/src/filesystem/vfs/file_operations.rs Adds new FileOperations trait defining file operation interface
kernel/src/filesystem/ramfs/initram.rs Implements initramfs initialization and CPIO archive parsing
kernel/src/init/kexec/*.rs Adds kexec core functionality and system call implementation
kernel/src/arch/x86_64/kexec.rs Implements x86_64-specific kexec machine operations
kernel/src/arch/x86_64/asm/relocate_kernel_64.S Adds assembly code for kernel relocation during kexec
kernel/src/process/pidfd.rs Implements pidfd (process file descriptor) support
tools/run-qemu.sh Removes SMP parameter from QEMU arguments
kernel/src/syscall/misc.rs Implements umask system call with static storage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


QEMU_ARGUMENT+="-d ${QEMU_DISK_IMAGE} -m ${QEMU_MEMORY} -smp ${QEMU_SMP} -boot order=d ${QEMU_MONITOR} -d ${qemu_trace_std} "
#QEMU_ARGUMENT+="-d ${QEMU_DISK_IMAGE} -m ${QEMU_MEMORY} -smp ${QEMU_SMP} -boot order=d ${QEMU_MONITOR} -d ${qemu_trace_std} "
QEMU_ARGUMENT+="-d ${QEMU_DISK_IMAGE} -m ${QEMU_MEMORY} -boot order=d ${QEMU_MONITOR} -d ${qemu_trace_std} "
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate -d flag in QEMU_ARGUMENT. The -d flag appears twice: once for ${QEMU_DISK_IMAGE} (which seems incorrect as -d is for debug options) and once for ${qemu_trace_std}. This will cause incorrect QEMU behavior.

Suggested change
QEMU_ARGUMENT+="-d ${QEMU_DISK_IMAGE} -m ${QEMU_MEMORY} -boot order=d ${QEMU_MONITOR} -d ${qemu_trace_std} "
QEMU_ARGUMENT+="-m ${QEMU_MEMORY} -boot order=d ${QEMU_MONITOR} -d ${qemu_trace_std} "

Copilot uses AI. Check for mistakes.

use super::{user_access::UserBufferWriter, Syscall};

static mut UMASK: usize = 0o777;
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a mutable static variable without synchronization is unsafe and not thread-safe. Multiple processes could race to read/write UMASK simultaneously. Consider using an AtomicUsize or per-process storage instead of a global static.

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +77
crate::filesystem::vfs::get_link_true_file(argv[0].to_string_lossy().to_string())
.unwrap();
argv[0] = CString::new(real).unwrap();
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using .unwrap() can cause a kernel panic if the link resolution fails. Consider proper error handling with a more graceful fallback or clear error message.

Suggested change
crate::filesystem::vfs::get_link_true_file(argv[0].to_string_lossy().to_string())
.unwrap();
argv[0] = CString::new(real).unwrap();
crate::filesystem::vfs::get_link_true_file(argv[0].to_string_lossy().to_string());
let real = match real {
Some(r) => r,
None => {
error!("Failed to resolve symlink for: {}", argv[0].to_string_lossy());
return Err(SystemError::ENOENT);
}
};
argv[0] = match CString::new(real) {
Ok(cstr) => cstr,
Err(_) => {
error!("Failed to create CString for resolved path");
return Err(SystemError::EINVAL);
}
};

Copilot uses AI. Check for mistakes.
Comment on lines +156 to +158
if pid.pid_vnr().data() == ProcessManager::current_pcb().raw_tgid().data() {
return Err(SystemError::ECHILD);
}
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check prevents a process from waiting on itself, but it appears in only one branch of the match statement (PidConverter::Pid). The same check should likely be present or unnecessary in other converter types for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +381 to +383
bp.arch.set_alt_mem_k(0x7fb40);
bp.arch.set_scratch(0x10000d);
bp.arch.init_setupheader();
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded magic numbers (0x7fb40, 0x10000d) are being used without explanation. The comment mentions these should not be initialized this way. Add clear documentation explaining these values or refactor to obtain them dynamically.

Copilot uses AI. Check for mistakes.
# 0: x86_64
# 1: riscv64
# 2: loongarch64
arch = $1
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash variable assignment should not have spaces around the = operator. This should be arch=$1 instead of arch = $1.

Suggested change
arch = $1
arch=$1

Copilot uses AI. Check for mistakes.
let mut _rsp: usize = 0;

// 检查是否使用备用栈
if sigaction.flags().contains(SigFlags::SA_ONSTACK) {
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternate signal stack implementation is incomplete. There's no validation that stack.sp is valid or that stack.size is non-zero before performing pointer arithmetic, which could lead to invalid stack pointer values.

Suggested change
if sigaction.flags().contains(SigFlags::SA_ONSTACK) {
if sigaction.flags().contains(SigFlags::SA_ONSTACK)
&& stack.sp != 0
&& stack.size != 0
{

Copilot uses AI. Check for mistakes.
// 判断标准: 是否存在 /init 程序, 与 Linux 相同
// 查找考虑链接
unsafe {
__INIT_ROOT_ENABLED = INIT_ROOT_INODE().find("init").is_ok();
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a global mutable static without proper synchronization. Although this is set during initialization, accessing __INIT_ROOT_ENABLED from multiple contexts could be unsafe. Consider using atomic operations or ensuring this is only accessed after initialization is complete.

Copilot uses AI. Check for mistakes.
let slice = core::slice::from_raw_parts_mut(virt.data() as *mut u8, 2048);
slice.fill(0);
// 这里先使用固定的写死的 cmdline, 后续等 DragonOS 的切换设置没问题了让 linux 能完成初始化的时候改成与 DragonOS 一样就行
let mess = "console=ttyS0 earlyprintk=serial,ttyS0,115200";
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded kernel command line parameters should be configurable. The comment acknowledges this is temporary, but using a hard-coded command line limits flexibility for different boot scenarios.

Copilot uses AI. Check for mistakes.
@JensenWei007
Copy link
Contributor Author

bugbot run

@cursor
Copy link

cursor bot commented Oct 22, 2025

Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository.

@JensenWei007 JensenWei007 changed the title Add initram and kexec feat(kexec & initram):Add kexec and initram support for x86 architecture Oct 22, 2025
@github-actions github-actions bot removed the ambiguous The title of PR/issue doesn't match the format label Oct 22, 2025
};

/// FileOperations trait - 类似于Linux的file_operations结构体
pub trait FileOperations: Send + Sync + Any + Debug {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个trait目前是除了 File 单给 PidFd 用?之前的实现里基本是用 IndexNode 实现功能再用struct File来暴露接口(哪怕一些场景下函数会嵌套)。PidFd 为什么不采用这种设计而选择直接 impl FileOperation ?这样不就容易导致一些地方需要 Arc<File> 然后 File 里实际上又是个 Arc<dyn IndexNode> 了嘛,比如下面的 stdio

- Support embedding initram and using Ramfs as the file system for extracting initram
- Support kexec series system calls, including load series and reboot
- Support u-root as the root file system to boot in Go language
- Add sysfs such as boot_crams and memmap
- Add a series of peripheral system calls related to the above

Signed-off-by: JensenWei007 <jensenwei007@gmail.com>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个脚本删掉,然后麻烦补充一个文档

Comment on lines +415 to +444
pub fn init_setupheader(&mut self) {
// 不设置就为0
// 下面的是根据同等 qemu 环境(日期为2025.10.15)在启动 Linux 的值
// 应该改成自己内核在初始化的过程中获得的值(部分值是需要写死的, 但不应该全部写死)
self.hdr.setup_sects = 0x40;
self.hdr.root_flags = 0xfb07;
self.hdr.syssize = 0x00000d00;
self.hdr.ram_size = 0x1000;
self.hdr.vid_mode = 0x09;
self.hdr.jump = 0xaa55;
self.hdr.header = 0x53726448;
self.hdr.version = 0x020f;
self.hdr.start_sys_seg = 0x1000;
self.hdr.kernel_version = 0x42a0;
self.hdr.type_of_loader = 0xb0;
self.hdr.loadflags = 0x83;
self.hdr.setup_move_size = 0x8000;
self.hdr.code32_start = 0x10000000;
self.hdr.ramdisk_image = 0x00100000;
self.hdr.ramdisk_size = 0x1eee6000;
self.hdr.bootsect_kludge = 0x010e9eb0;
self.hdr.heap_end_ptr = 0xfe00;
self.hdr.cmd_line_ptr = 0x20000;
self.hdr.initrd_addr_max = 0x7fffffff;
self.hdr.kernel_alignment = 0x00200000;
self.hdr.relocatable_kernel = 0x1;
self.hdr.min_alignment = 0x15;
self.hdr.xloadflags = 0x007f;
self.hdr.cmdline_size = 0x7ff;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里这样写死会不会不太对?

log::error!("x86 pvh, init_initramfs is not impled");
Ok(())
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里日志删掉?

Ok(())
}

fn early_init_memmap_sysfs(&self) -> Result<(), SystemError> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数以及early_memmap_init的命名感觉不太对。early_开头的指的是内存管理被初始化之前的。但是这函数运行时,内存管理都已经初始化完毕了。因此我认为要去掉early的开头

boot_params()
.write_irqsave()
.arch
.add_e820_entry(entry.addr, entry.size, t);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_e820_entry函数应该不用为la64和rv64实现吧?我发现貌似有多余的代码在那边

intertrait::init_caster_map();
}

pub fn enable_initramfs() -> bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数名应该是initramfs_enabled?

pub struct SigStack {
pub struct X86SigStack {
pub sp: *mut c_void,
pub flags: u32,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里重命名了,结果pcb里面的那个SigStack用的为什么又是通用的sigstack?类型不一致哇这样。
我感觉可以每个arch里面声明SigStack结构体,然后crate::ipc::signal_types那边,pub use一下就好了。

Comment on lines +388 to +427
/// @brief 在当前目录下,创建一个名为Name的符号链接(软链接),指向另一个IndexNode,支持链接向一个符号链接
///
/// @param name1 符号链接的名称, 将会在此目录下创建名为name的inode
/// @param name1 要被指向的 name 名称, 会根据此name与other的name区分是否指向一个符号链接
/// @param other 要被指向的IndexNode的Arc指针
///
/// @return 成功:Ok(新的inode的Arc指针)
/// 失败:Err(错误码)
fn symlink(
&self,
_name1: &str,
_name2: &str,
_other: &Arc<dyn IndexNode>,
) -> Result<(), SystemError> {
// 若文件系统没有实现此方法,则返回“不支持”
return Err(SystemError::ENOSYS);
}

/// @brief 在当前目录下,删除一个名为Name的符号链接(软链接)
///
/// @param name 符号链接的名称
///
/// @return 成功:Ok()
/// 失败:Err(错误码)
fn symunlink(&self, _name: &str) -> Result<(), SystemError> {
// 若文件系统没有实现此方法,则返回“不支持”
return Err(SystemError::ENOSYS);
}

/// @brief 在当前目录下,获取名为Name的符号链接(软链接)的执行的文件名称
///
/// @param name 符号链接的名称
///
/// @return 成功:Ok()
/// 失败:Err(错误码)
fn get_nextsym(&self, _name: &str) -> Result<String, SystemError> {
// 若文件系统没有实现此方法,则返回“不支持”
return Err(SystemError::ENOSYS);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里这样创建符号连接是不对的,缺少了权限校验之类的东西。
正确来说,创建符号链接应当使用do_symlinkat

Comment on lines +1323 to +1339

/// 查找链接文件的最底层链接, 目的是解决循环嵌套链接
/// 如 test -> echo, echo -> busybox, 需要解析 test 的链接情况
/// 返回 name 指向的文件的名称(可能为绝对路径, 具体值为symlink传入的参数值)
/// 如果返回其本身(最底层文件名, 经过路径处理后的), 说明此文件不是链接文件
#[allow(dead_code)]
pub fn get_link_true_file(name: String) -> Result<String, SystemError> {
let (filename, parent_path) = rsplit_path(&name);
let parent_inode = match parent_path {
None => ProcessManager::current_mntns().root_inode(),
Some(path) => ProcessManager::current_mntns()
.root_inode()
.lookup(path)
.unwrap(),
};
parent_inode.get_nextsym(filename)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是有lookup_follow_symlink吗

// 下面boot_params不应该用这些函数初始化, 详情见这些函数里的注释
bp.arch.set_alt_mem_k(0x7fb40);
bp.arch.set_scratch(0x10000d);
bp.arch.init_setupheader();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要硬编码这两个值?

let r = unsafe { UMASK };
unsafe { UMASK = mask as usize };
return Ok(r);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里改为AtomicUsize安全一些

@fslongjin
Copy link
Member

暂时先合入代码了,上面的内容麻烦 @JensenWei007 周末改下~

@fslongjin fslongjin merged commit bb99d3f into DragonOS-Community:master Oct 30, 2025
9 of 11 checks passed
mistcoversmyeyes pushed a commit to mistcoversmyeyes/DragonOS that referenced this pull request Nov 6, 2025
fix(futex): 修复futex系统调用参数处理逻辑 (DragonOS-Community#1321)

- 根据不同的futex命令类型正确处理第4个参数
- 对于WAIT系列操作,第4个参数被解释为超时指针
- 对于其他操作,第4个参数被解释为数值val2
- 仅在需要uaddr2的操作中校验uaddr2

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

feat(ipc): 实现 rt_sigtimedwait 系统调用并优化信号处理机制 (DragonOS-Community#1323)

* feat(ipc): 实现 rt_sigtimedwait 系统调用并优化信号处理机制

- 添加标准 POSIX siginfo_t 结构体及相关类型,用于用户态接口
- 实现 rt_sigtimedwait 系统调用,支持等待特定信号并处理超时
- 优化信号处理逻辑,确保信号正确标记为 pending
- 修复生命周期标注问题,提高代码健壮性
- 添加完整的系统调用测试用例

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

* feat(signal): 扩展实时信号支持并优化信号处理逻辑

- 新增实时信号定义(SIGRTMIN+1至SIGRTMIN+31)
- 改进信号唤醒机制,修复阻塞状态下的信号处理
- 增强内存错误日志,添加进程ID和RIP信息
- 重构抢占管理,引入PreemptGuard机制
- 优化rt_sigtimedwait系统调用实现

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

fix: 修复多线程的一些bug (DragonOS-Community#1325)

* feat: 增强信号处理和线程同步功能

- 修复信号处理默认行为,显式设置SIGCHLD/SIGURG/SIGWINCH为忽略
- 在信号处理和futex系统调用中添加内存屏障确保执行顺序
- 添加pthread创建和连接测试用例,验证线程功能正确性
- 优化进程退出时的子进程收养逻辑,移除调试日志
- 更新测试程序Makefile,添加pthread链接支持

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

* feat(mm): 实现MADV_DONTNEED内存建议操作

- 添加对MADV_DONTNEED和MADV_DONTNEED_LOCKED标志的处理
- 实现页面解除映射和TLB刷新逻辑
- 支持glibc pthread_create时的线程栈管理

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

* fix(robust_lock): 修复robust list获取逻辑

- 修正get_robust_list方法的参数命名和文档
- 修复用户空间指针处理逻辑,正确写入robust list head地址和大小

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

* refactor(kernel): 优化futex系统调用和线程相关代码

- 简化futex操作参数处理,移除不必要的错误检查
- 调整clone系统调用参数提取函数顺序
- 在clear_user函数中添加内存屏障
- 新增pthread基础功能测试程序

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

---------

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

fix(futex): 修复futex定时器激活逻辑导致唤醒丢失的问题&复FUTEX_WAKE_OP操作中的Linux兼容性问题 (DragonOS-Community#1326)

* fix(futex): 修复定时器激活逻辑以避免唤醒丢失

- 在阻塞进程时,确保定时器在中断关闭后被激活,以防止短超时导致的唤醒丢失
- 移除不必要的定时器激活调用,优化代码结构

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

* fix(futex): 修复FUTEX_WAKE_OP操作中的Linux兼容性问题

- 修复FUTEX_OP_ANDN操作的位运算逻辑错误
- 支持私有futex中uaddr为NULL时的Linux兼容行为
- futex_test启用PrivateFutex的测例

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

---------

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

feat(riscv platform vf2): vf2 platform adapted to riscv architecture (DragonOS-Community#1285)

- Add necessary platform driver support
- Modify some startup processes and assert
- Fixed some issues

Signed-off-by: JensenWei007 <jensenwei007@gmail.com>

add dropbear support (DragonOS-Community#1304)

DragonOS-Community#1304

* fix rename error in fat32

add a fake link implementation for fat32(it will be removed in the
future).

Signed-off-by: Godones <chenlinfeng25@outlook.com>

* feat: add new syscall and fix the fnctl error

add sendfile syscall.
add rt_sigsuspend syscall.
add sendfile test.
add setown/getown command for fcntl.

Signed-off-by: Godones <chenlinfeng25@outlook.com>

---------

Signed-off-by: Godones <chenlinfeng25@outlook.com>

feat(net): 桥接网络支持 (DragonOS-Community#1287)

* feat: 新增veth和bridge结构体,尚未详细测试

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(net): 完善一下已有的bridge以及veth设备,增加一些调试信息

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(net): 完善veth网卡驱动,能通过测例;简单修改vridge设备,尚未测试

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(routing): 简单添加路由子系统,尚未完成

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(veth): 增加veth默认对端路由

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(socket): 恢复udp socket中的wait_queue等待

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(net): 补充bridge的实现

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(bridge): 更改测试程序

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 重命名测试程序

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 更改veth&beidge测试程序的toml

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 暂时添加route_iface以及route_table

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: draft router

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 实现简单的路由功能,未详细测试

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 添加netlink框架,内核相应的处理逻辑以及读取写入用户空间尚未完成

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netlink): 完善netlink的读写部分,增加addr的内核处理逻辑

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 移动routing的位置

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 补充netlink的阻塞等待逻辑&&fmt

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netns): 添加网络命名空间

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netns): 删除全局路由,使用当前netns下的路由

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netlink): 将netlink socket移入netns中

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 完成netlink addr消息的支持,增加测试程序

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netlink): 消除一些warning

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* fix: 新建netns时插入loopback网卡到设备列表

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 将veth和bridge测试程序改用C完成

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(gdb): 增加gdb debug可选项

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* fix: 修复SockAddrIn结构体中的sin_addr字节序问题,确保正确处理IPv4地址

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 手糊实现路由功能,后续需要更改事件驱动

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netlink): 补充getlink方法以及相关结构体

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* Refactor network driver interfaces and introduce NAPI support

- Removed the default_iface parameter.
- Introduced a new NAPI module to manage network polling and scheduling.
- Updated the Iface trait to include a napi_struct method for NAPI support.
- Modified Veth network interfaces to integrate with the new NAPI structure.
- Refactored the Router implementation to remove unnecessary polling threads and wait queues.
- Updated NetNamespace to manage a list of bridge devices.
- Cleaned up various unused methods and comments across network-related files.

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 将virtio网卡的处理逻辑移动进ksoftirqd中

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(netlink): 暂时为多播消息添加allow unused,消除warning

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(nat): 实现SNAT和DNAT

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat(epoll): 更改epoll唤醒判断的逻辑,支持socket加入epoll

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 修改test_bind,防止爆内存

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 添加一个路由todo信息

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* fix: rebase主线之后修改冲突

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: fmt

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 清除无用日志

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 补充一个panic信息

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 将kernel文件夹重命名为kern

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

* feat: 删除netlink测试程序中的linux/netlink.h头文件

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

---------

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

feat(kexec & initram):Add kexec and initram support for x86 architecture (DragonOS-Community#1303)

- Support embedding initram and using Ramfs as the file system for extracting initram
- Support kexec series system calls, including load series and reboot
- Support u-root as the root file system to boot in Go language
- Add sysfs such as boot_crams and memmap
- Add a series of peripheral system calls related to the above

Signed-off-by: JensenWei007 <jensenwei007@gmail.com>

fix(syscall):修复syslog的bug (DragonOS-Community#1327)

- 在 procfs 的 syslog syscall 处理路径中增加对 SYSLOG_ACTION_READ_ALL (action = 3) 的分发。
- 直接调用现有的 Kmsg::read_all 接口,未修改 Kmsg 的实现逻辑。
- 修复了 gvisor 测试中 Syslog.ReadAll 因未分发而返回 EINVAL 的问题。

fix: 更新Makefile指定的Rust工具链为nightly-2025-08-10 (DragonOS-Community#1328)

* fix: 更新一些makefile中指定的工具链

* fix: 添加novashell到app-blocklist.toml

* fix: 修改nix-dev-shell指定的rust工具链版本号为2025-08-10

* fix: 更新enable_compile_gvisor.sh,避免对其他blocked_app的意外注释

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

---------

Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
Co-authored-by: sparkzky <sparkhhhhhhhhhh@outlook.com>

feat: 实现waitid系统调用及作业控制信号处理 (DragonOS-Community#1333)

* feat: 实现waitid系统调用及作业控制信号处理

- 新增waitid系统调用,支持WEXITED、WSTOPPED、WCONTINUED等选项
- 完善作业控制信号处理逻辑,支持SIGSTOP/SIGCONT的异步处理
- 优化信号唤醒机制,确保及时处理pending信号
- 添加waitid功能测试用例,验证系统调用正确性

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

* fix: 修复进程管理和信号处理中的竞态条件与错误处理

- 在信号唤醒逻辑中添加停止状态检查,避免错误唤醒已停止进程
- 修复进程等待循环中的错误处理,防止在ESRCH等错误时无限循环
- 优化CPU踢出逻辑,避免当前CPU自踢造成的竞态条件
- 清理信号类型定义中的冗余注释

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

* fix(ipc): 修正信号信息结构体字段顺序以符合Linux标准

- 调整SigInfo和PosixSigInfo结构体字段顺序
- 确保si_errno在si_code之前,符合Linux标准布局
- 更新相关转换代码中的字段赋值顺序

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

---------

Signed-off-by: longjin <longjin@DragonOS.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants