Commit Graph

1223 Commits

Author SHA1 Message Date
Chen Chengjun 498c2f3c91 Make FsFlags consistent with Linux's super block flags 2025-11-02 21:24:50 +08:00
Chen Chengjun c77edbace8 Provide mem_unit and procs in sysinfo 2025-11-02 14:09:55 +08:00
Tao Su eb4edd25e8 Add TSM module 2025-10-31 08:53:27 +08:00
Ruihan Li d487e42b7c Reunify the style of defining `arch` modules 2025-10-30 17:04:45 +08:00
Zejun Zhao 6af524b451 Support RISC-V Sv39 Paging mode 2025-10-30 14:51:37 +08:00
Zejun Zhao 3353e53577 Add VirtIO device probing code on RISC-V platforms 2025-10-30 10:47:53 +08:00
Zejun Zhao 39a541fdeb Add RISC-V FPU support 2025-10-29 13:24:30 +08:00
Wang Siyuan 89e759894f Remove `Rights` from VMO 2025-10-29 12:22:22 +08:00
Cautreoxit 0126d9b356 Set AT_SECURE value based on ELF's configuration 2025-10-29 09:57:16 +08:00
Cautreoxit 43fc98dc77 Migrate virtio-input to input subsystem API 2025-10-28 17:37:13 +08:00
Cautreoxit ee960c5f45 Migrate i8042 keyboard to input subsystem API 2025-10-28 17:37:13 +08:00
Cautreoxit 329fb4728a Add framebuffer console handler 2025-10-28 17:37:13 +08:00
Cautreoxit 9c062b1350 Add input subsystem
Co-authored-by: TinaZhangZW <ruoyuan.zw@antgroup.com>
2025-10-28 17:37:13 +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
Zejun Zhao f02c37dc2f Make writable pages readable on RISC-V platforms 2025-10-27 11:25:59 +08:00
Zejun Zhao 51767b519b Generate fault signal for RISC-V exceptions 2025-10-27 11:25:59 +08:00
Zejun Zhao 1e183825d3 Refactor RISC-V exception-related code 2025-10-27 11:25:59 +08:00
Zejun Zhao fe90e3051b Add fallback for RTC device 2025-10-27 09:50:46 +08:00
Ruihan Li 8a16aa3b86 Refine the `ProcessVm` structure 2025-10-26 10:14:00 +08:00
Ruihan Li badad44b54 Fix a small bug in remote memory access 2025-10-26 10:14:00 +08:00
Ruihan Li 54f2a25a3a Move remote memory access to the VM module 2025-10-26 10:14:00 +08:00
Ruihan Li b07d06170b Remove `Rights` from VMAR 2025-10-26 10:14:00 +08:00
Arthur Paulino 6a67807fd0 Implement `IdSet::iter_in`
This patch enables more expressive ways to slice and iterate over
the `Id`s in an `IdSet` with `IdSet::iter_in`, which takes an arbitrary
`IdSetSlicer`.

`IdSet::iter_in` efficiently slices out unintended inner parts and
then, within the remaining parts, skips inactive bits by using
`BitSlice::iter_ones` from the `bitvec` crate.

It also delivers several implementations of `IdSetSlicer` so OSTD
consumers can represent `Id` ranges ergonomically.

In the Asterinas kernel, `CpuSet::iter_in` enables a cleaner way to
define an interator that cycles over the CPUs.
2025-10-25 11:23:13 +08:00
Arthur Paulino 01d9b61337 Enhanced per-CPU load stats
This patch creates a `PerCpuLoadStats` with slightly enhanced, enough
to serve load stats and the load-balancing algorithm. This struct can
be further enhanced for more elaborated load-balancing algorithms in
the future.

The load stats report has been fixed, as `SchedulerStats::nr_queued_and_running`
no longer includes idle threads in the queued total nor in the running
threads.

Furthemore, the load-balancing algorithm has been improved because it
no longer accounts with the idle threads when they're enqueued.
2025-10-25 10:38:59 +08:00
jiangjianfeng fe39a6803d Unshare VM during execve 2025-10-25 10:36:30 +08:00
jiangjianfeng caeec3cdc1 Unshare signal handler during execve 2025-10-25 10:36:30 +08:00
jiangjianfeng 207bfe30e2 Support multithreaded execve 2025-10-25 10:36:30 +08:00
Zejun Zhao 8251d48bf2 Add RISC-V PLIC support 2025-10-24 16:28:41 +08:00
Chen Chengjun 0a80d55c95 Support mount bind a file 2025-10-24 11:13:09 +08:00
Chen Chengjun 53a1268e19 Add mountinfo files to proc filesystem 2025-10-24 11:12:16 +08:00
Chen Chengjun 7b68571290 Support generating the mount infomation 2025-10-24 11:12:16 +08:00
Tate, Hongliang Tian c44e45ea78 Add the `IdSet<I>` utility type 2025-10-22 14:29:52 +08:00
Ruihan Li 7e7ba43cdf Revise some error messages 2025-10-22 14:05:38 +08:00
Ruihan Li 9ac0e31981 Implement better FS path APIs 2025-10-22 14:05:38 +08:00
Chen Chengjun a22935f4c6 Correct the errno of waitid when the input pidfd is negative 2025-10-20 21:07:28 +08:00
Ruihan Li 8be8397a67 Make network callbacks and names related 2025-10-20 20:56:55 +08:00
Ruihan Li 582812ac92 Reorder `new_loopback` and `new_virtio` 2025-10-20 20:56:55 +08:00
Ruihan Li 74f23ce23d Fix some `kill`-related behavior 2025-10-20 14:05:45 +08:00
Ruihan Li 75edabc557 Construct `SignalSenderIds` from `Context` 2025-10-20 14:05:45 +08:00
Ruihan Li 43f50c5e2a Fix futex return values 2025-10-20 11:24:48 +08:00
Ruihan Li 52ddbeaff8 Use the `Arc<Waker>` address as the futex ID 2025-10-20 11:24:48 +08:00
Ruihan Li 34b4ad5e9b Clean up visibility in `futex.rs` 2025-10-20 11:24:48 +08:00
jiangjianfeng 600446e9e1 Cleanup ThreadName related code 2025-10-20 10:52:07 +08:00
Chen Chengjun 782301c239 Remove open-related APIs from FsResolver 2025-10-17 16:18:56 +08:00
Chen Chengjun c2ab393d57 Cleanup the lookup APIs of FsResolver 2025-10-17 16:18:56 +08:00
Ruihan Li bc6ef5231b Reorangize `ostd::arch::irq` 2025-10-16 21:46:40 +09:00
Wang Siyuan 3f2c319e00 Support `/proc/[pid]/mem` and `/proc/[pid]/task/[tid]/mem` 2025-10-15 16:34:32 +08:00