完成与Linux兼容的Ntty (#517)

* 已经完成的功能:
- 写:printf能够正常在tty输出
- 读:与键盘驱动接上
- 信号: 能够正常通过ctrl向前台进程发送信号

* 支持目前的shell,改动printk使其与新版tty兼容。

* 删除原有tty文件夹,并更改新tty文件名

* 添加clear清屏程序

* 实现tty部分ioctl,更改部分问题
This commit is contained in:
GnoCiYeH
2024-02-26 15:27:19 +08:00
committed by GitHub
parent 9993c0fc61
commit 52da9a5937
62 changed files with 8843 additions and 928 deletions

View File

@ -12,6 +12,7 @@ use crate::{
process::{
fork::KernelCloneArgs,
resource::{RLimit64, RUsage},
ProcessManager,
},
};
@ -853,6 +854,11 @@ impl Syscall {
Ok(0)
}
SYS_SETPGID => {
kwarn!("SYS_SETPGID has not yet been implemented");
Ok(0)
}
SYS_RT_SIGPROCMASK => {
kwarn!("SYS_RT_SIGPROCMASK has not yet been implemented");
Ok(0)
@ -1009,6 +1015,19 @@ impl Syscall {
Err(SystemError::ENOSYS)
}
#[cfg(target_arch = "x86_64")]
SYS_GETRLIMIT => {
let resource = args[0];
let rlimit = args[1] as *mut RLimit64;
Self::prlimit64(
ProcessManager::current_pcb().pid(),
resource,
0 as *const RLimit64,
rlimit,
)
}
SYS_SCHED_YIELD => Self::sched_yield(),
_ => panic!("Unsupported syscall ID: {}", syscall_num),