feat: 支持动态链接 (#910)

* feat: 支持动态链接

Authored-By: chiichen <chiichen@qq.com>
Co-authored-by: longjin <longjin@DragonOS.org>
Signed-off-by: longjin <longjin@DragonOS.org>

* build: 更新构建容器版本至v1.12并指定DADK安装版本

- 将BUILD_CONTAINER_VERSION从v1.11升级到v1.12
- 修改bootstrap.sh和user/Makefile中DADK的安装方式,明确指定版本v0.4.0

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

---------

Signed-off-by: longjin <longjin@dragonos.org>
Co-authored-by: chiichen <chiichen@qq.com>
Co-authored-by: longjin <longjin@dragonos.org>
Co-authored-by: Jomo <xuzihao@dragonos.org>
Co-authored-by: MemoryShore <1353318529@qq.com>
This commit is contained in:
chiichen
2025-05-19 14:29:55 +08:00
committed by GitHub
parent b322121dd9
commit fccfa6f7ff
33 changed files with 477 additions and 273 deletions

View File

@ -177,6 +177,10 @@ impl X86_64MMArch {
error_code: X86PfErrorCode,
address: VirtAddr,
) {
// log::debug!("fault at {:?}:{:?}",
// address,
// error_code,
// );
let rflags = RFlags::from_bits_truncate(regs.rflags);
let mut flags: FaultFlags = FaultFlags::FAULT_FLAG_ALLOW_RETRY
| FaultFlags::FAULT_FLAG_KILLABLE

View File

@ -53,6 +53,7 @@ impl Syscall {
}
/// ## 用于控制和查询与体系结构相关的进程特定选项
/// https://code.dragonos.org.cn/xref/linux-6.6.21/arch/x86/kernel/process_64.c#913
pub fn arch_prctl(option: usize, arg2: usize) -> Result<usize, SystemError> {
let pcb = ProcessManager::current_pcb();
if let Err(SystemError::EINVAL) = Self::do_arch_prctl_64(&pcb, option, arg2, true) {
@ -109,8 +110,17 @@ impl Syscall {
}
#[allow(dead_code)]
pub fn do_arch_prctl_common(_option: usize, _arg2: usize) -> Result<usize, SystemError> {
todo!("do_arch_prctl_common not unimplemented");
pub fn do_arch_prctl_common(option: usize, arg2: usize) -> Result<usize, SystemError> {
// Don't use 0x3001-0x3004 because of old glibcs
if (0x3001..=0x3004).contains(&option) {
return Err(SystemError::EINVAL);
}
todo!(
"do_arch_prctl_common not unimplemented, option: {}, arg2: {}",
option,
arg2
);
}
}

View File

@ -90,7 +90,7 @@ pub extern "sysv64" fn syscall_handler(frame: &mut TrapFrame) {
mfence();
let pid = ProcessManager::current_pcb().pid();
let show = false;
// let show = if syscall_num != SYS_SCHED && pid.data() >= 7 {
// let show = if syscall_num != SYS_SCHED && pid.data() >= 9{
// true
// } else {
// false