Commit Graph

78 Commits

Author SHA1 Message Date
Ruihan Li 08dfe533c4 Use `Box<FileIo>` instead of `Arc<FileIo>` 2025-11-19 10:33:51 +08:00
jiangjianfeng 63354d670e Support mknod for /dev/full and /dev/tty0 2025-11-18 17:32:34 +08:00
Ruihan Li 7ebee6d8a1 Fix TTY's HUP events 2025-11-18 14:49:19 +08:00
jiangjianfeng 2f568d5e73 Read pty master should block if no pty slave is opened 2025-11-18 09:48:32 +08:00
Tao Su 83176020f2 Invoke get_report() using private memory 2025-11-17 15:26:45 +08:00
Qingsong Chen bb48b3814f Move DeviceId to separate device-id crate 2025-11-13 11:04:30 +08:00
jiangjianfeng cef527f372 Open /dev/tty should also increase pty slave count 2025-11-07 20:22:16 +08:00
jiangjianfeng 49485058ec Correct the device major ID for pty slave 2025-11-07 20:22:16 +08:00
jiangjianfeng a41db92b4e Support nonblocking mode for tty and pty 2025-11-07 20:22:16 +08:00
jiangjianfeng 601ac76676 Avoid unwrap on devpts when dropping pty master 2025-11-07 20:22:16 +08:00
jiangjianfeng cd981a0a8d Correct the behavior about closing pty 2025-11-07 20:22:16 +08:00
Chen Chengjun d42b006e1a Refactor named pipe to correct its opening and blocking behaviors 2025-11-03 09:57:48 +08:00
Chen Chengjun 5eddf21596 Introduce open API for Inode trait to replace as_* APIs 2025-11-03 09:57:48 +08:00
Chen Chengjun b447a605ed Introduce PerMountFlags and support MS_REMOUNT 2025-11-02 21:24:50 +08:00
Tao Su eb4edd25e8 Add TSM module 2025-10-31 08:53:27 +08:00
Ruihan Li 2d74e69b4b Add KDGKBMODE and KDSKBMODE ioctl support 2025-10-27 16:28:35 +08:00
Wei Zhang 2ba05a1673 Add KDGETMODE and KDSETMODE ioctl support
Add support for virtual console TTY mode management ioctls required by
Xorg and other display servers. The implementation includes:

- KDGETMODE: Query the current virtual console mode
- KDSETMODE: Switch between text and graphics modes

Virtual consoles utilize the framebuffer with two distinct modes:
- Text mode (default): Kernel renders text characters to framebuffer
- Graphics mode: User space applications gain full framebuffer control

Xorg requires KDSETMODE during initialization to switch to graphics
mode, preventing conflicts where both the kernel and Xorg would
simultaneously attempt to write to the framebuffer. This ensures
proper display handling and eliminates rendering artifacts.

Co-authored-by: Ruihan Li <lrh2000@pku.edu.cn>
2025-10-27 16:28:35 +08:00
Ruihan Li 38a217d201 Enhance `TtyDriver` to get the console 2025-10-27 16:28:35 +08:00
Wei Zhang 66d9dd41b9 Correct /dev/tty1 major number to 4
The major number for /dev/tty1 must be 4, as this value is hardcoded
in Linux and Linux syscall-compatible operating systems. Xorg uses
this major number directly, and incorrect values lead to confusion
and operational failures.

This change ensures compatibility with Xorg's expectations and
maintains system consistency.
2025-10-27 16:28:35 +08:00
Ruihan Li 7e7ba43cdf Revise some error messages 2025-10-22 14:05:38 +08:00
Chen Chengjun 782301c239 Remove open-related APIs from FsResolver 2025-10-17 16:18:56 +08:00
Ruihan Li d43fbd8f89 Fix some `getrandom` behavior 2025-09-30 11:36:37 +08:00
Ruihan Li 36a38c3f04 Bump `rand` version to 0.9.2 2025-09-30 11:36:37 +08:00
Chen Chengjun bacbe58ff3 Modify the related logics in the initial phase 2025-09-24 08:07:25 +08:00
jiangjianfeng 754ab5537c Add /dev/full device 2025-09-22 10:20:56 +08:00
Wang Siyuan 6dec3a6712 Replace `InodeMode::from_bits_trunucated` with `mkmod` 2025-09-22 10:20:36 +08:00
Ruihan Li ef5318c000 Rename `*FS` to `*Fs` 2025-09-08 14:40:08 +08:00
Ruihan Li b2f17d11c6 Remove common enum suffixes 2025-08-26 18:02:56 +08:00
Chen Chengjun b1bbd6c3fe Optimize the initialization logic during Asterinas init phase 2025-08-26 14:36:59 +08:00
Ruihan Li 5b91064316 Add a method that disables page fault handlers 2025-08-14 11:59:05 +08:00
Chen Chengjun 25d217397a Rename MountNode to Mount 2025-08-12 15:20:17 +08:00
Chen Chengjun 9985d64535 Complete some remaining rename tasks 2025-08-12 15:20:17 +08:00
Chen Chengjun c6a6e66aac Rename Dentry to Path in the other modules and rename some local variables 2025-08-06 14:06:39 +08:00
jiangjianfeng de97644b4c Move `ThreadFsInfo` from `PosixThread` to `ThreadLocal` 2025-08-06 13:38:42 +08:00
Ruihan Li a5e927b675 Make the framebuffer backspace work 2025-07-14 20:24:29 +08:00
Ruihan Li b1079c2bc5 Add support for font setting 2025-07-14 20:24:29 +08:00
Ruihan Li d73cbb5008 Clarify the `DeviceId` encoding 2025-07-03 14:30:14 +08:00
Ruihan Li 71e08b3942 Clean up TTY termios definitions 2025-06-10 14:30:02 +08:00
jiangjianfeng 597139a7f7 Fix a clippy error 2025-06-09 17:22:14 +08:00
Ruihan Li fe6b78058c Correct the blocking behavior 2025-06-09 13:10:34 +08:00
Ruihan Li 67065835ef Redefine the TTY driver interface 2025-06-09 13:10:34 +08:00
Ruihan Li 5a9a63e1a7 Use one lock for `LineDiscipline` 2025-06-09 13:10:34 +08:00
Ruihan Li 45258d0475 Unpack `LineDiscipline` from `Arc` 2025-06-09 13:10:34 +08:00
Ruihan Li ff907d1131 Implement race-free job control 2025-05-09 17:12:31 +08:00
Ruihan Li 6f20cfbe69 Move fields from PTY master to slave 2025-05-09 17:12:31 +08:00
jiangjianfeng 89e8cd5936 Move functions related to spawning the init process to a seperate module 2025-05-09 13:19:57 +08:00
Ruihan Li 5e13e0c325 Resolve lints in the TTY module 2025-05-06 11:55:06 +08:00
Zejun Zhao e4aa261c48 Make if_tdx_enabled macro x86-specific 2025-04-18 13:26:16 +08:00
Ruihan Li 8600278a5f Drop files at the correct time 2025-04-14 21:13:11 +08:00
Hsy-Intel 49e6cd2712 Use macro to handle TDX-related code 2025-03-20 17:25:22 +08:00