Skip to content

signal的处理(kill命令)以及一些其他的改进 #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Dec 8, 2022

Conversation

fslongjin
Copy link
Member

@fslongjin fslongjin commented Dec 6, 2022

暂时不支持用户程序注册自定义的sighandler,且只支持kill信号的默认处理方法.

更改如下

  • 将entry.S中冗余的ret_from_syscall代码删除,改为jmp Restore_all
  • new: 增加判断pt_regs是否来自用户态的函数
  • new: rust的cli和sti封装
  • 将原有的判断pt_regs是否来自用户态的代码,统一改为调用user_mode函数
  • ffz函数:获取u64中的第一个值为0的bit
  • spinlock增加 spinlock irq spin_unlock_irq
  • 临时解决显示刷新线程迟迟不运行的问题
  • 更改ffi_convert的生命周期标签
  • new: 测试signal用的app
  • 解决由于编译器优化导致local_irq_restore无法获取到正确的rflags的值的问题
  • new: exec命令增加"&"后台运行选项
  • procfs->status增加显示preempt和虚拟运行时间
  • 更改引用计数的FFIBind2Rust trait中的生命周期标签
  • new: signal处理(kill)

测试方法
1.在DragonOS的控制台输入 exec bin/test_signal.elf &.请注意,一定要输入末尾的 &,否则进程不会后台运行
2.然后kill对应的进程的pid (上一条命令执行后,将会输出这样一行:[1] 生成的pid)

del: 删除sighand_struct的wqh, 待将来有需要时,替换成rust版本的
bugfix: 解决拷贝sighand时的uaf问题
Copy link
Collaborator

@kkkkkong kkkkkong left a comment

Choose a reason for hiding this comment

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

1

@fslongjin fslongjin merged commit 1a2eaa4 into master Dec 8, 2022
@fslongjin fslongjin deleted the patch-ipc-signal branch December 8, 2022 14:59
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.

2 participants