Compare commits

...

230 Commits

Author SHA1 Message Date
Ruihan Li f4102e7db4 Rename `call_ostd_main` to `start_kernel` 2026-02-11 02:02:57 -08:00
Ruihan Li 195ff99138 Mark `call_ostd_main` as unsafe 2026-02-11 02:02:57 -08:00
Xinyi Yu e6104161b7 Prevents ID allocation beyond bitmap bounds 2026-02-10 20:33:34 -08:00
Ruihan Li c9032ad97c Fix `redundant_test_prefix` 2026-02-09 23:47:49 -08:00
Ruihan Li bc9f8fe964 Implement/Enable `redundant_test_prefix` 2026-02-09 23:47:49 -08:00
Ruihan Li b86d74344a Clean up `ostd-macros` 2026-02-09 23:47:49 -08:00
Jianfeng Jiang 5f8b019369 Replace `from_first_bytes` with `from_bytes` if possible 2026-02-08 20:32:24 -08:00
Jianfeng Jiang bf13673b97 Replace all usage of `from_bytes` with `from_first_bytes` 2026-02-08 20:32:24 -08:00
jiangjianfeng 4a80f0e5eb Replace Pod with zerocopy-backed Pod 2026-02-08 20:32:24 -08:00
jiangjianfeng c8f2cfaeae Add ostd-pod crate and #[derive(pod)], pod_union macros 2026-02-08 20:32:24 -08:00
jiangjianfeng d1c9d119b3 Add macro for padding struct 2026-02-08 20:32:24 -08:00
li041 84bced252b Add `pidfd_send_signal` syscall 2026-02-08 20:29:29 -08:00
li041 3ae286980e Genericize `kill*` functions with `Signal` trait 2026-02-08 20:29:29 -08:00
dependabot[bot] 3d6d91ea18 Bump time from 0.3.41 to 0.3.47
Bumps [time](https://github.com/time-rs/time) from 0.3.41 to 0.3.47.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/compare/v0.3.41...v0.3.47)

---
updated-dependencies:
- dependency-name: time
  dependency-version: 0.3.47
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-06 00:27:43 -08:00
dependabot[bot] a84813150f Bump lru from 0.12.5 to 0.16.3
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.12.5 to 0.16.3.
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.12.5...0.16.3)

---
updated-dependencies:
- dependency-name: lru
  dependency-version: 0.16.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-05 19:39:29 -08:00
Ruihan Li 81e4c90449 Enable more regression tests 2026-02-06 10:09:59 +08:00
Ruihan Li 18f97d01fc Replace warnings with explanation 2026-02-06 10:09:59 +08:00
Ruihan Li dd25a8ad62 Rewrite `Credentials` comments 2026-02-06 10:09:59 +08:00
Ruihan Li 744e95a819 Correct some `Credentials` behavior 2026-02-06 10:09:59 +08:00
Ruihan Li 5bd40d7bd5 Reorder some `Credentials` methods 2026-02-06 10:09:59 +08:00
Hsy-Intel 5d0779bd83 Fix format issue 2026-02-03 22:57:49 -08:00
Hsy-Intel 4f8bbf18a6 Enable `cvm_guest` feature by default in aster-kernel 2026-02-03 22:57:49 -08:00
Xinyi Yu b0407dd517 Add `proc/self/mounts` and `proc/mounts` 2026-02-03 14:03:36 -08:00
Ruihan Li ab4e0d9012 Make `populate_device` infallible 2026-02-03 13:18:10 -08:00
Ruihan Li 8297da7247 Remove `VmMapping::inode` 2026-02-03 13:18:10 -08:00
Ruihan Li 894f6ba9b4 Fix heap lock issues 2026-02-03 13:18:10 -08:00
Ruihan Li 6d2ff13a63 Redirect serial output if `hvc0` is on 2026-01-28 19:43:55 -08:00
Qingsong Chen a4f77b12b6 Revise InodeDesc.acl from Option<Bid> to Bid 2026-01-28 18:43:02 -08:00
Qingsong Chen 28fe11e98d Fix ext2 fast symlink inode detection logic 2026-01-28 18:43:02 -08:00
Xinyi Yu 01cf00a4c6 Trim whitespace from input string before parsing in `OomScoreAdhFileOps::write_at` method 2026-01-28 16:19:03 -08:00
Ruihan Li a599a2c563 Disable BAR decoding when sizing PCI BARs 2026-01-27 23:05:02 -08:00
Ruihan Li eefdaf4de9 Fix minor problems in PCI 2026-01-27 23:05:02 -08:00
Ruihan Li b11fcdcf0b Remove unused code in PCI 2026-01-27 23:05:02 -08:00
Wang Siyuan 08d54ec6ad Add entries other than `[stack]` in `/proc/[pid]/maps` 2026-01-27 23:01:17 -08:00
Wang Siyuan fb8c9e0c27 Revert "`ProgramToLoad` only needs a `elf_inode: Arc<dyn Inode>` instead of a `Path`"
This reverts commit 71632a51b5.
2026-01-27 23:01:17 -08:00
Marsman1996 66ac28c4c2 Add test for permission validation of mprotect and mmap 2026-01-27 21:24:35 -08:00
Marsman1996 ea142155fb Fix permission validation in mprotect and mmap 2026-01-27 21:24:35 -08:00
li041 306cc714ae Align `PidFile` semantics with POSIX standards 2026-01-28 11:20:50 +08:00
Ruihan Li 425cc2d1cf Fix some style issues 2026-01-28 11:07:28 +08:00
Ruihan Li b1071b6b92 Remove old gVsior workaround 2026-01-28 11:07:28 +08:00
Ruihan Li 22dd288b07 Support `make run_kernel CONSOLE=ttyS0` 2026-01-27 17:44:41 -08:00
Ruihan Li 3c959bf0a0 Support `/dev/ttyS0` and `console=ttyS0` 2026-01-27 17:44:41 -08:00
Ruihan Li 000ad53c9f Support UART console 2026-01-27 17:44:41 -08:00
Ruihan Li 81c2f8d4bd Move NS16650A UART driver outside `arch` 2026-01-27 17:44:41 -08:00
root dee39e21d1 x86/tdx: integrate fatal error reporting and improve initialization 2026-01-27 16:32:36 -08:00
Ruihan Li a82d185154 Use PCI ECAM in x86 if possible 2026-01-27 16:24:07 -08:00
Ruihan Li a09de99c1d Ensure PCI access atomicity 2026-01-27 16:24:07 -08:00
Ruihan Li f055a387a7 Get the PCI bus number range 2026-01-27 16:24:07 -08:00
Ruihan Li 5499436807 Add regression tests for recent issues 2026-01-27 10:02:21 +08:00
Ruihan Li a3314c6432 Ignore high bits in PCI BAR sizes 2026-01-26 17:19:10 -08:00
Xinyi Yu 459a634e4a fmt 2026-01-26 15:22:23 -08:00
Xinyi Yu 76586dd6fb Update the book 2026-01-26 15:22:23 -08:00
Xinyi Yu b2ea514556 Impl BLKGETSIZE64 ioctl 2026-01-26 15:22:23 -08:00
Chaoqun Zheng e4ebd821de Fix error setting bid in `InodeImpl::free_indirect_blocks_required_by` 2026-01-26 15:17:07 -08:00
Tate, Hongliang Tian e44d7e2b12 Update the intro section of README 2026-01-25 20:52:55 -08:00
Wang Siyuan b7ae738310 Cleanup: Only maintain children for directory dentries 2026-01-22 11:39:09 +08:00
Marsman1996 5792b49722 Fix error handling in OverlayFsType by propagating lookup errors 2026-01-21 00:30:23 -08:00
Ruihan Li 6a61aa39b0 Handle the listener in `State::set_pass_cred` 2026-01-21 10:11:19 +08:00
Marsman1996 43f570730c Fix new_fd validation to use resource limits in `do_dup3` 2026-01-20 16:02:40 +08:00
Ruihan Li 6520682360 Inherit `SO_PEERCRED` for accepted sockets 2026-01-20 14:51:23 +08:00
Ruihan Li 98529bdbf0 Support `SO_PEERCRED` for UNIX datagrams 2026-01-20 14:51:23 +08:00
Ruihan Li db6292a310 Triage some gvisor tests 2026-01-20 14:49:34 +08:00
Zhang Junyang 77f0b0e746 Add missing safety comments in `boot_pt` 2026-01-19 23:41:42 +08:00
Zhang Junyang c77c2686d8 Revise `PageTableEntryTrait` 2026-01-19 23:41:42 +08:00
Ruihan Li f62ae40188 Allow empty UNIX control messages 2026-01-19 16:18:26 +08:00
Ruihan Li bdc1c79770 Fix overflow behavior and control flags 2026-01-18 18:39:32 -08:00
Ruihan Li e082d4eaa6 Respect `InotifyControls::ONESHOT` 2026-01-18 18:39:32 -08:00
Ruihan Li b5518ccd64 Remove unnecessary atomic loads 2026-01-18 18:39:32 -08:00
Ruihan Li 43b8838d6a Reject new watches on deleted inodes 2026-01-18 18:39:32 -08:00
li041 d23d25c552 Add `pidfd_getfd` syscall 2026-01-18 14:58:18 -08:00
li041 f58fb66cba Refactor `PidFile` to use `Weak<Process>` 2026-01-18 14:58:18 -08:00
Marsman1996 2219e83f8e Fix invalid mapping in mremap fast path 2026-01-16 17:22:18 +08:00
Qingsong Chen b2b6499466 Add disk space cleanup step for test_riscv/x86 workflows 2026-01-15 23:33:22 -08:00
Chen Chengjun 8e6406ae35 Add regression tests 2026-01-15 19:04:51 -08:00
Chen Chengjun 38d455496b Modify all usages of the removed Path APIs 2026-01-15 19:04:51 -08:00
Chen Chengjun 1e5f2e186c Consolidate all path resolution related interfaces under PathResolver 2026-01-15 19:04:51 -08:00
Chen Chengjun 5d5f0bdcde Rename FsResolver to PathResolver and update all usages 2026-01-15 19:04:51 -08:00
Chen Chengjun 505114c17b Move fs_resolver.rs to path module as resolver.rs 2026-01-15 19:04:51 -08:00
Qingsong Chen 815cbf061b Switch to a new Docker image 0.17.0-20260114 2026-01-14 20:20:48 -08:00
Ruihan Li bd72728e04 Fix a typo in i8042 `is_present_cmdline` 2026-01-14 19:30:46 -08:00
Qingsong Chen 1c4fa5b303 Fix incorrect path in benchmark script 2026-01-14 19:29:48 -08:00
Qingsong Chen 3fa0a105b0 Add free-disk-space action to Docker publish workflows 2026-01-14 19:21:54 -08:00
Tate, Hongliang Tian f1a144b876 Add a Github workflow to close stale issues and PRs 2026-01-14 14:56:46 -08:00
Qingsong Chen 1723e5d944 Fix nix Dockerfile to use correct test directory 2026-01-14 00:09:56 -08:00
Qingsong Chen e483742852 Bump the Docker image version to 0.17.0-20260114 2026-01-13 22:12:43 -08:00
Qingsong Chen 1cfe1709ed Update LTP syscall test blocklists 2026-01-13 22:12:43 -08:00
Qingsong Chen 7929aaf773 Upgrade LTP test version to 20250930 2026-01-13 22:12:43 -08:00
Qingsong Chen 3e7f321def Update gvisor syscall test blocklists 2026-01-13 22:12:43 -08:00
Qingsong Chen 7764cd6839 Upgrade gvisor syscall test version to release-20251215.0 2026-01-13 22:12:43 -08:00
Ruihan Li c1aa8a805c Fix checks for `VmarMapOptions::offset` 2026-01-14 10:27:33 +08:00
Ruihan Li fdcf5fd0fe Remove the `AT_NULL` variant 2026-01-14 10:27:33 +08:00
Ruihan Li 48ccafd7f9 Clean up the `init_stack` module 2026-01-14 10:27:33 +08:00
Chen Chengjun 738d14f3c0 Modify the CI workflows 2026-01-13 11:53:34 -08:00
Chen Chengjun ed333aa2c9 Add tests for podman -it 2026-01-13 11:53:34 -08:00
Chen Chengjun d193ba821a Migrate the original NixOS tests using the new framework 2026-01-13 11:53:34 -08:00
Chen Chengjun c439df3d02 Introduce a test framework for Asterinas NixOS 2026-01-13 11:53:34 -08:00
Chen Chengjun bae5de9e8f Move test/* to test/initramfs/* 2026-01-13 11:53:34 -08:00
wyt8 4fa2b55e47 Place the heap after bss segment 2026-01-13 22:01:15 +08:00
wyt8 dac3e94bea Consider the PIE condition when loading the ELF 2026-01-13 22:01:15 +08:00
Ruihan Li 3d27b376d7 Keep various things sorted 2026-01-13 00:15:43 -08:00
Marsman1996 d9f4229e6c Fix panic in `add_posix_timer` 2026-01-13 11:06:09 +08:00
Marsman1996 8335ba22d9 Fix stack overflow handling in InitStackWriter by validating positions before writing 2026-01-12 15:57:31 +08:00
Wang Siyuan 1e77c0a938 Cleanup: Use `AtomicStatusFlags::new(flags)` instead of `AtomicU32::new(flags.bits())` 2026-01-11 17:00:23 -08:00
Wang Siyuan 4a88b6aa86 Add regression tests 2026-01-11 17:00:23 -08:00
Wang Siyuan 138401b0ab Remove `PathOrInode` 2026-01-11 17:00:23 -08:00
Wang Siyuan fedd6dc196 Apply pseudo `Path` to members of `anon_inodefs` 2026-01-11 17:00:23 -08:00
Wang Siyuan 0565dd1349 Apply pseudo `Path` to sockets 2026-01-11 17:00:23 -08:00
Wang Siyuan bbb6a63ee4 Apply pseudo `Path` to anonymous pipes and remove `AnonPipeFile` 2026-01-11 17:00:23 -08:00
Wang Siyuan 8eade9b631 Move pipe ktests into `pipe::common` 2026-01-11 17:00:23 -08:00
Wang Siyuan b25e41dd4f Apply pseudo `Path` to memfd files and remove `MemfdFile` 2026-01-11 17:00:23 -08:00
Wang Siyuan e6361e5242 Add pseudo `Path` 2026-01-11 17:00:23 -08:00
Wang Siyuan cb5449cf2a Add pseudo `Dentry` 2026-01-11 17:00:23 -08:00
Wang Siyuan fe633972f3 Add pseudo `Mount` 2026-01-11 17:00:23 -08:00
jiangjianfeng 184e803869 Use accurate build time only when publishing 2026-01-08 20:02:57 -08:00
Tao Su 8ace76978e Add unit tests for DMA `alloc` and `alloc_uninit()` 2026-01-07 22:38:50 -08:00
Tao Su 1442060c2d Introduce `DmaStream::alloc` to reduce memory copy in TDX 2026-01-07 22:38:50 -08:00
Tao Su fc2e8d95c9 Add `DmaCoherent::alloc_uninit()` and defer zeroing to `DmaCoherent::alloc()` 2026-01-07 22:38:50 -08:00
Ruihan Li 922b204280 Move `Pipe` from `InodeImpl` to `Inode` 2026-01-07 15:41:14 +08:00
Tao Su 91604c7b51 Stop hardcoding TDX guest object 2026-01-06 22:34:10 -08:00
Tao Su 284e193823 Support QOM format when parsing QEMU arguments 2026-01-06 22:34:10 -08:00
Ruihan Li 413f459e20 Find present pages in xarray 2026-01-07 10:31:57 +08:00
Qingsong Chen 33f370966d Rename aster-nix to aster-kernel 2026-01-06 16:16:17 -08:00
Wang Siyuan bb9b979586 Support allocating inodes from `PseudoFs` 2026-01-06 14:26:06 +08:00
Wang Siyuan 02a04f1365 Polling a `fd` opened with `O_PATH` should return `POLLNVAL` 2026-01-06 14:26:06 +08:00
Wang Siyuan 1bf5b398dc Remove `inode_handle/dyn_cap.rs` and `HandleInner` 2026-01-06 14:26:06 +08:00
Wang Siyuan f2b9e356f1 Reorder `HandleInner` methods to clarify diff 2026-01-06 14:26:06 +08:00
Yuke Peng 4213908366 pci: Improves PCI device enumeration by suppporting multi-function detection 2026-01-05 19:08:34 -08:00
Yuke Peng c825c0d2c8 pci: Add `PciHeaderType` & `PciDeviceType` and refactor `BarManager` 2026-01-05 19:08:34 -08:00
Yuke Peng 7634a27ba6 pci: Split the configuration space offset into device-specific 2026-01-05 19:08:34 -08:00
Zhenchen Wang 3dd881dec5 Improve fsnotify functions to pass name information more effectively 2026-01-05 13:45:25 -08:00
Zhang Junyang d7cefdb761 Fix the DMA debug assertion regression 2026-01-05 20:59:42 +08:00
Ruihan Li 7ed0152d83 Remove some fdinfo attributes 2026-01-04 21:18:02 -08:00
Ruihan Li d461f81ecb Optimize `copy_to_user` 2026-01-04 21:18:02 -08:00
Ruihan Li 2155869920 Refactor `try_read` 2026-01-04 21:18:02 -08:00
Ruihan Li 4a93b34e3d Refactor `add_watch` and `remove_watch` 2026-01-04 21:18:02 -08:00
Ruihan Li 1ab7550c83 Fix comment styles and outdated comments 2026-01-04 21:18:02 -08:00
zzjrabbit a42b4cd078 Fix all occurrences of "grub.protocol" in OSDK.toml 2026-01-04 11:39:02 -08:00
Chen Chengjun 6288c057b0 Handle the QEMU exit code 2026-01-04 10:54:51 -08:00
jiangjianfeng 976f088712 Get package version via cargo metadata 2026-01-04 10:51:36 -08:00
jiangjianfeng 52085063bf Update bump_version.sh 2026-01-04 10:51:36 -08:00
jiangjianfeng c09654887c Let mlsdisk use Pod from OSTD 2026-01-04 10:51:36 -08:00
jiangjianfeng 6f54cc56e7 Move int-to-c-enum from kernel/libs to ostd/libs 2026-01-04 10:51:36 -08:00
jiangjianfeng 01cac4268e Manage dependencies at workspace level 2026-01-04 10:51:36 -08:00
jiangjianfeng 34ab63addb Manage package metadata at workspace level 2026-01-04 10:51:36 -08:00
jiangjianfeng f4fab3f38a Check non-OSDK crates with cfg(test) and without cfg(test) 2026-01-04 10:48:11 -08:00
jiangjianfeng 95fc2ef17f Rename OSDK clippy option from ktest to ktests 2026-01-04 10:48:11 -08:00
Tao Su 4f62f2db8e Use correct GPA range when accepting pages in `protect_gpa_tdvm_call()` 2026-01-03 21:25:01 -08:00
jiangjianfeng a0b746fb3f Run clippy test with and without ktest configuration 2026-01-03 21:17:39 -08:00
jiangjianfeng 6eb6968716 Fix broken documentation link 2026-01-04 10:47:18 +08:00
jiangjianfeng 64bac5c7b4 Add generic syscall table 2026-01-04 10:13:19 +08:00
Ruihan Li eb83a38d12 Don't panic in LoongArch64 VirtIO MMIO probe 2026-01-03 11:16:36 -08:00
Ruihan Li d18b1dc624 Simplify `fill_zeros_remote` and others 2026-01-03 10:59:41 -08:00
Ruihan Li eb76ded5fc Simplify/Clarify `notify/mod.rs` code 2026-01-02 16:47:03 -08:00
Ruihan Li 8397854b37 Fix `accepts_new_subscribers` race 2026-01-02 16:47:03 -08:00
Ruihan Li 48c5891543 Remove `VecDeque::try_with_capacity` 2026-01-02 16:47:03 -08:00
Ruihan Li dccf23e283 Redesign inode extensions 2026-01-02 16:47:03 -08:00
jiangjianfeng bc230b24e1 Fix doc warnings 2026-01-02 11:26:43 -08:00
jiangjianfeng dd440c1376 Check documentation of all crates in `make docs` 2026-01-02 11:26:43 -08:00
Marsman1996 26ac77c371 Fix overflow panic in syscall `fcntl` 2026-01-01 22:50:30 +08:00
Ruihan Li 81e9bfa2ee Flush TLBs in `IoMem::new` 2025-12-31 20:00:37 -08:00
Zhang Junyang 6ad67309fd Seal the kernel page table 2025-12-31 19:40:11 -08:00
Zhang Junyang abf8d9f5e4 Clean up TDX linear mapping protecting operations
Co-authored-by: Tao Su <st498824@antgroup.com>
2025-12-31 19:40:11 -08:00
Zhang Junyang 71681dd947 Refactor DMA APIs 2025-12-31 19:40:11 -08:00
Zhang Junyang 0c30edb5da Add a `Split` trait for `KVirtArea` and `Segment` 2025-12-31 19:40:11 -08:00
Zhang Junyang 8dbb5ecd69 Add a range counter 2025-12-31 19:40:11 -08:00
jiangjianfeng 82ccfcd4c6 Refactor the implementation of prlimit64 2025-12-31 16:18:45 +08:00
zjp c91d383c91 Fix `offset: *mut Self` by `offset: usize` in SingleInstruction traits 2025-12-30 14:36:50 +08:00
Ruihan Li 033c240d8f Fix madvise behavior 2025-12-29 19:43:00 +08:00
Ruihan Li 7feb803eab Fix cases where some pages are not mapped 2025-12-29 19:43:00 +08:00
Ruihan Li eee6708aec Fix error codes in MM syscalls 2025-12-29 19:43:00 +08:00
Ruihan Li 142cd4b481 Add `is_userspace_vaddr_range` 2025-12-29 19:43:00 +08:00
Ruihan Li d19ffac68a Drop `MAP_SYNC` support 2025-12-29 19:43:00 +08:00
Ruihan Li e40091808a Fix error codes in mmap 2025-12-29 19:43:00 +08:00
Jakob Hellermann 84b235d3dd Fix invalid environment name escaping in Makefile
This would print 'Error: this \ environment variable must be given'
previously.
2025-12-29 19:41:00 +08:00
Cautreoxit 1fe337e2fd Add SCML for ioprio_get and ioprio_set 2025-12-29 19:39:17 +08:00
Cautreoxit cdf4ff398d Add SCML for fadvise64 2025-12-29 19:39:17 +08:00
Cautreoxit f248b83ecc Add SCML for close_range 2025-12-29 19:39:17 +08:00
jiangjianfeng 4263b9be33 Remove multilingua from book.toml 2025-12-29 19:37:02 +08:00
jiangjianfeng 8c090eb0e7 Bump docker ref to 0.17.0-20251228 2025-12-29 19:37:02 +08:00
Chaoqun Zheng ebfa7977b1 Adjust `blocks_count` field to `sector_count` in `InodeDesc` and `RawInode`.
In ext2, the granule of the `blocks_count` field in disk-inode is fixed at
512B. In the current implementation of Asterinas, the `blocks_count`
granule of memory-inode is BLOCK_SIZE.
2025-12-29 10:26:48 +08:00
Ruihan Li 046c9f6a94 Improve futex code and log clarity 2025-12-29 10:11:26 +08:00
Ruihan Li ca384fc427 Never allow overlapping ELF maps 2025-12-29 10:09:58 +08:00
Ruihan Li e92fbe3e69 Correct ELF alignment settings 2025-12-29 10:09:58 +08:00
Marsman1996 545efaa155 Validate futex address alignment when waking robust futexes 2025-12-28 23:48:34 +08:00
Tao Su 2502e01909 Add SCML for `ioctl` 2025-12-28 23:01:44 +08:00
Tao Su cf74341805 Add SCML for `utimensat` 2025-12-28 23:01:44 +08:00
Tao Su 7c7dd47b9b Add SCML for `flock` and `fallocate` 2025-12-28 23:01:44 +08:00
Tate, Hongliang Tian dfe19e4f3c Bump the Docker image version to 0.17.0-20251228 2025-12-28 10:21:58 +08:00
Tate, Hongliang Tian 7dc6fb980f Upgrade mdBook to 0.5.2 2025-12-28 10:21:58 +08:00
Tate, Hongliang Tian 83c167ed5d Fix the broken link to "Contriubting to Asterinas" in Book 2025-12-28 09:48:41 +08:00
rikosellic c4e8bf2c21 Remove WeakRef and NonNullPtr impl for Weak<T> 2025-12-26 17:00:11 +08:00
Marsman1996 b46a02463b Replace RwLock with RwMutex for child node management in SysTree 2025-12-26 14:08:17 +08:00
Marsman1996 6d1155896d Fix OOM in `getdents(64)` by user space writer 2025-12-26 14:08:17 +08:00
Ruihan Li 57399a223c Update outdated compatibility data 2025-12-26 13:16:59 +08:00
Ruihan Li 631cbf92c3 Add SCMLs for some network syscalls 2025-12-26 13:16:59 +08:00
Zhenchen Wang 847ef4c784 update statx scml documentation
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2025-12-26 13:16:59 +08:00
Ruihan Li 4fdf400d2a Separate VMAR load and activation 2025-12-26 13:16:59 +08:00
Ruihan Li e2f7b0eb73 Clean up `ProgramToLoad` 2025-12-26 13:16:59 +08:00
Ruihan Li 2b8ccbf3d2 Clean up `load_elf.rs` and do overflow checks 2025-12-26 13:16:57 +08:00
Ruihan Li 586266b086 Clean up `elf_file.rs` 2025-12-25 15:41:58 +08:00
Marsman1996 bcf8f5e93c Fix OOM by adding SYSCTL_NR_OPEN limit for setrlimit and prlimit64 2025-12-25 10:17:28 +08:00
Zhenchen Wang cd7859161d Fix the issue of notifying parent in fsnotify 2025-12-25 09:55:08 +08:00
Marsman1996 2c80e0c3a4 Fix reachable unwrap in sys_arch_prctl by using the ? operator 2025-12-23 11:42:32 +08:00
Zhang Junyang ae3113194a Adjust the documentation of `aster-nix::vm` 2025-12-23 11:39:49 +08:00
Zhang Junyang afe5e59aeb Split `vmar/mod.rs` into several files 2025-12-23 11:39:49 +08:00
jiangjianfeng 1ae4bb4743 Add Git tag before creating release 2025-12-23 10:29:08 +08:00
jiangjianfeng 6f25a6cdd6 Let publish_aster_nixos create tag with prefix 'v' 2025-12-23 10:29:08 +08:00
jiangjianfeng 7106c8acd8 Remove push_git_tag workflow 2025-12-23 10:29:08 +08:00
jiangjianfeng c7fa152889 Using paths instead of tags in publish_aster_nixos workflow 2025-12-23 10:29:08 +08:00
zjp 9c4f644bd9 Replace caps_lock's load+store by fetch_xor
It's a bit less efficient, but solves atomic violation.
2025-12-20 20:35:49 +08:00
Tate, Hongliang Tian cc0609bc81 Add 0.17.0 release notes 2025-12-19 18:01:59 +08:00
jiangjianfeng b8654ed1b9 Add SCML for faccessat2 2025-12-18 00:57:34 +08:00
jiangjianfeng 4a9820cb11 Add SCML for clone3 2025-12-18 00:57:34 +08:00
jiangjianfeng e238c56d5a Add SCML for setns 2025-12-18 00:57:34 +08:00
jiangjianfeng 026b672393 Add SCML for unshare 2025-12-18 00:57:34 +08:00
jiangjianfeng 161dfbf90b Add SCML for ppoll 2025-12-18 00:57:34 +08:00
jiangjianfeng 420c54de0e Add SCML for accept and accept4 2025-12-18 00:57:34 +08:00
jiangjianfeng fff756f116 Mark nanosleep,sigaltstack,execveat,pidfd_open as fully-supported 2025-12-18 00:57:34 +08:00
Qingsong Chen 9b37e465ee Switch to a new Docker image 0.17.0-20251217 2025-12-17 19:49:41 +08:00
Chen Chengjun 7caababf8d Add SCML for waitid syscall 2025-12-17 19:45:44 +08:00
Chen Chengjun b9e640f697 Add SCML for timer-related syscalls 2025-12-17 19:45:44 +08:00
Qingsong Chen 8f7e6294e9 Update lmbench to fix fifo_lat benchmark 2025-12-17 18:11:38 +08:00
Qingsong Chen 302da67903 Bump the docker version to 0.17.0-20251217 2025-12-17 17:23:01 +08:00
Qingsong Chen f7afb13a67 Remove unnecessary packages and nix-store optimisation to reduce docker image size 2025-12-17 17:23:01 +08:00
Tate, Hongliang Tian 2266ce5959 Add a disclaimer to clarify the relationship with NixOS foundation 2025-12-17 13:52:34 +08:00
Ruihan Li f30bd698d1 Define `__asterinas__` macro in tests 2025-12-16 12:03:43 +08:00
Ruihan Li da67967f6d Add `BASIC_TEST_PLATFORM` option 2025-12-16 12:03:43 +08:00
Ruihan Li 4f05bdc891 Replace `CHECK_MM` with `TEST_SUCC` 2025-12-16 12:03:43 +08:00
Ruihan Li 49a2cecc81 Clarify the code for a long shebang 2025-12-15 10:12:12 +08:00
Tao Su ecd0ac9662 Define `ASTER_SCML` in `validate_scmls` workflow 2025-12-14 08:08:56 +08:00
1147 changed files with 20471 additions and 11752 deletions

View File

@ -1,6 +1,6 @@
# Ignore binaries to avoid performance issues
target/
test/build/
test/initramfs/build/
# QEMU log file
qemu.log

View File

@ -41,7 +41,7 @@ runs:
shell: bash
run: |
make install_osdk
bash test/src/benchmark/bench_linux_and_aster.sh "${{ matrix.benchmarks }}" "${{ inputs.platform }}"
bash test/initramfs/src/benchmark/bench_linux_and_aster.sh "${{ matrix.benchmarks }}" "${{ inputs.platform }}"
BENCHMARK_ARTIFACT=results_$(echo "${{ matrix.benchmarks }}" | tr '/' '-')
echo "BENCHMARK_ARTIFACT=$BENCHMARK_ARTIFACT" >> $GITHUB_ENV
@ -76,8 +76,8 @@ runs:
BENCHMARK_DIR=$(echo "$benchmark_id" | sed 's/-/\//g')
BENCHMARK_SUITE=$(echo "$BENCHMARK_DIR" | awk -F'/' '{print $1}')
BENCHMARK_NAME=$(echo "$BENCHMARK_DIR" | sed -E 's|^[^/]+/||; s|/bench_results||g; s|/|_|g')
BENCH_RESULT_YAML="test/src/benchmark/${BENCHMARK_DIR}/bench_result.yaml"
[ -f "$BENCH_RESULT_YAML" ] || BENCH_RESULT_YAML="test/src/benchmark/${BENCHMARK_DIR}.yaml"
BENCH_RESULT_YAML="test/initramfs/src/benchmark/${BENCHMARK_DIR}/bench_result.yaml"
[ -f "$BENCH_RESULT_YAML" ] || BENCH_RESULT_YAML="test/initramfs/src/benchmark/${BENCHMARK_DIR}.yaml"
if [ ! -f "$BENCH_RESULT_YAML" ]; then
echo "Warning: YAML file not found for $benchmark_id at $BENCH_RESULT_YAML. Skipping config generation."
@ -91,9 +91,9 @@ runs:
DESCRIPTION=$(yq -r '.chart.description // "No description provided"' "$BENCH_RESULT_YAML")
# Generate summary JSON if needed (only once per suite)
SUMMARY_JSON="test/src/benchmark/$BENCHMARK_SUITE/summary.json"
SUMMARY_JSON="test/initramfs/src/benchmark/$BENCHMARK_SUITE/summary.json"
if [ ! -f "$SUMMARY_JSON" ]; then
SUMMARY_YAML="test/src/benchmark/$BENCHMARK_SUITE/summary.yaml"
SUMMARY_YAML="test/initramfs/src/benchmark/$BENCHMARK_SUITE/summary.yaml"
if [ -f "$SUMMARY_YAML" ]; then
yq . "$SUMMARY_YAML" > "$SUMMARY_JSON"
echo "Generated $SUMMARY_JSON"

View File

@ -67,7 +67,7 @@ runs:
run: |
CMD=""
[[ "${{ matrix.id }}" == "lint" ]] && CMD+="make check"
[[ "${{ matrix.id }}" == "compile" ]] && CMD+="make kernel FEATURES=all"
[[ "${{ matrix.id }}" == "compile" ]] && CMD+="make kernel"
[[ "${{ matrix.id }}" == "usermode_test" ]] && CMD+="make test"
[[ "${{ matrix.id }}" == "ktest" ]] && CMD+="make ktest NETDEV=tap"
[[ -n "${{ inputs.arch }}" ]] && CMD+=" OSDK_TARGET_ARCH=${{ inputs.arch }}"

View File

@ -107,7 +107,7 @@ jobs:
max-parallel: 1
timeout-minutes: 60
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
steps:

View File

@ -108,7 +108,7 @@ jobs:
max-parallel: 1
timeout-minutes: 60
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
steps:

View File

@ -0,0 +1,28 @@
name: Close stale issues and PRs
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1" # Runs on every Monday
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Configurations for issues
stale-issue-message: "This issue is stale because it has been open 180 days with no activity. It will be closed in 5 days if no further activity occurs."
days-before-issue-stale: 180
days-before-issue-close: 5
stale-issue-label: "S-stale"
# Configurations for pull requests
stale-pr-message: "This PR is stale because it has been open 180 days with no activity. It will be closed in 5 days to keep the queue clean."
days-before-pr-stale: 180
days-before-pr-close: 5
stale-pr-label: "S-stale"

View File

@ -20,15 +20,18 @@ jobs:
check_api_docs:
runs-on: ubuntu-latest
timeout-minutes: 15
container: asterinas/asterinas:0.17.0-20251213
container: asterinas/asterinas:0.17.0-20260114
steps:
- uses: actions/checkout@v4
- name: Check API docs
- name: Check API docs of crates to publish
if: github.event_name == 'pull_request'
run: ./tools/github_workflows/publish_api_docs.sh --dry-run
- name: Check API docs of all crates
run: make docs
- name: Build & Upload Nightly API Docs
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:

View File

@ -3,14 +3,16 @@ name: Publish AsterNixOS
on:
workflow_dispatch:
push:
tags:
- 'v*'
branches:
- main
paths:
- VERSION
jobs:
push-cachix:
runs-on: ubuntu-4-cores-150GB-ssd
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: -v /dev:/dev --privileged
timeout-minutes: 60
steps:
@ -18,11 +20,9 @@ jobs:
- name: Modify configuration.nix to include xfce and podman
run: |
sed -i \
-e 's/^[[:space:]]*# services\.xserver\.enable = true;/ services.xserver.enable = true;/' \
-e 's/^[[:space:]]*# services\.xserver\.desktopManager\.xfce\.enable = true;/ services.xserver.desktopManager.xfce.enable = true;/' \
-e 's/^[[:space:]]*# virtualisation\.podman\.enable = true;/ virtualisation.podman.enable = true;/' \
distro/etc_nixos/configuration.nix
config_path="distro/etc_nixos/configuration.nix"
extra_config_path="tools/github_workflows/config_for_publish_cachix.nix"
./test/nixos/common/merge_nixos_config.sh ${config_path} ${extra_config_path} ${config_path}
- name: Build Asterinas NixOS patched packages and push to release cache
run: |
@ -35,6 +35,7 @@ jobs:
runs-on: ubuntu-latest
needs: [ push-cachix ]
outputs:
kernel_version: ${{ steps.tag.outputs.kernel_version }}
tag: ${{ steps.tag.outputs.tag }}
strategy:
fail-fast: false
@ -44,9 +45,18 @@ jobs:
- name: Get Asterinas version
id: tag
run: |
ASTER_VERSION=$(cat ./VERSION)
echo "ASTER_VERSION=${ASTER_VERSION}"
echo "tag=${ASTER_VERSION}" >> $GITHUB_OUTPUT
kernel_version=$(cat ./VERSION)
echo "kernel_version=${kernel_version}"
echo "kernel_version=${kernel_version}" >> $GITHUB_OUTPUT
tag="v${kernel_version}"
echo "tag=$tag"
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Add Git tag
uses: pxpm/github-tag-action@1.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.tag.outputs.tag }}
- name: Create release
env:
@ -60,7 +70,7 @@ jobs:
if gh release view "$tag" > /dev/null 2>&1; then
echo "Release with tag $tag already exists. Skipping creation."
else
gh release create --draft "$tag" --title "$tag" --notes "$body"
gh release create --draft "$tag" --title "$tag" --notes "$body" --verify-tag
fi
build-iso:
@ -83,9 +93,10 @@ jobs:
- name: Build ISO
uses: addnab/docker-run-action@v3
with:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --privileged -v /dev:/dev -v ${{ github.workspace }}:/root/asterinas
run: |
export ASTER_BUILD_TIMESTAMP=`date '+%a %b %e %H:%M:%S %Z %Y'`
make iso RELEASE=1 AUTO_INSTALL=false ARCH=${{ matrix.arch }}
iso_path=$(realpath ./target/nixos/iso_image/iso/*.iso)
echo "iso_path=$iso_path"
@ -96,11 +107,12 @@ jobs:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
kernel_version="${{ needs.create-github-release.outputs.kernel_version }}"
tag="${{ needs.create-github-release.outputs.tag }}"
echo "upload asterinas-nixos-$tag-${{ matrix.arch }}.iso"
echo "upload asterinas-nixos-$kernel_version-${{ matrix.arch }}.iso"
cd ${{ github.workspace }}
mv ./asterinas-nixos.iso asterinas-nixos-$tag-${{ matrix.arch }}.iso
gh release upload "$tag" "asterinas-nixos-$tag-${{ matrix.arch }}.iso"
mv ./asterinas-nixos.iso asterinas-nixos-$kernel_version-${{ matrix.arch }}.iso
gh release upload "$tag" "asterinas-nixos-$kernel_version-${{ matrix.arch }}.iso"
publish-github-release:
runs-on: ubuntu-latest

View File

@ -12,6 +12,7 @@ jobs:
publish_osdk_image:
runs-on: ubuntu-latest
steps:
- uses: BRAINSia/free-disk-space@v2
- uses: actions/checkout@v4
- name: Prepare for Docker build and push
id: prepare-for-docker-build-and-push
@ -34,6 +35,7 @@ jobs:
needs: publish_osdk_image
runs-on: ubuntu-latest
steps:
- uses: BRAINSia/free-disk-space@v2
- uses: actions/checkout@v4
- name: Prepare for Docker build and push
id: prepare-for-docker-build-and-push
@ -56,6 +58,7 @@ jobs:
needs: publish_nix_image
runs-on: ubuntu-latest
steps:
- uses: BRAINSia/free-disk-space@v2
- uses: actions/checkout@v4
- name: Prepare for Docker build and push
id: prepare-for-docker-build-and-push

View File

@ -17,7 +17,7 @@ jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
container: asterinas/asterinas:0.17.0-20251213
container: asterinas/asterinas:0.17.0-20260114
steps:
- uses: actions/checkout@v4

View File

@ -16,7 +16,7 @@ jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
container: asterinas/asterinas:0.17.0-20251213
container: asterinas/asterinas:0.17.0-20260114
steps:
- uses: actions/checkout@v4

View File

@ -17,7 +17,7 @@ jobs:
build_and_deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
container: asterinas/asterinas:0.17.0-20251213
container: asterinas/asterinas:0.17.0-20260114
steps:
- uses: actions/checkout@v2
with:

View File

@ -17,7 +17,7 @@ jobs:
push-pkgs:
runs-on: ubuntu-4-cores-150GB-ssd
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: -v /dev:/dev --privileged
timeout-minutes: 60
steps:
@ -25,11 +25,9 @@ jobs:
- name: Modify configuration.nix to include xfce and podman
run: |
sed -i \
-e 's/^[[:space:]]*# services\.xserver\.enable = true;/ services.xserver.enable = true;/' \
-e 's/^[[:space:]]*# services\.xserver\.desktopManager\.xfce\.enable = true;/ services.xserver.desktopManager.xfce.enable = true;/' \
-e 's/^[[:space:]]*# virtualisation\.podman\.enable = true;/ virtualisation.podman.enable = true;/' \
distro/etc_nixos/configuration.nix
config_path="distro/etc_nixos/configuration.nix"
extra_config_path="tools/github_workflows/config_for_publish_cachix.nix"
./test/nixos/common/merge_nixos_config.sh ${config_path} ${extra_config_path} ${config_path}
- name: Build Asterinas NixOS patched packages (dry run)
if: github.event_name == 'pull_request'

View File

@ -1,21 +0,0 @@
# This workflow pushes a new Git tag to the main branch when the version bumps.
name: Push release tag
on:
workflow_dispatch:
push:
branches:
- main
paths:
- VERSION
jobs:
tag_main_branch:
runs-on: ubuntu-latest
steps:
- name: Add Git tag
uses: pxpm/github-tag-action@1.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: v0.17.0

View File

@ -23,7 +23,7 @@ jobs:
run: |
docker run \
--privileged --network=host --device=/dev/kvm \
-v ./:/root/asterinas asterinas/asterinas:0.17.0-20251213 \
-v ./:/root/asterinas asterinas/asterinas:0.17.0-20260114 \
make run_kernel AUTO_TEST=vsock ENABLE_KVM=0 SCHEME=microvm RELEASE_MODE=1 &
- name: Run Vsock Client on Host
id: host_vsock_client

View File

@ -19,14 +19,14 @@ jobs:
iso-test:
runs-on: ubuntu-4-cores-150GB-ssd
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: -v /dev:/dev --privileged
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Build Asterinas NixOS ISO installer image
run: |
make iso NIXOS_TEST_COMMAND='hello-asterinas'
make iso NIXOS_TEST_SUITE=hello
- name: Run ISO image and install Asterinas NixOS
run: |
make run_iso || true
@ -34,6 +34,4 @@ jobs:
echo "Test ISO succeeds!"
- name : Run Asterinas NixOS
run: |
make run_nixos || true
tail --lines 10 qemu.log | grep -q "^Hello Asterinas!" || (echo "Test NixOS failed" && exit 1)
echo "Test NixOS succeeds!"
make run_nixos NIXOS_TEST_SUITE=hello

View File

@ -11,7 +11,7 @@ jobs:
basic-test:
runs-on: ubuntu-latest
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
strategy:
matrix:

View File

@ -26,54 +26,23 @@ jobs:
full-nixos-test:
runs-on: ubuntu-4-cores-150GB-ssd
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: -v /dev:/dev --privileged
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Modify configuration.nix to include test-asterinas
run: |
sed -i 's/environment.systemPackages = with pkgs; \[ hello-asterinas \];/environment.systemPackages = with pkgs; \[ test-asterinas \];/' \
distro/etc_nixos/configuration.nix
strategy:
fail-fast: false
matrix:
test:
- name: nix
disk_size: 6144
- name: podman
disk_size: 8192
- name: Test nix commands
run: |
make nixos NIXOS_DISK_SIZE_IN_MB=6144 NIXOS_TEST_COMMAND='test-nix-commands'
make run_nixos || true
- name: Check results
run: |
tail --lines 50 qemu.log | awk '
BEGIN { hello_count=0 } {
if ($0 ~ /^Hello, world!/) hello_count++
}
END {
if (hello_count == 4) exit 0
else exit 1
}' || (echo "Test nix commands failed" && exit 1)
echo "Test nix commands succeeds!"
podman-test:
runs-on: ubuntu-4-cores-150GB-ssd
container:
image: asterinas/asterinas:0.17.0-20251213
options: -v /dev:/dev --privileged
name: Test ${{ matrix.test.name }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Modify configuration.nix to include test-asterinas and podman
- name: Run the ${{ matrix.test.name }} test on AsterNixOS
run: |
sed -i \
-e 's/environment.systemPackages = with pkgs; \[ hello-asterinas \];/environment.systemPackages = with pkgs; \[ test-asterinas \];/' \
-e 's/^[[:space:]]*# virtualisation\.podman\.enable = true;/ virtualisation.podman.enable = true;/' \
distro/etc_nixos/configuration.nix
- name: Run podman commands
run: |
make nixos NIXOS_DISK_SIZE_IN_MB=8192 NIXOS_TEST_COMMAND='test-podman'
make run_nixos || true
- name: Check results
run: |
tail --lines 50 qemu.log | grep -q "^Test podman succeeds" || (echo "Test podman failed" && exit 1)
echo "Test podman succeeds!"
make nixos NIXOS_TEST_SUITE=${{ matrix.test.name }} NIXOS_DISK_SIZE_IN_MB=${{ matrix.test.disk_size }}
make run_nixos NIXOS_TEST_SUITE=${{ matrix.test.name }}

View File

@ -32,15 +32,12 @@ jobs:
remove_haskell: true
remove_tool_cache: true
- uses: actions/checkout@v4
- name: Run a Hello World program on AsterNixOS
- name: Run the hello test on AsterNixOS
timeout-minutes: 30
uses: addnab/docker-run-action@v3
with:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --privileged -v /dev:/dev -v ${{ github.workspace }}:/root/asterinas
run: |
make nixos NIXOS_DISK_SIZE_IN_MB=6144 NIXOS_TEST_COMMAND='hello-asterinas' || true
make run_nixos || true
- name: Check results
run: |
tail --lines 10 ${{ github.workspace }}/qemu.log | grep -q "^Hello Asterinas!" || (echo "Test NixOS failed" && exit 1)
echo "Test NixOS succeeds!"
make nixos NIXOS_TEST_SUITE=hello NIXOS_DISK_SIZE_IN_MB=6144
make run_nixos NIXOS_TEST_SUITE=hello

View File

@ -11,13 +11,23 @@ jobs:
basic-test:
runs-on: ubuntu-latest
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
volumes:
# Map the following directories on the host into the container so that
# the container can remove them to save some precious disk space (~16GB),
# which is quite limited on free-tier Github runners.
- /usr/lib/google-cloud-sdk:/usr/lib/google-cloud-sdk
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
strategy:
matrix:
id: ['lint', 'compile', 'usermode_test', 'ktest']
fail-fast: false
steps:
- name: Free disk space
# Remove unused packages from the host to save disk space.
run: rm -rf /usr/lib/google-cloud-sdk/* /usr/local/lib/android/* /usr/share/dotnet/*
- uses: actions/checkout@v4
- name: Run basic tests
uses: ./.github/actions/test
@ -28,8 +38,15 @@ jobs:
integration-test:
runs-on: ubuntu-latest
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
volumes:
# Map the following directories on the host into the container so that
# the container can remove them to save some precious disk space (~16GB),
# which is quite limited on free-tier Github runners.
- /usr/lib/google-cloud-sdk:/usr/lib/google-cloud-sdk
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
strategy:
matrix:
include:
@ -47,6 +64,9 @@ jobs:
smp: 4
fail-fast: false
steps:
- name: Free disk space
# Remove unused packages from the host to save disk space.
run: rm -rf /usr/lib/google-cloud-sdk/* /usr/local/lib/android/* /usr/share/dotnet/*
- uses: actions/checkout@v4
- name: Run integration tests ${{ (startsWith(matrix.test_id, 'syscall') && 'with LTP') || '' }}
uses: ./.github/actions/test

View File

@ -11,13 +11,23 @@ jobs:
basic-test:
runs-on: ubuntu-latest
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
volumes:
# Map the following directories on the host into the container so that
# the container can remove them to save some precious disk space (~16GB),
# which is quite limited on free-tier Github runners.
- /usr/lib/google-cloud-sdk:/usr/lib/google-cloud-sdk
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
strategy:
matrix:
id: ['lint', 'compile', 'usermode_test', 'ktest']
fail-fast: false
steps:
- name: Free disk space
# Remove unused packages from the host to save disk space.
run: rm -rf /usr/lib/google-cloud-sdk/* /usr/local/lib/android/* /usr/share/dotnet/*
- uses: actions/checkout@v4
- name: Run basic tests
uses: ./.github/actions/test
@ -28,8 +38,15 @@ jobs:
integration-test:
runs-on: ubuntu-latest
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
volumes:
# Map the following directories on the host into the container so that
# the container can remove them to save some precious disk space (~16GB),
# which is quite limited on free-tier Github runners.
- /usr/lib/google-cloud-sdk:/usr/lib/google-cloud-sdk
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
strategy:
matrix:
include:
@ -78,6 +95,9 @@ jobs:
smp: 4
fail-fast: false
steps:
- name: Free disk space
# Remove unused packages from the host to save disk space.
run: rm -rf /usr/lib/google-cloud-sdk/* /usr/local/lib/android/* /usr/share/dotnet/*
- uses: actions/checkout@v4
- name: Run integration tests ${{ (startsWith(matrix.test_id, 'syscall') && 'with LTP') || '' }}
uses: ./.github/actions/test
@ -113,7 +133,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
image: ['asterinas/asterinas:0.17.0-20251213', 'asterinas/osdk:0.17.0-20251213']
image: ['asterinas/asterinas:0.17.0-20260114', 'asterinas/osdk:0.17.0-20260114']
fail-fast: false
container:
image: ${{ matrix.image }}

View File

@ -10,7 +10,7 @@ jobs:
integration-test:
runs-on: self-hosted
container:
image: asterinas/asterinas:0.17.0-20251213
image: asterinas/asterinas:0.17.0-20260114
options: --device=/dev/kvm --privileged
strategy:
matrix:
@ -58,7 +58,7 @@ jobs:
runs-on: self-hosted
strategy:
matrix:
image: ['asterinas/asterinas:0.17.0-20251213', 'asterinas/osdk:0.17.0-20251213']
image: ['asterinas/asterinas:0.17.0-20260114', 'asterinas/osdk:0.17.0-20260114']
fail-fast: false
container:
image: ${{ matrix.image }}

View File

@ -6,19 +6,23 @@ on:
paths:
- tools/sctrace/**
- book/src/kernel/linux-compatibility/syscall-flag-coverage/**
- .github/workflows/validate_scmls.yml
push:
branches:
- main
paths:
- tools/sctrace/**
- book/src/kernel/linux-compatibility/syscall-flag-coverage/**
- .github/workflows/validate_scmls.yml
jobs:
validate_scmls:
runs-on: ubuntu-latest
timeout-minutes: 10
container: asterinas/asterinas:0.17.0-20251213
container: asterinas/asterinas:0.17.0-20260114
steps:
- uses: actions/checkout@v4
- name: Validate SCML files with sctrace
run: ./tools/sctrace.sh $ASTER_SCML -- echo "Asterinas"
run: |
export ASTER_SCML=$(find ./book/src/kernel/linux-compatibility/ -name "*.scml")
./tools/sctrace.sh $ASTER_SCML -- echo "Asterinas"

10
.gitignore vendored
View File

@ -14,6 +14,7 @@ target/
# qemu log file
qemu.log
qemu-serial.log
# packet dump file
virtio-net.pcap
@ -26,12 +27,15 @@ virtio-net.pcap
/result_*.json
# profile results
aster-nix-profile-*.json
aster-nix-profile-*.folded
aster-nix-profile-*.svg
aster-kernel-profile-*.json
aster-kernel-profile-*.folded
aster-kernel-profile-*.svg
# distro results
distro/result
# cachix package list
cachix.list
# temporary configuration file for NixOS tests
distro/etc_nixos/_config_for_test.nix

View File

@ -26,6 +26,7 @@ rto = "rto"
typ = "typ"
sigfault = "sigfault"
sems = "sems"
THRE = "THRE"
# Files with svg suffix are ignored to check.
[type.svg]
@ -35,8 +36,8 @@ check-file = false
# Files listed below are ignored to check.
[files]
extend-exclude = [
"test/src/syscall/gvisor/blocklists/pty_test",
"test/build/initramfs/opt/gvisor/blocklists/pty_test",
"test/src/syscall/gvisor/blocklists/sync_test",
"test/build/initramfs/opt/gvisor/blocklists/sync_test",
"test/initramfs/src/syscall/gvisor/blocklists/pty_test",
"test/initramfs/build/initramfs/opt/gvisor/blocklists/pty_test",
"test/initramfs/src/syscall/gvisor/blocklists/sync_test",
"test/initramfs/build/initramfs/opt/gvisor/blocklists/sync_test",
]

View File

@ -28,7 +28,7 @@
#=============================================================================
/book/ @tatetian
/book/src/kernel/linux-compatibility/syscall-flag-coverage/ @tatetian @taosue
/book/src/kernel/linux-compatibility/syscall-flag-coverage/ @taosue @tatetian
#=============================================================================
# The Asterinas kernel
@ -85,7 +85,7 @@
/osdk/tools/docker/ @grief8
/test/ @cqs21
/tools/ @grief8
/tools/sctrace/ @tatetian @taosue
/tools/sctrace/ @taosue @tatetian
/triagebot.toml @grief8
/Makefile @junyang-zh
@ -93,5 +93,5 @@
# The following critical files are singled out
/CODEOWNERS @tatetian
/VERSION @tatetian
/RELEASES @tatetian
/VERSION @tatetian

567
Cargo.lock generated
View File

@ -66,15 +66,6 @@ dependencies = [
"zerocopy",
]
[[package]]
name = "aho-corasick"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
dependencies = [
"memchr",
]
[[package]]
name = "align_ext"
version = "0.1.0"
@ -85,56 +76,6 @@ version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]]
name = "anstream"
version = "0.6.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
[[package]]
name = "anstyle-parse"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2"
dependencies = [
"windows-sys 0.60.2",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a"
dependencies = [
"anstyle",
"once_cell_polyfill",
"windows-sys 0.60.2",
]
[[package]]
name = "aster-bigtcp"
version = "0.1.0"
@ -162,7 +103,9 @@ dependencies = [
"int-to-c-enum",
"log",
"ostd",
"ostd-pod",
"spin",
"zerocopy",
]
[[package]]
@ -220,55 +163,13 @@ dependencies = [
"component",
"log",
"ostd",
"spin",
]
[[package]]
name = "aster-logger"
version = "0.1.0"
dependencies = [
"aster-console",
"component",
"log",
"ostd",
"owo-colors 3.5.0",
]
[[package]]
name = "aster-mlsdisk"
version = "0.1.0"
dependencies = [
"aes-gcm",
"aster-block",
"bittle",
"component",
"ctr",
"device-id",
"hashbrown 0.14.5",
"inherit-methods-macro",
"lending-iterator",
"log",
"lru",
"ostd",
"ostd-pod",
"postcard",
"serde",
]
[[package]]
name = "aster-network"
version = "0.1.0"
dependencies = [
"aster-bigtcp",
"aster-softirq",
"bitvec",
"component",
"ostd",
"spin",
"zerocopy",
]
[[package]]
name = "aster-nix"
name = "aster-kernel"
version = "0.1.0"
dependencies = [
"align_ext",
@ -287,6 +188,7 @@ dependencies = [
"aster-softirq",
"aster-systree",
"aster-time",
"aster-uart",
"aster-util",
"aster-virtio",
"atomic-integer-wrapper",
@ -294,6 +196,7 @@ dependencies = [
"bitvec",
"cfg-if",
"component",
"const_format",
"controlled",
"core2",
"cpio-decoder",
@ -315,6 +218,7 @@ dependencies = [
"osdk-frame-allocator",
"osdk-heap-allocator",
"ostd",
"ostd-pod",
"paste",
"rand",
"riscv",
@ -326,6 +230,54 @@ dependencies = [
"typeflags-util",
"xarray",
"xmas-elf",
"zerocopy",
]
[[package]]
name = "aster-logger"
version = "0.1.0"
dependencies = [
"aster-console",
"component",
"log",
"ostd",
"owo-colors",
]
[[package]]
name = "aster-mlsdisk"
version = "0.1.0"
dependencies = [
"aes-gcm",
"aster-block",
"bittle",
"component",
"ctr",
"device-id",
"hashbrown 0.14.5",
"inherit-methods-macro",
"lending-iterator",
"log",
"lru",
"ostd",
"ostd-pod",
"postcard",
"serde",
"zerocopy",
]
[[package]]
name = "aster-network"
version = "0.1.0"
dependencies = [
"aster-bigtcp",
"aster-softirq",
"bitvec",
"component",
"ostd",
"ostd-pod",
"spin",
"zerocopy",
]
[[package]]
@ -358,7 +310,7 @@ version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.101",
]
[[package]]
@ -389,7 +341,7 @@ name = "aster-time"
version = "0.1.0"
dependencies = [
"aster-util",
"bitflags 2.9.1",
"bitflags 1.3.2",
"chrono",
"component",
"log",
@ -397,6 +349,19 @@ dependencies = [
"spin",
]
[[package]]
name = "aster-uart"
version = "0.1.0"
dependencies = [
"aster-console",
"component",
"fdt",
"inherit-methods-macro",
"log",
"ostd",
"spin",
]
[[package]]
name = "aster-util"
version = "0.1.0"
@ -406,7 +371,9 @@ dependencies = [
"inherit-methods-macro",
"osdk-heap-allocator",
"ostd",
"ostd-pod",
"typeflags-util",
"zerocopy",
]
[[package]]
@ -430,9 +397,11 @@ dependencies = [
"int-to-c-enum",
"log",
"ostd",
"ostd-pod",
"spin",
"tdx-guest",
"typeflags-util",
"zerocopy",
]
[[package]]
@ -495,26 +464,6 @@ dependencies = [
"wyz",
]
[[package]]
name = "bytemuck"
version = "1.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c"
dependencies = [
"bytemuck_derive",
]
[[package]]
name = "bytemuck_derive"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]]
name = "byteorder"
version = "1.5.0"
@ -554,58 +503,12 @@ dependencies = [
"generic-array",
]
[[package]]
name = "clap"
version = "4.5.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim 0.11.1",
]
[[package]]
name = "clap_derive"
version = "4.5.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]]
name = "clap_lex"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
[[package]]
name = "cobs"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15"
[[package]]
name = "colorchoice"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
[[package]]
name = "component"
version = "0.1.0"
@ -628,6 +531,26 @@ dependencies = [
"toml",
]
[[package]]
name = "const_format"
version = "0.2.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad"
dependencies = [
"const_format_proc_macros",
]
[[package]]
name = "const_format_proc_macros"
version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "controlled"
version = "0.1.0"
@ -717,7 +640,7 @@ dependencies = [
"ident_case",
"proc-macro2",
"quote",
"strsim 0.10.0",
"strsim",
"syn 1.0.109",
]
@ -781,9 +704,9 @@ dependencies = [
[[package]]
name = "deranged"
version = "0.4.0"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587"
dependencies = [
"powerfmt",
]
@ -856,9 +779,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foldhash"
version = "0.1.5"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "font8x8"
@ -884,14 +807,14 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi",
"wasip2",
]
[[package]]
@ -973,6 +896,12 @@ name = "hashbrown"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
[[package]]
name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"allocator-api2",
"equivalent",
@ -1003,12 +932,6 @@ dependencies = [
"stable_deref_trait",
]
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "iced-x86"
version = "1.21.0"
@ -1086,12 +1009,6 @@ dependencies = [
"ghost",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "itertools"
version = "0.10.5"
@ -1189,10 +1106,11 @@ version = "0.17.0"
dependencies = [
"align_ext",
"bitflags 1.3.2",
"bytemuck",
"libflate",
"ostd-pod",
"serde",
"xmas-elf",
"zerocopy",
]
[[package]]
@ -1231,7 +1149,7 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
name = "logo-ascii-art"
version = "0.1.0"
dependencies = [
"owo-colors 4.2.2",
"owo-colors",
]
[[package]]
@ -1246,11 +1164,11 @@ dependencies = [
[[package]]
name = "lru"
version = "0.12.5"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593"
dependencies = [
"hashbrown 0.15.3",
"hashbrown 0.16.1",
]
[[package]]
@ -1300,12 +1218,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "multiboot2"
version = "0.24.0"
@ -1336,27 +1248,6 @@ version = "6.6.666"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf5a574dadd7941adeaa71823ecba5e28331b8313fb2e1c6a5c7e5981ea53ad6"
[[package]]
name = "nix"
version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.9.1",
"cfg-if",
"libc",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "nougat"
version = "0.2.4"
@ -1399,12 +1290,6 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "once_cell_polyfill"
version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
name = "opaque-debug"
version = "0.3.1"
@ -1433,7 +1318,7 @@ name = "osdk-test-kernel"
version = "0.17.0"
dependencies = [
"ostd",
"owo-colors 4.2.2",
"owo-colors",
]
[[package]]
@ -1471,6 +1356,7 @@ dependencies = [
"volatile 0.6.1",
"x86",
"x86_64",
"zerocopy",
]
[[package]]
@ -1485,38 +1371,44 @@ dependencies = [
[[package]]
name = "ostd-pod"
version = "0.1.1"
source = "git+https://github.com/asterinas/ostd-pod?rev=c4644be#c4644be401cae1e046a810574078b64e35924f5f"
version = "0.4.0"
dependencies = [
"ostd-pod-derive",
"ostd-pod-macros",
"padding-struct",
"zerocopy",
]
[[package]]
name = "ostd-pod-derive"
version = "0.1.1"
source = "git+https://github.com/asterinas/ostd-pod?rev=c4644be#c4644be401cae1e046a810574078b64e35924f5f"
name = "ostd-pod-macros"
version = "0.4.0"
dependencies = [
"ostd-pod",
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.101",
"zerocopy",
]
[[package]]
name = "ostd-test"
version = "0.17.0"
[[package]]
name = "owo-colors"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
[[package]]
name = "owo-colors"
version = "4.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e"
[[package]]
name = "padding-struct"
version = "0.2.0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"zerocopy",
]
[[package]]
name = "paste"
version = "1.0.15"
@ -1703,35 +1595,6 @@ dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "regex"
version = "1.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
[[package]]
name = "riscv"
version = "0.15.0"
@ -1813,16 +1676,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "sctrace"
version = "0.17.0"
dependencies = [
"clap",
"nix",
"nom",
"regex",
]
[[package]]
name = "semver"
version = "1.0.26"
@ -1905,12 +1758,6 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "subtle"
version = "2.4.1"
@ -1953,12 +1800,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tdx-guest"
version = "0.2.2"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15fda2de9c0a2fdcc22e802af4f7f1e8f609a206f34d30986e3cd974b04911f0"
checksum = "be70e62fdd829b19d5e1e03969f125391347e4e33d1419addfe59a45b043005d"
dependencies = [
"bitflags 1.3.2",
"iced-x86",
"log",
"raw-cpuid",
"x86_64",
]
@ -1985,9 +1833,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.41"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d"
dependencies = [
"deranged",
"num-conv",
@ -1998,9 +1846,9 @@ dependencies = [
[[package]]
name = "time-core"
version = "0.1.4"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
[[package]]
name = "toml"
@ -2043,7 +1891,7 @@ dependencies = [
"itertools",
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.101",
"typeflags-util",
]
@ -2128,6 +1976,12 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "universal-hash"
version = "0.4.1"
@ -2147,12 +2001,6 @@ dependencies = [
"gimli 0.32.3",
]
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "version_check"
version = "0.9.5"
@ -2181,15 +2029,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "wasi"
version = "0.14.7+wasi-0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
dependencies = [
"wasip2",
]
[[package]]
name = "wasip2"
version = "1.0.1+wasi-0.2.4"
@ -2205,31 +2044,16 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.59.0",
"windows-sys",
]
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [
"windows-targets 0.53.5",
"windows-targets",
]
[[package]]
@ -2238,31 +2062,14 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm 0.52.6",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
"windows-link",
"windows_aarch64_gnullvm 0.53.1",
"windows_aarch64_msvc 0.53.1",
"windows_i686_gnu 0.53.1",
"windows_i686_gnullvm 0.53.1",
"windows_i686_msvc 0.53.1",
"windows_x86_64_gnu 0.53.1",
"windows_x86_64_gnullvm 0.53.1",
"windows_x86_64_msvc 0.53.1",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
@ -2271,96 +2078,48 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_i686_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
[[package]]
name = "winnow"
version = "0.5.40"
@ -2432,18 +2191,18 @@ checksum = "2fe21bcc34ca7fe6dd56cc2cb1261ea59d6b93620215aefb5ea6032265527784"
[[package]]
name = "zerocopy"
version = "0.8.25"
version = "0.8.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb"
checksum = "71ddd76bcebeed25db614f82bf31a9f4222d3fbba300e6fb6c00afa26cbd4d9d"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.25"
version = "0.8.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
checksum = "d8187381b52e32220d50b255276aa16a084ec0a9017a0ca2152a1f55c539758d"
dependencies = [
"proc-macro2",
"quote",

View File

@ -1,3 +1,10 @@
# The Cargo workspace configurations shared by all in-kernel crates.
#
# As a kernel project, most crates in Asterinas are written and built for the kernel space.
# But there are also a few userspace crates
# whose crate-level `Cargo.toml` files are not affected by this workspace-level `Cargo.toml`.
# The complete list can be found in the `workspace.exclude` field.
[workspace]
resolver = "2"
members = [
@ -6,43 +13,46 @@ members = [
"osdk/deps/test-kernel",
"ostd",
"ostd/libs/align_ext",
"ostd/libs/ostd-macros",
"ostd/libs/id-alloc",
"ostd/libs/linux-bzimage/builder",
"ostd/libs/int-to-c-enum",
"ostd/libs/int-to-c-enum/derive",
"ostd/libs/linux-bzimage/boot-params",
"ostd/libs/linux-bzimage/builder",
"ostd/libs/linux-bzimage/setup",
"ostd/libs/ostd-pod",
"ostd/libs/ostd-pod/macros",
"ostd/libs/ostd-macros",
"ostd/libs/ostd-test",
"ostd/libs/padding-struct",
"kernel",
"kernel/comps/block",
"kernel/comps/cmdline",
"kernel/comps/console",
"kernel/comps/framebuffer",
"kernel/comps/input",
"kernel/comps/i8042",
"kernel/comps/network",
"kernel/comps/softirq",
"kernel/comps/systree",
"kernel/comps/input",
"kernel/comps/logger",
"kernel/comps/mlsdisk",
"kernel/comps/time",
"kernel/comps/virtio",
"kernel/comps/network",
"kernel/comps/pci",
"kernel/libs/cpio-decoder",
"kernel/libs/int-to-c-enum",
"kernel/libs/int-to-c-enum/derive",
"kernel/comps/softirq",
"kernel/comps/systree",
"kernel/comps/time",
"kernel/comps/uart",
"kernel/comps/virtio",
"kernel/libs/aster-bigtcp",
"kernel/libs/aster-rights",
"kernel/libs/aster-rights-proc",
"kernel/libs/aster-util",
"kernel/libs/aster-bigtcp",
"kernel/libs/atomic-integer-wrapper",
"kernel/libs/cpio-decoder",
"kernel/libs/device-id",
"kernel/libs/jhash",
"kernel/libs/keyable-arc",
"kernel/libs/logo-ascii-art",
"kernel/libs/typeflags",
"kernel/libs/typeflags-util",
"kernel/libs/atomic-integer-wrapper",
"kernel/libs/xarray",
"tools/sctrace",
]
exclude = [
"kernel/libs/comp-sys/cargo-component",
@ -59,6 +69,135 @@ unexpected_cfgs = { level = "allow", check-cfg = ['cfg(ktest)'] }
[workspace.lints.clippy]
allow_attributes = "warn"
redundant_test_prefix = "warn"
# Keys under `workspace.package` and the `package` section of each crate
# follow the ordering suggested at:
# https://github.com/crate-ci/cargo-cargofmt/issues/29#issuecomment-3647516745
#
# FIXME: The current key order is not yet finalized.
# Once `cargo-cargofmt` becomes stable, we will use it to enforce a consistent key order.
[workspace.package]
version = "0.17.0"
repository = "https://github.com/asterinas/asterinas"
license = "MPL-2.0"
edition = "2024"
[workspace.dependencies]
ostd = { version = "0.17.0", path = "ostd" }
# Crates under ostd/libs
align_ext = { path = "ostd/libs/align_ext", version = "0.1.0" }
id-alloc = { path = "ostd/libs/id-alloc", version = "0.1.0" }
int-to-c-enum = { path = "ostd/libs/int-to-c-enum", version = "0.1.0" }
linux-boot-params = { version = "0.17.0", path = "ostd/libs/linux-bzimage/boot-params" }
ostd-macros = { version = "0.17.0", path = "ostd/libs/ostd-macros" }
ostd-pod = { path = "ostd/libs/ostd-pod", version = "0.4.0" }
ostd-test = { version = "0.17.0", path = "ostd/libs/ostd-test" }
# Crates under kernel/comps
aster-block = { path = "kernel/comps/block" }
aster-cmdline = { path = "kernel/comps/cmdline" }
aster-console = { path = "kernel/comps/console" }
aster-framebuffer = { path = "kernel/comps/framebuffer" }
aster-i8042 = { path = "kernel/comps/i8042" }
aster-input = { path = "kernel/comps/input" }
aster-logger = { path = "kernel/comps/logger" }
aster-mlsdisk = { path = "kernel/comps/mlsdisk" }
aster-network = { path = "kernel/comps/network" }
aster-pci = { path = "kernel/comps/pci" }
aster-softirq = { path = "kernel/comps/softirq" }
aster-systree = { path = "kernel/comps/systree" }
aster-time = { path = "kernel/comps/time" }
aster-uart = { path = "kernel/comps/uart" }
aster-virtio = { path = "kernel/comps/virtio" }
# Crates under kernel/libs
aster-bigtcp = { path = "kernel/libs/aster-bigtcp" }
aster-rights = { path = "kernel/libs/aster-rights" }
aster-rights-proc = { path = "kernel/libs/aster-rights-proc" }
aster-util = { path = "kernel/libs/aster-util" }
atomic-integer-wrapper = { path = "kernel/libs/atomic-integer-wrapper" }
cpio-decoder = { path = "kernel/libs/cpio-decoder" }
device-id = { path = "kernel/libs/device-id" }
jhash = { path = "kernel/libs/jhash" }
keyable-arc = { path = "kernel/libs/keyable-arc" }
logo-ascii-art = { path = "kernel/libs/logo-ascii-art" }
typeflags = { path = "kernel/libs/typeflags" }
typeflags-util = { path = "kernel/libs/typeflags-util" }
xarray = { path = "kernel/libs/xarray" }
# Crates under kernel/libs/comp-sys
component = { path = "kernel/libs/comp-sys/component" }
controlled = { path = "kernel/libs/comp-sys/controlled" }
# Crates under osdk/deps
osdk-frame-allocator = { path = "osdk/deps/frame-allocator" }
osdk-heap-allocator = { path = "osdk/deps/heap-allocator" }
# External dependencies only for unsafe crates (i.e., crates under ostd directory)
bit_field = "0.10.1"
gimli = { version = "0.28", default-features = false, features = ["read-core"] }
minicov = "0.3"
num-traits = { version = "0.2", default-features = false }
serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] }
smallvec = "1.13.2"
uart_16550 = "0.3.0"
volatile = "0.6.1"
# External dependencies only for safe crates (i.e., crates under kernel or osdk/deps directories)
#
# Enable `force-soft` feature to disable `AES-NI` and `CLMUL` intrinsics, ensuring that the implementation
# relies solely on software, and in the software implementation, unsafe code is rarely used.
# FIXME: to utilize `AES-NI` and `CLMUL` intrinsics, some specific flags must be added to `RUSTFLAGS`,
# i.e. `-Ctarget-cpu=sandybridge -Ctarget-feature=+aes,+sse2,+sse4.1,+ssse3`.
# This suggests that `Asterinas` should support saving and restoring the `FPU` state within the kernel context,
# a capability it currently lacks.
aes-gcm = { version = "0.9.4", features = ["force-soft"] }
bittle = "0.5.6"
const_format = "0.2.35"
ctr = "0.8.0"
font8x8 = { version = "0.2.5", default-features = false, features = [ "unicode" ] }
getset = "0.1.2"
hashbrown = { version = "0.14.3", features = ["serde"] }
itertools = "0.10.5"
lending-iterator = "0.1.7"
lru = "0.16.3"
owo-colors = "4.2.2"
paste = "1.0.15"
postcard = "1.0.6"
smoltcp = { git = "https://github.com/asterinas/smoltcp", tag = "r_2024-11-08_f07e5b5", default-features = false, features = [
"alloc",
"log",
"medium-ethernet",
"medium-ip",
"proto-ipv4",
"socket-udp",
"socket-tcp",
] }
takeable = "0.2.2"
time = { version = "0.3", default-features = false, features = ["alloc"] }
# External dependencies for both safe and unsafe crates
bitflags = "1.3"
bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] }
cfg-if = "1.0"
core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] }
inherit-methods-macro = { git = "https://github.com/asterinas/inherit-methods-macro", rev = "98f7e3e", version = "0.1.0" }
intrusive-collections = { version = "0.9.6", features = ["nightly"] }
libflate = { version = "2.1.0", default-features = false }
log = "0.4"
rand = { version = "0.9.2", default-features = false }
spin = "0.9.4"
xmas-elf = "0.10.0"
# Note: when updating the zerocopy version,
# also update it in `ostd/libs/ostd-pod/README.md`.
zerocopy = { version = "0.8.34", features = [ "derive" ] }
# Proc-macro dependencies
proc-macro2 = { version = "1.0.95", features = ["span-locations"] }
quote = "1.0.35"
syn = { version = "2.0.77", features = ["full", "parsing", "fold"] }
# Cargo only looks at the profile settings
# in the Cargo.toml manifest at the root of the workspace

View File

@ -1,20 +1,21 @@
# template
[components]
nix = { name = "aster-nix" }
virtio = { name = "aster-virtio" }
input = { name = "aster-input" }
block = { name = "aster-block" }
console = { name = "aster-console" }
softirq = { name = "aster-softirq" }
logger = { name = "aster-logger" }
time = { name = "aster-time" }
framebuffer = { name = "aster-framebuffer" }
network = { name = "aster-network" }
mlsdisk = { name = "aster-mlsdisk" }
systree = { name = "aster-systree" }
i8042 = { name = "aster-i8042" }
pci = { name = "aster-pci" }
cmdline = { name = "aster-cmdline" }
console = { name = "aster-console" }
framebuffer = { name = "aster-framebuffer" }
i8042 = { name = "aster-i8042" }
input = { name = "aster-input" }
kernel = { name = "aster-kernel" }
logger = { name = "aster-logger" }
mlsdisk = { name = "aster-mlsdisk" }
network = { name = "aster-network" }
pci = { name = "aster-pci" }
softirq = { name = "aster-softirq" }
systree = { name = "aster-systree" }
time = { name = "aster-time" }
uart = { name = "aster-uart" }
virtio = { name = "aster-virtio" }
[whitelist]
[whitelist.nix.main]

View File

@ -1 +1 @@
0.17.0-20251213
0.17.0-20260114

View File

@ -21,10 +21,12 @@ OSTD_TASK_STACK_SIZE_IN_PAGES ?= 64
FEATURES ?=
NO_DEFAULT_FEATURES ?= 0
COVERAGE ?= 0
# Specify whether to build regression tests under `test/initramfs/src/apps`.
ENABLE_BASIC_TEST ?= false
# Specify the primary system console (supported: hvc0, tty0).
# - hvc0: The virtio-console terminal.
# Specify the primary system console (supported: tty0, ttyS0, hvc0).
# - tty0: The active virtual terminal (VT).
# - ttyS0: The serial (UART) terminal.
# - hvc0: The virtio-console terminal.
# Asterinas will automatically fall back to tty0 if hvc0 is not available.
# Note that currently the virtual terminal (tty0) can only work with
# linux-efi-handover64 and linux-efi-pe64 boot protocol.
@ -57,7 +59,6 @@ DNS_SERVER ?= none
# NixOS settings
NIXOS_DISK_SIZE_IN_MB ?= 8192
NIXOS_DISABLE_SYSTEMD ?= false
NIXOS_TEST_COMMAND ?=
# The following option is only effective when NIXOS_DISABLE_SYSTEMD is set to 'true'.
# Use a login shell to ensure that environment variables are initialized correctly.
NIXOS_STAGE_2_INIT ?= /bin/sh -l
@ -191,7 +192,7 @@ endif
# Skip GZIP to make encoding and decoding of initramfs faster
ifeq ($(INITRAMFS_SKIP_GZIP),1)
CARGO_OSDK_INITRAMFS_OPTION := --initramfs=$(abspath test/build/initramfs.cpio)
CARGO_OSDK_INITRAMFS_OPTION := --initramfs=$(abspath test/initramfs/build/initramfs.cpio)
CARGO_OSDK_COMMON_ARGS += $(CARGO_OSDK_INITRAMFS_OPTION)
endif
@ -206,22 +207,24 @@ export
NON_OSDK_CRATES := \
ostd/libs/align_ext \
ostd/libs/id-alloc \
ostd/libs/linux-bzimage/builder \
ostd/libs/int-to-c-enum \
ostd/libs/int-to-c-enum/derive \
ostd/libs/linux-bzimage/boot-params \
ostd/libs/linux-bzimage/builder \
ostd/libs/ostd-macros \
ostd/libs/ostd-pod \
ostd/libs/ostd-pod/macros \
ostd/libs/ostd-test \
ostd/libs/padding-struct \
kernel/libs/aster-rights \
kernel/libs/aster-rights-proc \
kernel/libs/atomic-integer-wrapper \
kernel/libs/cpio-decoder \
kernel/libs/int-to-c-enum \
kernel/libs/int-to-c-enum/derive \
kernel/libs/jhash \
kernel/libs/keyable-arc \
kernel/libs/logo-ascii-art \
kernel/libs/typeflags \
kernel/libs/typeflags-util \
tools/sctrace
kernel/libs/typeflags-util
# In contrast, OSDK crates depend on OSTD (or being `ostd` itself)
# and need to be built or tested with OSDK.
@ -236,18 +239,19 @@ OSDK_CRATES := \
kernel/comps/cmdline \
kernel/comps/console \
kernel/comps/framebuffer \
kernel/comps/input \
kernel/comps/i8042 \
kernel/comps/network \
kernel/comps/softirq \
kernel/comps/systree \
kernel/comps/input \
kernel/comps/logger \
kernel/comps/mlsdisk \
kernel/comps/time \
kernel/comps/virtio \
kernel/comps/network \
kernel/comps/pci \
kernel/libs/aster-util \
kernel/comps/softirq \
kernel/comps/systree \
kernel/comps/time \
kernel/comps/uart \
kernel/comps/virtio \
kernel/libs/aster-bigtcp \
kernel/libs/aster-util \
kernel/libs/device-id \
kernel/libs/xarray
@ -273,7 +277,9 @@ $(CARGO_OSDK): $(OSDK_SRC_FILES)
.PHONY: check_osdk
check_osdk:
@cd osdk && cargo clippy -- -D warnings
@# Run clippy on OSDK with and without the test configuration.
@cd osdk && RUSTFLAGS="-Dwarnings" cargo clippy --no-deps
@cd osdk && RUSTFLAGS="-Dwarnings" cargo clippy --tests --no-deps
.PHONY: test_osdk
test_osdk:
@ -285,7 +291,7 @@ test_osdk:
check_vdso:
@# Checking `VDSO_LIBRARY_DIR` environment variable
@if [ -z "$(VDSO_LIBRARY_DIR)" ]; then \
echo "Error: the \$(VDSO_LIBRARY_DIR) environment variable must be given."; \
echo "Error: the VDSO_LIBRARY_DIR environment variable must be given."; \
echo " This variable points to a directory that provides Linux's vDSO files,"; \
echo " which is required to build Asterinas. Search for VDSO_LIBRARY_DIR"; \
echo " in Asterinas's Dockerfile for more information."; \
@ -294,7 +300,7 @@ check_vdso:
.PHONY: initramfs
initramfs: check_vdso
@$(MAKE) --no-print-directory -C test
@$(MAKE) --no-print-directory -C test/initramfs
# Build the kernel with an initramfs
.PHONY: kernel
@ -324,29 +330,40 @@ endif
iso: BOOT_PROTOCOL = linux-efi-handover64
iso:
@make kernel
@./tools/nixos/build_iso.sh
@if [ -n "$(NIXOS_TEST_SUITE)" ]; then \
$(MAKE) --no-print-directory -C test/nixos iso; \
else \
./tools/nixos/build_iso.sh; \
fi
# Build the Asterinas NixOS ISO installer image and then do installation
run_iso: OVMF = off
run_iso:
@./tools/nixos/run_iso.sh
@./tools/nixos/run.sh iso
# Create an Asterinas NixOS installation on host
nixos: BOOT_PROTOCOL = linux-efi-handover64
nixos:
@make kernel
@./tools/nixos/build_nixos.sh
@if [ -n "$(NIXOS_TEST_SUITE)" ]; then \
$(MAKE) --no-print-directory -C test/nixos nixos; \
else \
./tools/nixos/build_nixos.sh; \
fi
# After creating a Asterinas NixOS installation (via either the `run_iso` or `nixos` target),
# run the NixOS
run_nixos: OVMF = off
run_nixos:
@./tools/nixos/run_nixos.sh target/nixos
@if [ -n "$(NIXOS_TEST_SUITE)" ]; then \
$(MAKE) --no-print-directory -C test/nixos run_nixos; \
else \
./tools/nixos/run.sh nixos; \
fi
# Build the Asterinas NixOS patched packages
cachix:
@nix-build distro/cachix \
--argstr test-command "${NIXOS_TEST_COMMAND}" \
--option extra-substituters "${RELEASE_SUBSTITUTER} ${DEV_SUBSTITUTER}" \
--option extra-trusted-public-keys "${RELEASE_TRUSTED_PUBLIC_KEY} ${DEV_TRUSTED_PUBLIC_KEY}" \
--out-link cachix.list
@ -402,10 +419,17 @@ ktest: initramfs $(CARGO_OSDK)
.PHONY: docs
docs: $(CARGO_OSDK)
@for dir in $(NON_OSDK_CRATES); do \
(cd $$dir && cargo doc --no-deps) || exit 1; \
(cd $$dir && RUSTDOCFLAGS="-Dwarnings" cargo doc --no-deps) || exit 1; \
done
@for dir in $(OSDK_CRATES); do \
(cd $$dir && cargo osdk doc --no-deps) || exit 1; \
EXTRA_DOC_FLAGS=""; \
# The kernel crate is primarily composed of private items. \
# We include the --document-private-items flag \
# to ensure documentation of the internal items is fully checked. \
if [ "$$dir" = "kernel" ]; then \
EXTRA_DOC_FLAGS="--document-private-items -Arustdoc::private_intra_doc_links"; \
fi; \
(cd $$dir && RUSTDOCFLAGS="-Dwarnings $$EXTRA_DOC_FLAGS" cargo osdk doc --no-deps) || exit 1; \
done
.PHONY: book
@ -416,7 +440,8 @@ book:
format:
@./tools/format_all.sh
@nixfmt ./distro
@$(MAKE) --no-print-directory -C test format
@$(MAKE) --no-print-directory -C test/initramfs format
@$(MAKE) --no-print-directory -C test/nixos format
.PHONY: check
check: initramfs $(CARGO_OSDK)
@ -445,18 +470,25 @@ check: initramfs $(CARGO_OSDK)
@# Check compilation of the Rust code
@for dir in $(NON_OSDK_CRATES); do \
echo "Checking $$dir"; \
(cd $$dir && cargo clippy -- -D warnings) || exit 1; \
# Run clippy on each crate with and without the test configuration. \
(cd $$dir && RUSTFLAGS="-Dwarnings" cargo clippy --no-deps) || exit 1; \
(cd $$dir && RUSTFLAGS="-Dwarnings" cargo clippy --tests --no-deps) || exit 1; \
done
@for dir in $(OSDK_CRATES); do \
echo "Checking $$dir"; \
# Exclude linux-bzimage-setup since it only supports x86-64 currently and will panic \
# in other architectures. \
[ "$$dir" = "ostd/libs/linux-bzimage/setup" ] && [ "$(OSDK_TARGET_ARCH)" != "x86_64" ] && continue; \
(cd $$dir && cargo osdk clippy -- -- -D warnings) || exit 1; \
# Run clippy on each crate with and without the ktest configuration. \
(cd $$dir && RUSTFLAGS="-Dwarnings" cargo osdk clippy -- --no-deps) || exit 1; \
(cd $$dir && RUSTFLAGS="-Dwarnings" cargo osdk clippy --ktests -- --no-deps) || exit 1; \
done
@
@# Check formatting issues of the C code and Nix files (regression tests)
@$(MAKE) --no-print-directory -C test check
@$(MAKE) --no-print-directory -C test/initramfs check
@
@# Check formatting issues of the Rust code in NixOS tests
@$(MAKE) --no-print-directory -C test/nixos check
@
@# Check typos
@typos
@ -472,6 +504,6 @@ clean:
@echo "Cleaning up mdBook output files"
@cd book && mdbook clean
@echo "Cleaning up test target files"
@$(MAKE) --no-print-directory -C test clean
@$(MAKE) --no-print-directory -C test/initramfs clean
@echo "Uninstalling OSDK"
@rm -f $(CARGO_OSDK)

View File

@ -6,7 +6,7 @@
method = "grub-rescue-iso"
[grub]
protocol = "multiboot2"
boot_protocol = "multiboot2"
[qemu]
args = "$(./tools/qemu_args.sh normal)"
@ -22,7 +22,7 @@ kcmd_args = [
"init=/usr/bin/busybox",
]
init_args = ["sh", "-l"]
initramfs = "test/build/initramfs.cpio.gz"
initramfs = "test/initramfs/build/initramfs.cpio.gz"
# Special options for testing
[test.qemu]
@ -62,8 +62,8 @@ qemu.args = """\
-serial chardev:mux \
-monitor chardev:mux \
-chardev stdio,id=mux,mux=on,signal=off,logfile=qemu.log \
-drive if=none,format=raw,id=x0,file=./test/build/ext2.img \
-drive if=none,format=raw,id=x1,file=./test/build/exfat.img \
-drive if=none,format=raw,id=x0,file=./test/initramfs/build/ext2.img \
-drive if=none,format=raw,id=x1,file=./test/initramfs/build/exfat.img \
# NOTE: The `/etc/profile.d/init.sh` assumes that `ext2.img` appears as the first block device (`/dev/vda`).
# The ordering below ensures `x1` (ext2.img) is discovered before `x0`, maintaining this assumption.
# TODO: Once UUID-based mounting is implemented, this strict ordering will no longer be required.

View File

@ -1,6 +1,6 @@
<p align="center">
<img src="book/src/images/logo_en.svg" alt="asterinas-logo" width="620"><br>
A secure, fast, and general-purpose OS kernel written in Rust and compatible with Linux<br/>
Toward a production-grade Linux alternative—memory safe, high-performance, and more<br/>
</p>
<!-- Asterinas NixOS 0.17.0 demo. It is uploaded as a Github attachment
@ -34,37 +34,63 @@ Congratulations to the Asterinas community🎉🎉🎉
## Introducing Asterinas
Asterinas is a _secure_, _fast_, and _general-purpose_ OS kernel
that provides _Linux-compatible_ ABI.
It can serve as a seamless replacement for Linux
while enhancing _memory safety_ and _developer friendliness_.
The future of operating systems (OSes) belongs to Rust—a modern systems programming language (PL)
that delivers safety, efficiency, and productivity at once.
The open question is not _whether_ OS kernels should transition from C to Rust,
but _how_ we get there.
* Asterinas prioritizes memory safety
by employing Rust as its sole programming language
and limiting the use of _unsafe Rust_
to a clearly defined and minimal Trusted Computing Base (TCB).
This innovative approach,
known as [the framekernel architecture](https://asterinas.github.io/book/kernel/the-framekernel-architecture.html),
establishes Asterinas as a more secure and dependable kernel option.
Linux follows an _incremental_ path.
While the Rust for Linux project has successfully integrated Rust as an official second PL,
this approach faces _inherent friction_.
As a newcomer within a massive C codebase,
Rust must often compromise on safety, efficiency, clarity, and ergonomics
to maintain compatibility with legacy structures.
And while new Rust code can improve what it touches,
it cannot retroactively eliminate _vulnerabilities_ in decades of existing C code.
* Asterinas surpasses Linux in terms of developer friendliness.
It empowers kernel developers to
(1) utilize the more productive Rust programming language,
(2) leverage a purpose-built toolkit called [OSDK](https://asterinas.github.io/book/osdk/guide/index.html) to streamline their workflows,
and (3) choose between releasing their kernel modules as open source
or keeping them proprietary,
thanks to the flexibility offered by [MPL](#License).
Asterinas takes a _clean-slate_ approach.
By building a Linux-compatible, general-purpose OS kernel from the ground up in Rust,
we are liberated from the constraints of a legacy C codebase—its interfaces, designs, and assumptions—and from the need to preserve historical compatibility for outdated platforms.
**Languages—including PLs—shape our way of thinking**.
Through the lens of a modern PL, Asterinas rethinks and modernizes the construction of OS kernels:
While the journey towards a production-grade OS kernel is challenging,
we are steadfastly progressing towards this goal.
Over the course of 2024,
we significantly enhanced Asterinas's maturity,
as detailed in [our end-year report](https://asterinas.github.io/2025/01/20/asterinas-in-2024.html).
In December 2025,
we launched [Asterinas NixOS](https://asterinas.github.io/book/distro/index.html),
an Asterinas distribution based on [NixOS](https://nixos.org/).
This release marks Asterinas reaching the Minimum Viable Product (MVP) milestone.
In 2026, we aim to make Asterinas production-ready on x86-64 virtual machines and attract real users.
* **Modern architecture.**
Asterinas pioneers the [_framekernel_](https://asterinas.github.io/book/kernel/the-framekernel-architecture.html) architecture,
combining monolithic-kernel performance with microkernel-inspired separation.
Unsafe Rust is confined to a small, auditable framework called [OSTD](https://asterinas.github.io/api-docs-nightly/ostd/),
while the rest of the kernel is written in safe Rust,
keeping the memory-safety TCB intentionally minimal.
* **Modern design.**
Asterinas learns from Linux's hard-won engineering lessons,
but it is not afraid to deviate when the design warrants it.
For example, Asterinas improves the CPU scalability of its memory management subsystem
with a novel scheme called [CortenMM](https://dl.acm.org/doi/10.1145/3731569.3764836).
* **Modern code.**
Asterinas's codebase prioritizes safety, clarity, and maintainability.
Performance is pursued aggressively, but never by compromising safety guarantees.
Readability is treated as a feature, not a luxury,
and the codebase is structured to avoid hidden, cross-module coupling.
* **Modern tooling.**
Asterinas ships a purpose-built toolkit, [OSDK](https://asterinas.github.io/book/osdk/guide/index.html),
to facilitate building, running, and testing Rust kernels or kernel components.
Powered by OSTD,
OSDK makes kernel development as easy and fluid as writing a standard Rust application, eliminating the traditional friction of OS engineering.
Asterinas aims to become **a production-grade, memory-safe Linux alternative**,
with performance that matches Linux—and in some scenarios, exceeds it.
The project has been under active development for four years,
supports 230+ Linux system calls,
and has launched an experimental distribution,
[Asterinas NixOS](https://asterinas.github.io/book/distro/index.html).
In 2026, our priority is to advance project maturity toward production readiness,
specifically targeting standard and confidential virtual machines on x86-64.
Looking ahead, we will continue to expand functionality and
harden the system for **mission-critical deployments**
in data centers, autonomous vehicles, and embodied AI.
## Getting Started
@ -75,6 +101,9 @@ to make the Asterinas kernel more accessible for early adopters and enthusiasts.
We encourage you to try out Asterinas NixOS and share feedback.
Instructions on how to use the ISO installer can be found [here](https://asterinas.github.io/book/distro/index.html#end-users).
**Disclaimer: Asterinas is an independent, community-led project.
Asterinas NixOS is _not_ an official NixOS project and has _no_ affiliation with the NixOS Foundation. _No_ sponsorship or endorsement is implied.**
### For Kernel Developers
Follow the steps below to get Asterinas up and running.
@ -88,7 +117,7 @@ Follow the steps below to get Asterinas up and running.
2. Run a Docker container as the development environment:
```bash
docker run -it --privileged --network=host -v /dev:/dev -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.17.0-20251213
docker run -it --privileged --network=host -v /dev:/dev -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.17.0-20260114
```
3. Inside the container,

View File

@ -1,3 +1,143 @@
# Version 0.17.0 (2025-12-17)
This release marks a significant milestone in the evolution of Asterinas as we transition from "just a kernel" to a more complete, usable system. The headline of this release is the introduction of **Asterinas NixOS**, our first distribution that integrates the Asterinas kernel with the NixOS userspace, and enables real applications and services out of the box—including **XFCE**, **Podman**, and **systemd**. To support this growth, we are also strengthening our governance by establishing **the formal RFC (Request for Comments) process**, ensuring that major architectural decisions—starting with Asterinas NixOS itself—are designed transparently and collaboratively.
On the architecture front, **RISC-V support** has improved dramatically, with support for SMP (Symmetric Multiprocessing), FPU (Floating-Point Unit), VirtIO, and the SiFive HiFive Unleashed QEMU machine type. The kernel has also expanded with a new **input subsystem** (supporting keyboards and mice) and initial support for **namespaces and cgroups**. For filesystem developers, the big news is the addition of an **FS event notification mechanism (`inotify`)**, a new **ioctl infrastructure**, and a new filesystem type, **ConfigFS**. Finally, we are introducing **`sctrace`**—a dedicated tool for tracing and debugging syscall compatibility—now published on [crates.io](https://crates.io/crates/sctrace).
## Asterinas NixOS
We have made the following key changes to Asterinas NixOS:
* [Add NixOS as a distribution for Asterinas](https://github.com/asterinas/asterinas/pull/2621)
* [Add the XFCE Nix module](https://github.com/asterinas/asterinas/pull/2670)
* [Add the Podman Nix module](https://github.com/asterinas/asterinas/pull/2683)
* [Enable systemd](https://github.com/asterinas/asterinas/pull/2687)
* [Add Asterinas NixOS ISO installer](https://github.com/asterinas/asterinas/pull/2652)
* [Add Cachix as a source for pre-built binaries](https://github.com/asterinas/asterinas/pull/2685)
* [Add GitHub workflows to publish ISO images](https://github.com/asterinas/asterinas/pull/2743)
## Asterinas Kernel
We have made the following key changes to the Asterinas kernel:
* CPU architectures:
* x86
* [Add TSM-based attestation support for TDX via ConfigFS](https://github.com/asterinas/asterinas/pull/2505)
* RISC-V
* [Implement arch-aware vDSO](https://github.com/asterinas/asterinas/pull/2319)
* [Add VirtIO support for RISC-V platforms](https://github.com/asterinas/asterinas/pull/2299)
* Memory management
* [Support sealing memfd files](https://github.com/asterinas/asterinas/pull/2408)
* [Support executing memfd files and then `open("/proc/self/exe")`](https://github.com/asterinas/asterinas/pull/2521)
* Process management
* [Support `CLONE_PARENT` flag](https://github.com/asterinas/asterinas/pull/2447)
* [Support `execve` in multithreaded process](https://github.com/asterinas/asterinas/pull/2459)
* [Support `PR_SET`/`GET_SECUREBITS`](https://github.com/asterinas/asterinas/pull/2551)
* [Fix some `kill`-related behavior](https://github.com/asterinas/asterinas/pull/2516)
* IPC
* [Add `rt_sigtimedwait` syscall](https://github.com/asterinas/asterinas/pull/2705)
* [Enqueue ignored signals if the signals are blocked](https://github.com/asterinas/asterinas/pull/2503)
* [Refactor `NamedPipe` to correct its opening and blocking behaviors](https://github.com/asterinas/asterinas/pull/2434)
* [Support reopening anonymous pipes from `/proc`](https://github.com/asterinas/asterinas/pull/2694)
* [Fix or clarify some futexes bugs](https://github.com/asterinas/asterinas/pull/2515)
* File systems
* VFS
* [Add `inotify`-related syscalls](https://github.com/asterinas/asterinas/pull/2083)
* [Add new ioctl infrastructure](https://github.com/asterinas/asterinas/pull/2686)
* [Add `chmod` and `mkmod` macros](https://github.com/asterinas/asterinas/pull/2440)
* [Add `syncfs` syscall](https://github.com/asterinas/asterinas/pull/2682)
* [Add `fchmodat2` syscall](https://github.com/asterinas/asterinas/pull/2666)
* [Support mount bind with a file](https://github.com/asterinas/asterinas/pull/2418)
* [Support `MS_REMOUNT` flag](https://github.com/asterinas/asterinas/pull/2432)
* [Ensure that every `FileLike` is associated with a `dyn Inode`](https://github.com/asterinas/asterinas/pull/2555)
* Devtmpfs
* [Add `/dev/full` device](https://github.com/asterinas/asterinas/pull/2439)
* [Support registering char devices](https://github.com/asterinas/asterinas/pull/2598)
* [Support registering block device (and their partitions)](https://github.com/asterinas/asterinas/pull/2560)
* Procfs
* Add [`/proc/cmdline`](https://github.com/asterinas/asterinas/pull/2420), [`/proc/stat`, `/proc/uptime`](https://github.com/asterinas/asterinas/pull/2370), [`/proc/version`](https://github.com/asterinas/asterinas/pull/2679), [`/proc/[pid]/environ`](https://github.com/asterinas/asterinas/pull/2371), [`/proc/[pid]/oom_score_adj`](https://github.com/asterinas/asterinas/pull/2410), [`/proc/[pid]/cmdline`, `/proc/[pid]/mem`](https://github.com/asterinas/asterinas/pull/2449), [`/proc/[pid]/mountinfo`](https://github.com/asterinas/asterinas/pull/2399), [`/proc/[pid]/fdinfo`](https://github.com/asterinas/asterinas/pull/2526), and [`/proc/[pid]/maps`](https://github.com/asterinas/asterinas/pull/2725)
* [Support the sleeping and stopping states in `/proc/[pid]/stat`](https://github.com/asterinas/asterinas/pull/2491)
* [Introduce `VmPrinter`](https://github.com/asterinas/asterinas/pull/2414) and [refactor procfs with `VmPrinter`](https://github.com/asterinas/asterinas/pull/2583)
* [Fix a lot of bugs in procfs](https://github.com/asterinas/asterinas/pull/2553)
* Ext2
* [Support Ext2 handling of FIFO and devices](https://github.com/asterinas/asterinas/pull/2658)
* [Fix Ext2 directory entry iteration](https://github.com/asterinas/asterinas/pull/2624)
* [Fix the behavior of syncing BlockGroup metadata in Ext2](https://github.com/asterinas/asterinas/pull/2611)
* [Fix some bugs in Ext2 superblock](https://github.com/asterinas/asterinas/pull/2675)
* Configfs
* [Add basic configfs implementation](https://github.com/asterinas/asterinas/pull/2186)
* Sockets and networking
* [Support UNIX datagram sockets](https://github.com/asterinas/asterinas/pull/2412)
* [Add `sendmmsg` syscall](https://github.com/asterinas/asterinas/pull/2676)
* [Add `sethostname` and `setdomainname` syscalls](https://github.com/asterinas/asterinas/pull/2442)
* [Support `SO_BROADCAST` and `IP_RECVERR`](https://github.com/asterinas/asterinas/pull/2572)
* Namespace and cgroups
* [Add the namespace framework (along with `unshare` and `setns` syscalls)](https://github.com/asterinas/asterinas/pull/2312)
* [Add the mount namespace](https://github.com/asterinas/asterinas/pull/2379)
* [Support `/proc/[pid]/uid_map` and `/proc/[pid]/gid_map`](https://github.com/asterinas/asterinas/pull/2454)
* [Implement controller framework for cgroup subsystem](https://github.com/asterinas/asterinas/pull/2282)
* [Enable process management for cgroups](https://github.com/asterinas/asterinas/pull/2160)
* Devices
* Input devices
* [Add the input subsystem](https://github.com/asterinas/asterinas/pull/2364)
* [Map the I/O memory to the userspace](https://github.com/asterinas/asterinas/pull/2099)
* [Add the input devices `/dev/input/eventX`](https://github.com/asterinas/asterinas/pull/2561)
* [Add the framebuffer device `/dev/fb0`](https://github.com/asterinas/asterinas/pull/2216)
* [Add i8042 mouse](https://github.com/asterinas/asterinas/pull/2479)
* [Make i8042 initialization stable on real hardware](https://github.com/asterinas/asterinas/pull/2646)
* TTY and PTY
* [Add `KDSETMODE`/`KDSKBMODE` ioctls](https://github.com/asterinas/asterinas/pull/2525)
* [Fix PTY closing behavior](https://github.com/asterinas/asterinas/pull/2550)
* [Make PTY master reads block if no PTY slave is open](https://github.com/asterinas/asterinas/pull/2581)
* [Make the semantics of TTY-related devices correct](https://github.com/asterinas/asterinas/pull/2566)
* [Support PTY packet mode](https://github.com/asterinas/asterinas/pull/2594)
* System management
* [Add `reboot` syscall](https://github.com/asterinas/asterinas/pull/2552)
* [Make `reboot -f` work on real hardware](https://github.com/asterinas/asterinas/pull/2636)
* [Support `RUSAGE_CHILDREN` for `getrusage`](https://github.com/asterinas/asterinas/pull/2438)
* Misc
* [Upgrade to Rust 2024 edition and the 20251208 nightly toolchain](https://github.com/asterinas/asterinas/pull/2701)
* [Introduce the ASCII art of Asterinas logo in gradient colors](https://github.com/asterinas/asterinas/pull/2427)
* [Add stage support for `init_component` macro](https://github.com/asterinas/asterinas/pull/2415)
* [Add a new tool called Syscall Compatibility Tracer (`sctrace`)](https://github.com/asterinas/asterinas/pull/2456)
## Asterinas OSTD & OSDK
We have made the following key changes to OSTD and/or OSDK:
* CPU architectures
* Common
* [Reorganize `ostd::arch::irq`](https://github.com/asterinas/asterinas/pull/2504)
* x86
* [Better x86 CPU feature detection by rewriting all CPUID-related code](https://github.com/asterinas/asterinas/pull/2395)
* [Set `CR0.WP/NE/MP` explicitly to fix AP behavior](https://github.com/asterinas/asterinas/pull/2422)
* [Extend cache policies for the x86 Architecture](https://github.com/asterinas/asterinas/pull/2570)
* RISC-V
* [Add support for RISC-V PLIC](https://github.com/asterinas/asterinas/pull/2106)
* [Refactor RISC-V trap handling](https://github.com/asterinas/asterinas/pull/2318)
* [Add RISC-V FPU support](https://github.com/asterinas/asterinas/pull/2320)
* [Implement fallible memory operations on RISC-V platform](https://github.com/asterinas/asterinas/pull/2462)
* [Support bootup on SiFive HiFive Unleashed](https://github.com/asterinas/asterinas/pull/2481)
* [RISC-V SMP boot](https://github.com/asterinas/asterinas/pull/2368)
* [Full (<=32) RISC-V SMP support](https://github.com/asterinas/asterinas/pull/2547)
* CPU
* [Extract `CpuId` into a dedicated sub-module](https://github.com/asterinas/asterinas/pull/2514)
* Memory management
* [Make `UniqueFrame::repurpose` sound](https://github.com/asterinas/asterinas/pull/2441)
* Interrupt handling
* [Refactor OSTD's `irq` module for improved clarity](https://github.com/asterinas/asterinas/pull/2429)
* Misc
* [Move PCI bus out of OSTD](https://github.com/asterinas/asterinas/pull/2027)
## Asterinas Book
We have made the following key changes to the Book:
* [Add the first RFC: "Establish the RFC process"](https://github.com/asterinas/asterinas/pull/2365)
* [Add the second RFC: "Asterinas NixOS"](https://github.com/asterinas/asterinas/pull/2584)
* [Add a new "Limitations on System Calls" section to the book](https://github.com/asterinas/asterinas/pull/2314)
* [Add the Asterinas NixOS volume](https://github.com/asterinas/asterinas/pull/2750)
# Version 0.16.0 (2025-08-04)
This release introduces initial support for the **LoongArch CPU architecture**, a major milestone for the project. Version 0.16.0 also significantly expands our Linux ABI compatibility with the addition of **nine new system calls** such as `memfd_create` and `pidfd_open`.
@ -48,7 +188,7 @@ We have made the following key changes to the Asterinas kernel:
* [Introduce the system call tests from LTP](https://github.com/asterinas/asterinas/pull/2053)
* [Use Nix to build initramfs](https://github.com/asterinas/asterinas/pull/2101)
## OSTD & OSDK
## Asterinas OSTD & OSDK
We have made the following key changes to OSTD:
@ -64,12 +204,12 @@ We have made the following key changes to OSTD:
* LoongArch:
* [Add the initial LoongArch support](https://github.com/asterinas/asterinas/pull/2260)
* CPU:
* [Add support for dynamically-allocated CPU-local objects](https://github.com/asterinas/asterinas/pull/2036)
* [Add support for dynamicall-allocated CPU-local objects](https://github.com/asterinas/asterinas/pull/2036)
* [Require `T: Send` for `CpuLocal<T, S>`](https://github.com/asterinas/asterinas/pull/2171)
* Memory management:
* [Adopt a two-phase locking scheme for page tables](https://github.com/asterinas/asterinas/pull/1948)
* Trap handling:
* [Create `IrqChip` abstraction](https://github.com/asterinas/asterinas/pull/2107)
* [Create `IrqChip` abstraction](https://github.com/asterinas/asterinas/pull/2107)
* Task and scheduling:
* [Rewrite the Rust doc of OSTD's scheduling module](https://github.com/asterinas/asterinas/pull/2284)
* [Fix the race between enabling IRQs and halting CPU](https://github.com/asterinas/asterinas/pull/2052)

View File

@ -1,7 +1,6 @@
[book]
authors = ["The Asterinas authors"]
language = "en"
multilingual = false
src = "src"
title = "The Asterinas Book"

View File

@ -61,7 +61,7 @@
# How to Contribute
* [Before You Contribute]()
* [Before You Contribute](to-contribute/README.md)
* [Code Organization]()
* [Style Guidelines]()
* [General Guidelines]()

View File

@ -8,6 +8,9 @@ except that it replaces Linux with Asterinas as its kernel.
For more rationale about choosing NixOS,
see [the RFC](https://asterinas.github.io/book/rfcs/0002-asterinas-nixos.html).
**Disclaimer: Asterinas is an independent, community-led project.
Asterinas NixOS is _not_ an official NixOS project and has _no_ affiliation with the NixOS Foundation. _No_ sponsorship or endorsement is implied.**
Asterinas NixOS is not ready for production use.
We provide Asterinas NixOS to make the Asterinas kernel more accessible,
allowing early adopters and enthusiasts to try it out and provide feedback.

View File

@ -48,7 +48,7 @@ Follow the three simple steps below to get Asterinas up and running.
--network=host \
--device=/dev/kvm \
-v $(pwd)/asterinas:/root/asterinas \
asterinas/asterinas:0.17.0-20251213
asterinas/asterinas:0.17.0-20260114
```
3. Inside the container, go to the project folder to build and run Asterinas.

View File

@ -34,7 +34,7 @@ cargo osdk test
### General Test
The following command builds and runs the test binaries in `test/src/apps` directory on Asterinas.
The following command builds and runs the test binaries in `test/initramfs/src/apps` directory on Asterinas.
```bash
make run_kernel AUTO_TEST=test

View File

@ -66,7 +66,7 @@ The following result is an example:
2. Run a Docker container as the development environment.
```bash
docker run -it --privileged --network=host --device=/dev/kvm -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.17.0-20251213
docker run -it --privileged --network=host --device=/dev/kvm -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.17.0-20260114
```
3. Inside the container,

View File

@ -27,7 +27,7 @@ which are summarized in the table below.
| 4 | stat | ✅ | 💯 |
| 5 | fstat | ✅ | 💯 |
| 6 | lstat | ✅ | 💯 |
| 7 | poll | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#poll) |
| 7 | poll | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#poll-and-ppoll) |
| 8 | lseek | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#lseek) |
| 9 | mmap | ✅ | [⚠️](syscall-flag-coverage/memory-management/#mmap-and-munmap) |
| 10 | mprotect | ✅ | [⚠️](syscall-flag-coverage/memory-management/#mprotect) |
@ -36,7 +36,7 @@ which are summarized in the table below.
| 13 | rt_sigaction | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#rt_sigaction) |
| 14 | rt_sigprocmask | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#rt_sigprocmask) |
| 15 | rt_sigreturn | ✅ | 💯 |
| 16 | ioctl | ✅ | |
| 16 | ioctl | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#ioctl) |
| 17 | pread64 | ✅ | 💯 |
| 18 | pwrite64 | ✅ | 💯 |
| 19 | readv | ✅ | 💯 |
@ -55,30 +55,30 @@ which are summarized in the table below.
| 32 | dup | ✅ | 💯 |
| 33 | dup2 | ✅ | 💯 |
| 34 | pause | ✅ | 💯 |
| 35 | nanosleep | ✅ | |
| 36 | getitimer | ✅ | |
| 35 | nanosleep | ✅ | 💯 |
| 36 | getitimer | ✅ | 💯 |
| 37 | alarm | ✅ | 💯 |
| 38 | setitimer | ✅ | |
| 38 | setitimer | ✅ | 💯 |
| 39 | getpid | ✅ | 💯 |
| 40 | sendfile | ✅ | 💯 |
| 41 | socket | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#socket) |
| 42 | connect | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#connect) |
| 43 | accept | ✅ | |
| 43 | accept | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#accept-and-accept4) |
| 44 | sendto | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#sendto-sendmsg-and-sendmmsg) |
| 45 | recvfrom | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#recvfrom-and-recvmsg) |
| 46 | sendmsg | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#sendto-sendmsg-and-sendmmsg) |
| 47 | recvmsg | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#recvfrom-and-recvmsg) |
| 48 | shutdown | ✅ | |
| 48 | shutdown | ✅ | 💯 |
| 49 | bind | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#bind) |
| 50 | listen | ✅ | |
| 50 | listen | ✅ | 💯 |
| 51 | getsockname | ✅ | 💯 |
| 52 | getpeername | ✅ | |
| 52 | getpeername | ✅ | 💯 |
| 53 | socketpair | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#socketpair) |
| 54 | setsockopt | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#getsockopt-and-setsockopt) |
| 55 | getsockopt | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#getsockopt-and-setsockopt) |
| 56 | clone | ✅ | [⚠️](syscall-flag-coverage/process-and-thread-management/#clone) |
| 56 | clone | ✅ | [⚠️](syscall-flag-coverage/process-and-thread-management/#clone-and-clone3) |
| 57 | fork | ✅ | 💯 |
| 58 | vfork | ❌ | N/A |
| 58 | vfork | ✅ | 💯 |
| 59 | execve | ✅ | 💯 |
| 60 | exit | ✅ | 💯 |
| 61 | wait4 | ✅ | [⚠️](syscall-flag-coverage/process-and-thread-management/#wait4) |
@ -93,7 +93,7 @@ which are summarized in the table below.
| 70 | msgrcv | ❌ | N/A |
| 71 | msgctl | ❌ | N/A |
| 72 | fcntl | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#fcntl) |
| 73 | flock | ✅ | |
| 73 | flock | ✅ | 💯 |
| 74 | fsync | ✅ | 💯 |
| 75 | fdatasync | ✅ | 💯 |
| 76 | truncate | ✅ | 💯 |
@ -151,7 +151,7 @@ which are summarized in the table below.
| 128 | rt_sigtimedwait | ✅ | 💯 |
| 129 | rt_sigqueueinfo | ❌ | N/A |
| 130 | rt_sigsuspend | ✅ | 💯 |
| 131 | sigaltstack | ✅ | |
| 131 | sigaltstack | ✅ | 💯 |
| 132 | utime | ✅ | 💯 |
| 133 | mknod | ✅ | 💯 |
| 134 | uselib | ❌ | N/A |
@ -241,9 +241,9 @@ which are summarized in the table below.
| 218 | set_tid_address | ✅ | 💯 |
| 219 | restart_syscall | ❌ | N/A |
| 220 | semtimedop | ✅ | [⚠️](syscall-flag-coverage/inter-process-communication/#semop-and-semtimedop) |
| 221 | fadvise64 | ✅ | |
| 221 | fadvise64 | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#fadvise64) |
| 222 | timer_create | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#timer_create) |
| 223 | timer_settime | ✅ | |
| 223 | timer_settime | ✅ | 💯 |
| 224 | timer_gettime | ✅ | 💯 |
| 225 | timer_getoverrun | ❌ | N/A |
| 226 | timer_delete | ✅ | 💯 |
@ -267,12 +267,12 @@ which are summarized in the table below.
| 244 | mq_notify | ❌ | N/A |
| 245 | mq_getsetattr | ❌ | N/A |
| 246 | kexec_load | ❌ | N/A |
| 247 | waitid | ✅ | |
| 247 | waitid | ✅ | [⚠️](syscall-flag-coverage/process-and-thread-management/#waitid) |
| 248 | add_key | ❌ | N/A |
| 249 | request_key | ❌ | N/A |
| 250 | keyctl | ❌ | N/A |
| 251 | ioprio_set | ✅ | |
| 252 | ioprio_get | ✅ | |
| 251 | ioprio_set | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#ioprio_set-and-ioprio_get) |
| 252 | ioprio_get | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#ioprio_set-and-ioprio_get) |
| 253 | inotify_init | ✅ | 💯 |
| 254 | inotify_add_watch | ✅ | [⚠️](syscall-flag-coverage/file-systems-and-mount-control/#inotify_add_watch) |
| 255 | inotify_rm_watch | ✅ | 💯 |
@ -291,8 +291,8 @@ which are summarized in the table below.
| 268 | fchmodat | ✅ | 💯 |
| 269 | faccessat | ✅ | 💯 |
| 270 | pselect6 | ✅ | 💯 |
| 271 | ppoll | ✅ | |
| 272 | unshare | ✅ | |
| 271 | ppoll | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#poll-and-ppoll) |
| 272 | unshare | ✅ | [⚠️](syscall-flag-coverage/namespaces-cgroups-and-security/#unshare) |
| 273 | set_robust_list | ✅ | 💯 |
| 274 | get_robust_list | ❌ | N/A |
| 275 | splice | ❌ | N/A |
@ -300,15 +300,15 @@ which are summarized in the table below.
| 277 | sync_file_range | ❌ | N/A |
| 278 | vmsplice | ❌ | N/A |
| 279 | move_pages | ❌ | N/A |
| 280 | utimensat | ✅ | |
| 280 | utimensat | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#utimensat) |
| 281 | epoll_pwait | ✅ | 💯 |
| 282 | signalfd | ✅ | 💯 |
| 283 | timerfd_create | ✅ | |
| 283 | timerfd_create | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#timerfd_create) |
| 284 | eventfd | ✅ | 💯 |
| 285 | fallocate | ✅ | |
| 286 | timerfd_settime | ✅ | |
| 285 | fallocate | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#fallocate) |
| 286 | timerfd_settime | ✅ | [⚠️](syscall-flag-coverage/signals-and-timers/#timerfd_settime) |
| 287 | timerfd_gettime | ✅ | 💯 |
| 288 | accept4 | ✅ | |
| 288 | accept4 | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#accept-and-accept4) |
| 289 | signalfd4 | ✅ | 💯 |
| 290 | eventfd2 | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#eventfd-and-eventfd2) |
| 291 | epoll_create1 | ✅ | 💯 |
@ -328,7 +328,7 @@ which are summarized in the table below.
| 305 | clock_adjtime | ❌ | N/A |
| 306 | syncfs | ✅ | 💯 |
| 307 | sendmmsg | ✅ | [⚠️](syscall-flag-coverage/networking-and-sockets/#sendto-sendmsg-and-sendmmsg) |
| 308 | setns | ✅ | |
| 308 | setns | ✅ | [⚠️](syscall-flag-coverage/namespaces-cgroups-and-security/#setns) |
| 309 | getcpu | ✅ | 💯 |
| 310 | process_vm_readv | ❌ | N/A |
| 311 | process_vm_writev | ❌ | N/A |
@ -339,14 +339,16 @@ which are summarized in the table below.
| 316 | renameat2 | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#renameat2) |
| 318 | getrandom | ✅ | [⚠️](syscall-flag-coverage/system-information-and-misc/#getrandom) |
| 319 | memfd_create | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#memfd_create) |
| 322 | execveat | ✅ | |
| 322 | execveat | ✅ | 💯 |
| 327 | preadv2 | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#preadv2-and-pwritev2) |
| 328 | pwritev2 | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#preadv2-and-pwritev2) |
| 332 | statx | ✅ | ❓ |
| 434 | pidfd_open | ✅ | ❓ |
| 435 | clone3 | ✅ | ❓ |
| 436 | close_range | ✅ | ❓ |
| 439 | faccessat2 | ✅ | ❓ |
| 332 | statx | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#statx) |
| 424 | pidfd_send_signal | ✅ | 💯 |
| 434 | pidfd_open | ✅ | 💯 |
| 435 | clone3 | ✅ | [⚠️](syscall-flag-coverage/process-and-thread-management/#clone-and-clone3) |
| 436 | close_range | ✅ | 💯 |
| 438 | pidfd_getfd | ✅ | 💯 |
| 439 | faccessat2 | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#faccessat2) |
| 441 | epoll_pwait2 | ✅ | 💯 |
| 452 | fchmodat2 | ✅ | 💯 |

View File

@ -103,3 +103,71 @@ Unsupported flags:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/preadv2.2.html).
### `faccessat2`
Supported functionality in SCML:
```c
{{#include faccessat2.scml}}
```
Silently-ignored flags:
* `AT_EACCESS`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/faccessat2.2.html).
### `statx`
Supported functionality in SCML:
```c
{{#include statx.scml}}
```
Silently-ignored flags:
* `AT_NO_AUTOMOUNT`
* `AT_STATX_FORCE_SYNC`
* `AT_STATX_DONT_SYNC`
Silently-ignored masks:
* `STATX_DIOALIGN`
* `STATX_MNT_ID_UNIQUE`
* `STATX_SUBVOL`
* `STATX_WRITE_ATOMIC`
* `STATX_DIO_READ_ALIGN`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/statx.2.html).
### `fallocate`
Supported functionality in SCML:
```c
{{#include fallocate.scml}}
```
Unsupported modes:
* `FALLOC_FL_UNSHARE_RANGE`
* `FALLOC_FL_COLLAPSE_RANGE`
* `FALLOC_FL_ZERO_RANGE`
* `FALLOC_FL_INSERT_RANGE`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/fallocate.2.html).
### `utimensat`
Supported functionality in SCML:
```c
{{#include utimensat.scml}}
```
Unsupported flags:
* `AT_EMPTY_PATH`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/utimensat.2.html).

View File

@ -0,0 +1,5 @@
// Check user's permissions for a file
faccessat2(
dirfd, path, mode,
flags = AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW
);

View File

@ -0,0 +1,5 @@
// Allocate disk space within the range specified
fallocate(fd, mode = FALLOC_FL_KEEP_SIZE, offset, size);
// Deallocate space (create a hole) while keeping the file size unchanged
fallocate(fd, mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, size);

View File

@ -118,3 +118,6 @@ fremovexattr(fd, name);
// Check user's permissions for a file
faccessat(dirfd, path, mode);
// Apply or remove an advisory lock on an open file
flock(fd, op = LOCK_SH | LOCK_EX | LOCK_UN | LOCK_NB);

View File

@ -0,0 +1,15 @@
statx_flags = AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_STATX_FORCE_SYNC |
AT_STATX_DONT_SYNC | AT_STATX_SYNC_AS_STAT | AT_SYMLINK_NOFOLLOW;
statx_mask = STATX_TYPE | STATX_MODE | STATX_NLINK | STATX_UID | STATX_GID |
STATX_ATIME | STATX_MTIME | STATX_CTIME | STATX_INO | STATX_SIZE |
STATX_BLOCKS | STATX_BASIC_STATS | STATX_BTIME | STATX_ALL |
STATX_MNT_ID | STATX_DIOALIGN | STATX_MNT_ID_UNIQUE | STATX_SUBVOL |
STATX_WRITE_ATOMIC | STATX_DIO_READ_ALIGN;
// Get file status (extended)
statx(
dirfd, pathname,
flags = <statx_flags>,
mask = <statx_mask>,
statxbuf
);

View File

@ -0,0 +1,2 @@
// Change file timestamps with nanosecond precision
utimensat(dirfd, path, times, flags = AT_SYMLINK_NOFOLLOW);

View File

@ -3,7 +3,7 @@
<!--
Put system calls such as
dup, dup2, dup3, fcntl, ioctl, pipe, pipe2, splice, tee, vmsplice, sendfile,
eventfd, eventfd2 and memfd_create
eventfd, eventfd2, memfd_create and fadvise64
under this category.
-->
@ -86,6 +86,25 @@ Unsupported flags:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/memfd_create.2.html).
### `fadvise64`
Supported functionality in SCML:
```c
{{#include fadvise64.scml}}
```
Silently-ignored flags:
* `POSIX_FADV_NORMAL`
* `POSIX_FADV_RANDOM`
* `POSIX_FADV_SEQUENTIAL`
* `POSIX_FADV_WILLNEED`
* `POSIX_FADV_DONTNEED`
* `POSIX_FADV_NOREUSE`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/posix_fadvise.2.html).
### `epoll_ctl`
Supported functionality in SCML:
@ -101,12 +120,12 @@ Unsupported flags in events:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/epoll_ctl.2.html).
### `poll`
### `poll` and `ppoll`
Supported functionality in SCML:
```c
{{#include poll.scml}}
{{#include poll_and_ppoll.scml}}
```
Unsupported events:
@ -116,3 +135,29 @@ Unsupported events:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/poll.2.html).
### `ioctl`
Supported functionality in SCML:
```c
{{#include ioctl.scml}}
```
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/ioctl.2.html).
### `ioprio_set` and `ioprio_get`
Supported functionality in SCML:
```c
{{#include ioprio_get_and_set.scml}}
```
Unsupported selectors:
* `IOPRIO_WHO_PGRP`
* `IOPRIO_WHO_USER`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/ioprio_set.2.html).

View File

@ -0,0 +1,2 @@
// Announce an intention to access file data in a specific pattern in the future
fadvise64(fd, offset, len, advice = 0);

View File

@ -28,3 +28,12 @@ epoll_pwait2(epfd, events, maxevents, timeout, sigmask);
// Wait for I/O event on the file descriptors set in read, write or except bitmaps
select(nfds, readfds, writefds, exceptfds, timeout);
// Obtain a file descriptor that refers to a process
pidfd_open(pid, flags = PIDFD_NONBLOCK);
// Obtain a duplicate of another process's file descriptor
pidfd_getfd(pidfd, targetfd, flags = 0);
// Close all file descriptors in the inclusive range [first, last]
close_range(first, last, flags = CLOSE_RANGE_UNSHARE | CLOSE_RANGE_CLOEXEC);

View File

@ -0,0 +1,33 @@
tty_ops = TCGETS | TCSETS | TCSETSW | TCSETSF | TIOCGWINSZ | TIOCSWINSZ |
TIOCGPTN | FIONREAD | KDFONTOP | KDSETMODE | KDGETMODE |
KDSKBMODE | KDGKBMODE;
term_ops = TIOCGPGRP | TIOCSPGRP | TIOCSCTTY | TIOCNOTTY | TIOCGSID;
pty_master_ops = TIOCSPTLCK | TIOCGPTLCK | TIOCGPTPEER | TIOCPKT | TIOCGPKT;
// Control file descriptor flags and I/O modes
ioctl(fd, op = FIONCLEX | FIOCLEX | FIONBIO | FIOASYNC, ..);
// Control terminal devices
ioctl(fd, op = <pty_master_ops> | <tty_ops> | <term_ops>, ..);
// Control framebuffer display
ioctl(
fd,
op = FBIOGET_VSCREENINFO | FBIOPUT_VSCREENINFO | FBIOGET_FSCREENINFO |
FBIOGETCMAP | FBIOPUTCMAP | FBIOPAN_DISPLAY | FBIOBLANK,
..
);
// Control Event devices (evdev)
ioctl(
fd,
op = EVIOCGVERSION | EVIOCGID | EVIOCGNAME | EVIOCGPHYS | EVIOCGUNIQ |
EVIOCGKEY | EVIOCGLED | EVIOCGSW | EVIOCSCLOCKID | EVIOCGBIT,
..
);
// Control block devices
ioctl(fd, op = BLKGETSIZE64, ..);
// Control Trust Domain Extensions (TDX) guest devices
ioctl(fd, op = TDX_CMD_GET_REPORT0, ..);

View File

@ -0,0 +1,5 @@
// Set the I/O priority for a single thread
ioprio_set(which = IOPRIO_WHO_PROCESS, who, ioprio);
// Get the I/O priority for a single thread
ioprio_get(which = IOPRIO_WHO_PROCESS, who);

View File

@ -6,3 +6,6 @@ struct pollfd = {
// Wait for I/O event on a set of file descriptors
poll(fds = [ <pollfd> ], nfds, timeout);
// Wait for I/O event on a set of file descriptors with specified signals temporarily blocked
ppoll(fds = [ <pollfd> ], nfds, timeout, sigset, sigset_size);

View File

@ -90,7 +90,6 @@ Unsupported event flags:
Unsupported control flags:
* `IN_EXCL_UNLINK` - Events on unlinked files are not excluded
* `IN_ONESHOT` - Watches are not automatically removed after the first event
For more information,
see [the man page](https://man7.org/linux/man-pages/man7/inotify.7.html).

View File

@ -3,7 +3,7 @@ inotify_events = IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
IN_DELETE_SELF | IN_CLOSE;
inotify_controls = IN_ONLYDIR | IN_DONT_FOLLOW | IN_MASK_CREATE |
IN_MASK_ADD | IN_ISDIR;
IN_MASK_ADD | IN_ONESHOT;
// Add a watch to an initialized inotify instance
inotify_add_watch(fd, pathname, mask = <inotify_events> | <inotify_controls>);

View File

@ -24,7 +24,6 @@ Silently-ignored flags:
* `MAP_NONBLOCK`
* `MAP_NORESERVE`
* `MAP_POPULATE`
* `MAP_SYNC`
Partially supported flags:
* `MAP_FIXED_NOREPLACE` is treated as `MAP_FIXED`
@ -89,15 +88,20 @@ Supported functionality in SCML:
```
Silently-ignored advice:
* `MADV_DONTNEED`
* `MADV_NOHUGEPAGE`
* `MADV_HUGEPAGE`
* `MADV_NORMAL`
* `MADV_RANDOM`
* `MADV_SEQUENTIAL`
* `MADV_WILLNEED`
* `MADV_FREE`
* `MADV_MERGEABLE`
* `MADV_DONTFORK`
* `MADV_UNMERGEABLE`
* `MADV_HUGEPAGE`
* `MADV_NOHUGEPAGE`
Unsupported advice:
* `MADV_RANDOM`
* `MADV_REMOVE`
* `MADV_DONTFORK`
* `MADV_DOFORK`
* `MADV_HWPOISON`
* `MADV_UNMERGEABLE`

View File

@ -1,11 +1,2 @@
// Apply the default memory access pattern with no special optimizations
madvise(addr, length, advice = MADV_NORMAL);
// Indicate sequential access to enable aggressive read-ahead and immediate page release
madvise(addr, length, advice = MADV_SEQUENTIAL);
// Prefetch pages for near-future access to reduce latency
madvise(addr, length, advice = MADV_WILLNEED);
// Mark pages for lazy reclamation to allow the kernel to free them under memory pressure
madvise(addr, length, advice = MADV_FREE);
// Do not expect access in the near future and free associated resources
madvise(addr, length, advice = MADV_DONTNEED);

View File

@ -11,8 +11,7 @@ opt_flags =
MAP_LOCKED |
MAP_NONBLOCK |
MAP_NORESERVE |
MAP_POPULATE |
MAP_SYNC;
MAP_POPULATE;
// Create a private memory mapping
mmap(

View File

@ -64,3 +64,44 @@ Unsupported versions:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/capget.2.html).
### `unshare`
Supported functionality in SCML:
```c
{{#include unshare.scml}}
```
Unsupported flags:
* `CLONE_NEWCGROUP`
* `CLONE_NEWIPC`
* `CLONE_NEWNET`
* `CLONE_NEWPID`
* `CLONE_NEWTIME`
* `CLONE_NEWUSER`
Silently-ignored flags:
* `CLONE_SYSVSEM`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/unshare.2.html).
### `setns`
Supported functionality in SCML:
```c
{{#include setns.scml}}
```
Unsupported flags:
* `CLONE_NEWCGROUP`
* `CLONE_NEWIPC`
* `CLONE_NEWNET`
* `CLONE_NEWPID`
* `CLONE_NEWTIME`
* `CLONE_NEWUSER`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/setns.2.html).

View File

@ -0,0 +1,2 @@
// Reassociate thread with a namespace
setns(fd, ns_type = CLONE_NEWNS | CLONE_NEWUTS);

View File

@ -0,0 +1,2 @@
// Disassociate parts of the process execution context
unshare(flags = CLONE_FILES | CLONE_FS | CLONE_NEWNS | CLONE_NEWUTS | CLONE_THREAD | CLONE_SIGHAND | CLONE_VM);

View File

@ -57,6 +57,17 @@ Supported functionality in SCML:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/connect.2.html).
### `accept` and `accept4`
Supported functionality in SCML:
```c
{{#include accept_and_accept4.scml}}
```
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/accept.2.html).
## Socket Communication
### `sendto`, `sendmsg` and `sendmmsg`

View File

@ -0,0 +1,15 @@
struct sockaddr = {
sa_family = AF_INET | AF_UNIX | AF_VSOCK,
..
};
// Accept an incoming connection
accept(
sockfd, addr = <sockaddr>, addrlen
);
// Accept an incoming connection and set flags for the new socket
accept4(
sockfd, addr = <sockaddr>, addrlen,
flags = SOCK_NONBLOCK | SOCK_CLOEXEC
);

View File

@ -1,2 +1,11 @@
// Get socket name
getsockname(sockfd, addr, addrlen);
// Get name of connected peer socket
getpeername(sockfd, addr, addrlen);
// Listen for connections on a socket
listen(sockfd, backlog);
// Shut down part of a full-duplex connection
shutdown(sockfd, how = SHUT_RD | SHUT_WR | SHUT_RDWR);

View File

@ -42,12 +42,12 @@ Ignored options:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/wait4.2.html).
### `clone`
### `clone` and `clone3`
Supported functionality in SCML:
```c
{{#include clone.scml}}
{{#include clone_and_clone3.scml}}
```
For more information,
@ -66,3 +66,17 @@ Unsupported policies or flags:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/sched_setscheduler.2.html).
### `waitid`
Supported functionality in SCML:
```c
{{#include waitid.scml}}
```
Ignored options:
* `WEXITED`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/waitid.2.html).

View File

@ -45,3 +45,12 @@ clone(
flags = <opt_flags> | <signal_flags>,
func_arg, ..
);
// Create a thread or process with enhanced control by providing structured arguments
clone3(
clone_args = {
flags = <opt_flags>,
..
},
size
);

View File

@ -1,6 +1,9 @@
// Execute program
execve(pathname, argv, envp);
// Execute program relative to a directory file descriptor
execveat(dirfd, path, argv, envp, flags = AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW);
// Exit all threads in a process
exit_group(status);
@ -54,6 +57,9 @@ sched_yield();
// Create a child process
fork();
// Create a child process and block parent
vfork();
// Terminate the calling process
exit(status);

View File

@ -0,0 +1,7 @@
// Wait for a child process to change state
waitid(
which = P_PID | P_PIDFD | P_PGID | P_ALL,
pid, infop,
options = WNOHANG | WSTOPPED | WCONTINUED | WNOWAIT,
ru
);

View File

@ -47,6 +47,9 @@ Supported functionality in SCML:
{{#include timer_create.scml}}
```
Partially-supported clock IDs:
* `CLOCK_BOOTTIME` is treated as `CLOCK_MONOTONIC`
Unsupported predefined clock IDs:
* `CLOCK_REALTIME_ALARM`
* `CLOCK_BOOTTIME_ALARM`
@ -57,3 +60,35 @@ Unsupported notification methods:
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/timer_create.2.html).
### `timerfd_create`
Supported functionality in SCML:
```c
{{#include timerfd_create.scml}}
```
Partially-supported clock IDs:
* `CLOCK_BOOTTIME` is treated as `CLOCK_MONOTONIC`
Unsupported predefined clock IDs:
* `CLOCK_REALTIME_ALARM`
* `CLOCK_BOOTTIME_ALARM`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/timerfd_create.2.html).
### `timerfd_settime`
Supported functionality in SCML:
```c
{{#include timerfd_settime.scml}}
```
Ignored flags:
* `TFD_TIMER_CANCEL_ON_SET`
For more information,
see [the man page](https://man7.org/linux/man-pages/man2/timerfd_create.2.html).

View File

@ -1,6 +1,12 @@
// Get value of an interval timer
getitimer(which, value);
// Set an alarm clock for delivery of a signal
alarm(seconds);
// Set value of an interval timer
setitimer(which, value, ovalue);
// Return from signal handler and cleanup stack frame
rt_sigreturn(arg);
@ -10,6 +16,9 @@ kill(pid, sig);
// Send signal to a thread
tgkill(tgid, tid, sig);
// Send signal to the target process referred to by pidfd
pidfd_send_signal(pidfd, sig, info, flags = PIDFD_SIGNAL_THREAD | PIDFD_SIGNAL_THREAD_GROUP | PIDFD_SIGNAL_PROCESS_GROUP);
// Wait for signal
pause();
@ -36,3 +45,13 @@ time(tloc);
// Synchronously wait for a signal with a timeout
rt_sigtimedwait(set, info, timeout, sigsetsize);
// Arm or disarm a POSIX per-process timer
timer_settime(timer_id, flags, new_setting, old_setting);
struct stack_t = {
sp, flags = SS_AUTODISARM | SS_ONSTACK | SS_DISABLE, size
};
// Set and/or get signal stack context
sigaltstack(stack = <stack_t>, old_stack = <stack_t>);

View File

@ -2,7 +2,7 @@ opt_notify_methods = SIGEV_NONE | SIGEV_SIGNAL | SIGEV_THREAD_ID;
// Create a timer with predefined clock source
timer_create(
clockid = CLOCK_PROCESS_CPUTIME_ID | CLOCK_THREAD_CPUTIME_ID | CLOCK_REALTIME | CLOCK_MONOTONIC | CLOCK_BOOTTIME,
clockid = CLOCK_PROCESS_CPUTIME_ID | CLOCK_THREAD_CPUTIME_ID | CLOCK_REALTIME | CLOCK_MONOTONIC,
sevp = {
sigev_notify = <opt_notify_methods>,
..

View File

@ -0,0 +1,5 @@
// Create a timer file descriptor with a predefined clock source
timerfd_create(
clockid = CLOCK_REALTIME | CLOCK_MONOTONIC,
flags = TFD_CLOEXEC | TFD_NONBLOCK
);

View File

@ -0,0 +1,7 @@
// Arm or disarm a timer file descriptor
timerfd_settime(
ufd,
flags = TFD_TIMER_ABSTIME,
utmr,
otmr
);

View File

@ -63,7 +63,6 @@ Unsupported `op` flags:
* `LINUX_REBOOT_CMD_CAD_OFF`
* `LINUX_REBOOT_CMD_CAD_ON`
* `LINUX_REBOOT_CMD_KEXEC`
* `LINUX_REBOOT_CMD_RESTART`
* `LINUX_REBOOT_CMD_RESTART2`
* `LINUX_REBOOT_CMD_SW_SUSPEND`

View File

@ -16,3 +16,6 @@ sethostname(name, size);
// Set Network Information Service (NIS) domain name
setdomainname(name, size);
// Sleep for the specified duration
nanosleep(duration, remain);

View File

@ -4,6 +4,6 @@ reboot_magic2 = LINUX_REBOOT_MAGIC2 | LINUX_REBOOT_MAGIC2A | LINUX_REBOOT_MAGIC2
reboot(
magic = LINUX_REBOOT_MAGIC1,
magic2 = <reboot_magic2>,
op = LINUX_REBOOT_CMD_HALT | LINUX_REBOOT_CMD_POWER_OFF,
op = LINUX_REBOOT_CMD_HALT | LINUX_REBOOT_CMD_POWER_OFF | LINUX_REBOOT_CMD_RESTART,
arg
);
);

View File

@ -32,7 +32,7 @@ Therefore, it is recommended to use a Docker image to deploy the environment.
Run a TDX Docker container:
```bash
docker run -it --privileged --network=host --device=/dev/kvm asterinas/osdk:0.17.0-20251213
docker run -it --privileged --network=host --device=/dev/kvm asterinas/osdk:0.17.0-20260114
```
## Edit `OSDK.toml` for Intel TDX support
@ -50,8 +50,8 @@ For example, you can append the following TDX-specific scheme to your `OSDK.toml
supported_archs = ["x86_64"]
boot.method = "grub-qcow2"
grub.mkrescue_path = "~/tdx-tools/grub"
grub.protocol = "linux"
qemu.args = """\
grub.boot_protocol = "linux"
qemu.args = '''\
-accel kvm \
-m 8G \
-vga none \
@ -60,11 +60,12 @@ qemu.args = """\
-drive file=target/osdk/asterinas/asterinas.qcow2,if=virtio,format=qcow2 \
-monitor telnet:127.0.0.1:9001,server,nowait \
-bios /root/ovmf/release/OVMF.fd \
-object '{ \"qom-type\": \"tdx-guest\", \"id\": \"tdx0\", \"sept-ve-disable\": true, \"quote-generation-socket\": { \"type\": \"vsock\", \"cid\": \"2\", \"port\": \"4050\" } }' \
-cpu host,-kvm-steal-time,pmu=off \
-machine q35,kernel-irqchip=split,confidential-guest-support=tdx0 \
-smp 1 \
-nographic \
"""
'''
```
To choose the configurations specified by the TDX scheme over the default ones,

View File

@ -44,7 +44,7 @@ init_args = ["sh", "-l"] # <11>
initramfs = "path/to/it" # <12>
[grub] # <13>
mkrescue_path = "path/to/it" # <14>
protocol = "multiboot2" # <15>
boot_protocol = "multiboot2" # <15>
display_grub_menu = false # <16>
[qemu] # <17>
path = "path/to/it" # <18>

View File

@ -1 +1,3 @@
# Before You Contribute
This part of the Book provides guidelines for contributing to Asterinas.

View File

@ -1,10 +1,10 @@
{ disable-systemd ? "false", stage-2-hook ? "/bin/sh -l", log-level ? "error"
, console ? "hvc0", test-command ? "", extra-substituters ? ""
, extra-trusted-public-keys ? "", pkgs ? import <nixpkgs> { } }:
, console ? "hvc0", extra-substituters ? "", extra-trusted-public-keys ? ""
, config-file-name ? "configuration.nix", pkgs ? import <nixpkgs> { } }:
let
aster-kernel = builtins.path {
name = "aster-nix-osdk-bin";
path = ../../target/osdk/iso_root/boot/aster-nix-osdk-bin;
name = "aster-kernel-osdk-bin";
path = ../../target/osdk/iso_root/boot/aster-kernel-osdk-bin;
};
etc-nixos = builtins.path { path = ../etc_nixos; };
@ -16,7 +16,6 @@ let
aster-stage-2-hook = stage-2-hook;
aster-log-level = log-level;
aster-console = console;
aster-test-command = test-command;
aster-substituters = extra-substituters;
aster-trusted-public-keys = extra-trusted-public-keys;
};
@ -38,7 +37,7 @@ in pkgs.stdenv.mkDerivation {
mkdir -p $out/{bin,etc_nixos}
cp ${install_aster_nixos} $out/bin/install_aster_nixos.sh
cp -L ${aster_configuration} $out/etc_nixos/aster_configuration.nix
cp -L ${etc-nixos}/configuration.nix $out/etc_nixos/configuration.nix
cp -L ${etc-nixos}/${config-file-name} $out/etc_nixos/configuration.nix
cp -r ${etc-nixos}/modules $out/etc_nixos/modules
cp -r ${etc-nixos}/overlays $out/etc_nixos/overlays
ln -s ${aster-kernel} $out/kernel

View File

@ -33,7 +33,6 @@
(import ./overlays/podman/default.nix)
(import ./overlays/switch-to-configuration-ng/default.nix)
(import ./overlays/systemd/default.nix)
(import ./overlays/test-asterinas/default.nix)
];
# The Asterinas NixOS special options.
@ -64,11 +63,6 @@
default = "@aster-console@";
description = "The console device.";
};
test-command = lib.mkOption {
type = lib.types.str;
default = "@aster-test-command@";
description = "The test command.";
};
break-into-stage-1-shell = lib.mkOption {
type = lib.types.bool;
default = false;

View File

@ -126,7 +126,7 @@ cleanup() {
}
trap cleanup EXIT INT TERM ERR
cp $CONFIG_PATH ${BUILD_DIR}/etc/nixos
cp $CONFIG_PATH ${BUILD_DIR}/etc/nixos/configuration.nix
cp @aster-configuration@ ${BUILD_DIR}/etc/nixos/aster_configuration.nix
cp -r @aster-etc-nixos@/modules ${BUILD_DIR}/etc/nixos
cp -r @aster-etc-nixos@/overlays ${BUILD_DIR}/etc/nixos

View File

@ -1,8 +1,8 @@
{ pkgs ? import <nixpkgs> { }, test-command ? "", extra-substituters ? ""
{ pkgs ? import <nixpkgs> { }, extra-substituters ? ""
, extra-trusted-public-keys ? "", ... }:
let
installer = pkgs.callPackage ../aster_nixos_installer {
inherit test-command extra-substituters extra-trusted-public-keys;
inherit extra-substituters extra-trusted-public-keys;
};
nixos = pkgs.nixos (import "${installer}/etc_nixos/configuration.nix");
cachixPkgs = with nixos.pkgs;

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, options, ... }:
let
kernel = builtins.path {
name = "aster-nix-osdk-bin";
name = "aster-kernel-osdk-bin";
path = config.aster_nixos.kernel;
};
stage-1-init = pkgs.writeShellScript "stage-1-init" ''
@ -74,15 +74,6 @@ in {
${config.aster_nixos.stage-2-hook}
fi
'';
# Execute test-command on hvc0 console after boot if the test-command is
# not empty (for CI testing).
environment.loginShellInit =
lib.mkIf ("${config.aster_nixos.test-command}" != "") ''
if [ "$(tty)" = "/dev/hvc0" ]; then
${config.aster_nixos.test-command}
poweroff
fi
'';
# Suppress error and warning messages of systemd.
# TODO: Fix errors and warnings from systemd and remove this setting.
environment.sessionVariables = { SYSTEMD_LOG_LEVEL = "crit"; };

View File

@ -1,13 +0,0 @@
final: prev: {
test-asterinas = prev.stdenv.mkDerivation {
name = "test-asterinas";
version = "0.1.0";
src = ./.;
installPhase = ''
install -m755 -D $src/test-nix-commands.sh $out/bin/test-nix-commands
install -m755 -D $src/test-podman.sh $out/bin/test-podman
'';
};
}

View File

@ -1,25 +0,0 @@
#!/bin/sh
# SPDX-License-Identifier: MPL-2.0
set -e
# Test nix-env
nix-env -iA nixos.hello
hello
nix-env -e hello
# Test nix-shell
nix-shell -p hello --command hello
# Test nix-build
nix-build "<nixpkgs>" -A hello
./result/bin/hello
# Test nixos-rebuild
sed -i "s/environment.systemPackages = with pkgs; \[ test-asterinas \];/environment.systemPackages = with pkgs; \[ test-asterinas hello \];/" \
/etc/nixos/configuration.nix
nixos-rebuild test
# Clean the hash cache to use the hello installed by nixos-rebuild
hash -r
hello

View File

@ -1,21 +0,0 @@
#!/bin/sh
# SPDX-License-Identifier: MPL-2.0
set -e
CONTAINER_NAME=c1
IMAGE_NAME=docker.io/library/alpine
podman run --name=${CONTAINER_NAME} ${IMAGE_NAME} ls /etc \
| grep -q "^alpine-release" \
|| (echo "Test 'podman run' failed" && exit 1)
podman image ls \
| grep -q ${IMAGE_NAME} \
|| (echo "Test 'podman image ls' failed" && exit 1)
podman ps -a \
| grep -q "Exited (0)" \
|| (echo "Test 'podman ps -a' failed" && exit 1)
podman rm ${CONTAINER_NAME} || (echo "Test 'podman rm' failed" && exit 1)
echo "Test podman succeeds"

View File

@ -1,8 +1,9 @@
{ pkgs ? import <nixpkgs> { }, autoInstall ? false, test-command ? ""
, extra-substituters ? "", extra-trusted-public-keys ? "", version ? "", ... }:
{ pkgs ? import <nixpkgs> { }, autoInstall ? false, extra-substituters ? ""
, config-file-name ? "configuration.nix", extra-trusted-public-keys ? ""
, version ? "", ... }:
let
installer = pkgs.callPackage ../aster_nixos_installer {
inherit test-command extra-substituters extra-trusted-public-keys;
inherit extra-substituters extra-trusted-public-keys config-file-name;
};
configuration = {
imports = [

View File

@ -1,73 +1,73 @@
[package]
name = "aster-nix"
name = "aster-kernel"
version = "0.1.0"
edition = "2024"
edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
align_ext = { path = "../ostd/libs/align_ext" }
aster-input = { path = "comps/input" }
aster-block = { path = "comps/block" }
aster-network = { path = "comps/network" }
aster-cmdline = { path = "comps/cmdline" }
aster-console = { path = "comps/console" }
aster-framebuffer = { path = "comps/framebuffer" }
aster-softirq = { path = "comps/softirq" }
aster-logger = { path = "comps/logger" }
aster-mlsdisk = { path = "comps/mlsdisk" }
aster-time = { path = "comps/time" }
aster-virtio = { path = "comps/virtio" }
aster-rights = { path = "libs/aster-rights" }
aster-systree = { path = "comps/systree" }
aster-i8042 = { path = "comps/i8042" }
component = { path = "libs/comp-sys/component" }
controlled = { path = "libs/comp-sys/controlled" }
logo-ascii-art = { path = "libs/logo-ascii-art" }
osdk-frame-allocator = { path = "../osdk/deps/frame-allocator" }
osdk-heap-allocator = { path = "../osdk/deps/heap-allocator" }
ostd = { path = "../ostd" }
typeflags = { path = "libs/typeflags" }
typeflags-util = { path = "libs/typeflags-util" }
aster-rights-proc = { path = "libs/aster-rights-proc" }
aster-util = { path = "libs/aster-util" }
aster-bigtcp = { path = "libs/aster-bigtcp" }
atomic-integer-wrapper = { path = "libs/atomic-integer-wrapper" }
device-id = { path = "libs/device-id" }
id-alloc = { path = "../ostd/libs/id-alloc" }
int-to-c-enum = { path = "libs/int-to-c-enum" }
jhash = { path = "libs/jhash" }
cpio-decoder = { path = "libs/cpio-decoder" }
xarray = { path = "libs/xarray" }
intrusive-collections = "0.9.5"
paste = "1.0"
time = { version = "0.3", default-features = false, features = ["alloc"] }
# parse elf file
xmas-elf = "0.10.0"
# data-structures
bitflags = "1.3"
keyable-arc = { path = "libs/keyable-arc" }
# unzip initramfs
libflate = { version = "2", default-features = false }
core2 = { version = "0.4", default-features = false, features = ["alloc"] }
lending-iterator = "0.1.7"
spin = "0.9.4"
lru = "0.12.3"
log = "0.4"
bitvec = { version = "1.0", default-features = false, features = ["alloc"] }
hashbrown = "0.14"
rand = { version = "0.9.2", default-features = false, features = [
align_ext.workspace = true
aster-bigtcp.workspace = true
aster-block.workspace = true
aster-cmdline.workspace = true
aster-console.workspace = true
aster-framebuffer.workspace = true
aster-i8042.workspace = true
aster-input.workspace = true
aster-logger.workspace = true
aster-mlsdisk.workspace = true
aster-network.workspace = true
aster-rights.workspace = true
aster-rights-proc.workspace = true
aster-softirq.workspace = true
aster-systree.workspace = true
aster-time.workspace = true
aster-uart.workspace = true
aster-util.workspace = true
aster-virtio.workspace = true
atomic-integer-wrapper.workspace = true
bitflags.workspace = true
bitvec.workspace = true
cfg-if.workspace = true
component.workspace = true
const_format.workspace = true
controlled.workspace = true
core2.workspace = true
cpio-decoder.workspace = true
device-id.workspace = true
getset.workspace = true
hashbrown.workspace = true
id-alloc.workspace = true
inherit-methods-macro.workspace = true
intrusive-collections.workspace = true
int-to-c-enum.workspace = true
jhash.workspace = true
keyable-arc.workspace = true
lending-iterator.workspace = true
libflate.workspace = true
log.workspace = true
logo-ascii-art.workspace = true
lru.workspace = true
osdk-frame-allocator.workspace = true
osdk-heap-allocator.workspace = true
ostd.workspace = true
ostd-pod.workspace = true
paste.workspace = true
rand = { workspace = true, features = [
"small_rng",
"std_rng",
] }
inherit-methods-macro = { git = "https://github.com/asterinas/inherit-methods-macro", rev = "98f7e3e" }
getset = "0.1.2"
takeable = "0.2.2"
cfg-if = "1.0"
spin.workspace = true
takeable.workspace = true
time.workspace = true
typeflags.workspace = true
typeflags-util.workspace = true
xarray.workspace = true
xmas-elf.workspace = true
zerocopy.workspace = true
[target.x86_64-unknown-none.dependencies]
tdx-guest = { version = "0.2.2", optional = true }
tdx-guest = { version = "0.2.4", optional = true }
[target.riscv64imac-unknown-none-elf.dependencies]
riscv = { version = "0.15.0", features = ["s-mode"] }
@ -76,9 +76,9 @@ riscv = { version = "0.15.0", features = ["s-mode"] }
loongArch64 = "0.2.5"
[features]
all = ["cvm_guest"]
cvm_guest = ["dep:tdx-guest", "ostd/cvm_guest", "aster-virtio/cvm_guest"]
default = ["cvm_guest"]
coverage = ["ostd/coverage"]
cvm_guest = ["dep:tdx-guest", "ostd/cvm_guest", "aster-virtio/cvm_guest"]
# By default we use the Sv48 address translation mode.
riscv_sv39_mode = ["ostd/riscv_sv39_mode"]

View File

@ -1,21 +1,23 @@
[package]
name = "aster-block"
version = "0.1.0"
edition = "2024"
edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
spin = "0.9.4"
ostd = { path = "../../../ostd" }
align_ext = { path = "../../../ostd/libs/align_ext" }
id-alloc = { path = "../../../ostd/libs/id-alloc" }
int-to-c-enum = { path = "../../libs/int-to-c-enum" }
aster-util = { path = "../../libs/aster-util" }
component = { path = "../../libs/comp-sys/component" }
device-id = { path = "../../libs/device-id" }
log = "0.4"
bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] }
align_ext.workspace = true
aster-util.workspace = true
bitvec.workspace = true
component.workspace = true
device-id.workspace = true
id-alloc.workspace = true
int-to-c-enum.workspace = true
log.workspace = true
ostd.workspace = true
ostd-pod.workspace = true
spin.workspace = true
zerocopy.workspace = true
[lints]
workspace = true

View File

@ -9,8 +9,8 @@ use int_to_c_enum::TryFromInt;
use ostd::{
Error,
mm::{
DmaDirection, DmaStream, FrameAllocOptions, HasSize, Infallible, USegment, VmReader,
VmWriter,
HasSize, Infallible, USegment, VmReader, VmWriter,
dma::DmaStream,
io_util::{HasVmReaderWriter, VmReaderWriterResult},
},
sync::{SpinLock, WaitQueue},
@ -394,7 +394,9 @@ pub struct BioSegment {
#[derive(Debug)]
struct BioSegmentInner {
/// Internal DMA slice.
// TODO: The direction is currently `FromAndToDevice`. Implement compile-time checking.
dma_slice: Slice<Arc<DmaStream>>,
direction: BioDirection,
/// Whether the segment is allocated from the pool.
from_pool: bool,
}
@ -444,13 +446,10 @@ impl BioSegment {
let bio_segment_inner = target_pool(direction)
.and_then(|pool| pool.alloc(nblocks, offset, len))
.unwrap_or_else(|| {
let segment = FrameAllocOptions::new()
.zeroed(false)
.alloc_segment(nblocks)
.unwrap();
let dma_stream = DmaStream::map(segment.into(), direction.into(), false).unwrap();
let dma_stream = DmaStream::alloc_uninit(nblocks, false).unwrap();
BioSegmentInner {
dma_slice: Slice::new(Arc::new(dma_stream), offset..offset + len),
direction,
from_pool: false,
}
});
@ -463,10 +462,11 @@ impl BioSegment {
/// Constructs a new `BioSegment` with a given `USegment` and the bio direction.
pub fn new_from_segment(segment: USegment, direction: BioDirection) -> Self {
let len = segment.size();
let dma_stream = DmaStream::map(segment, direction.into(), false).unwrap();
let dma_stream = DmaStream::map(segment, false).unwrap();
Self {
inner: Arc::new(BioSegmentInner {
dma_slice: Slice::new(Arc::new(dma_stream), 0..len),
direction,
from_pool: false,
}),
}
@ -497,10 +497,12 @@ impl BioSegment {
&self.inner.dma_slice
}
/// Returns the inner VM segment.
/// Returns the inner DMA object.
///
/// Note that the slicing will be ignored. This is only for testing.
#[cfg(ktest)]
pub fn inner_segment(&self) -> &USegment {
self.inner.dma_slice.mem_obj().segment()
pub fn inner_dma(&self) -> &Arc<DmaStream> {
self.inner.dma_slice.mem_obj()
}
}
@ -531,11 +533,7 @@ impl Drop for BioSegmentInner {
impl BioSegmentInner {
/// Returns the bio direction.
fn direction(&self) -> BioDirection {
match self.dma_slice.mem_obj().direction() {
DmaDirection::FromDevice => BioDirection::FromDevice,
DmaDirection::ToDevice => BioDirection::ToDevice,
_ => unreachable!(),
}
self.direction
}
}
@ -569,13 +567,7 @@ impl BioSegmentPool {
/// The new pool will be allocated and mapped for later allocation.
pub fn new(direction: BioDirection) -> Self {
let total_blocks = POOL_DEFAULT_NBLOCKS;
let pool = {
let segment = FrameAllocOptions::new()
.zeroed(false)
.alloc_segment(total_blocks)
.unwrap();
DmaStream::map(segment.into(), direction.into(), false).unwrap()
};
let pool = DmaStream::alloc_uninit(total_blocks, false).unwrap();
let manager = SpinLock::new(PoolSlotManager {
occupied: BitArray::ZERO,
min_free: 0,
@ -650,6 +642,7 @@ impl BioSegmentPool {
};
let bio_segment = BioSegmentInner {
dma_slice,
direction: self.direction,
from_pool: true,
};
Some(bio_segment)
@ -706,15 +699,6 @@ fn target_pool(direction: BioDirection) -> Option<&'static Arc<BioSegmentPool>>
}
}
impl From<BioDirection> for DmaDirection {
fn from(direction: BioDirection) -> Self {
match direction {
BioDirection::FromDevice => DmaDirection::FromDevice,
BioDirection::ToDevice => DmaDirection::ToDevice,
}
}
}
/// Checks if the given offset is aligned to sector.
pub fn is_sector_aligned(offset: usize) -> bool {
offset.is_multiple_of(SECTOR_SIZE)

View File

@ -5,7 +5,7 @@ use core::{
ops::{Add, Sub},
};
use ostd::{Pod, const_assert};
use ostd::const_assert;
/// The block index used in the filesystem.
pub type Bid = BlockId<BLOCK_SIZE>;

View File

@ -31,6 +31,8 @@
#![feature(step_trait)]
extern crate alloc;
#[macro_use]
extern crate ostd_pod;
pub mod bio;
mod device_id;

View File

@ -1,7 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
use device_id::DeviceId;
use ostd::{Pod, mm::VmIo};
use ostd::mm::VmIo;
use ostd_pod::Pod;
use crate::{
BlockDevice, BlockDeviceMeta, SECTOR_SIZE,
@ -228,7 +229,7 @@ fn parse_gpt(device: &Arc<dyn BlockDevice>) -> Vec<Option<PartitionInfo>> {
for j in 0..entries_per_sector {
let entry_offset = j * gpt.size_of_partition_entry as usize;
let entry = GptEntry::from_bytes(&buf[entry_offset..entry_offset + entry_size]);
let entry = GptEntry::from_first_bytes(&buf[entry_offset..entry_offset + entry_size]);
if entry.is_valid() {
partitions.push(Some(PartitionInfo::Gpt(entry)));
} else {

View File

@ -1,15 +1,15 @@
[package]
name = "aster-cmdline"
version = "0.1.0"
edition = "2024"
edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
component = { path = "../../libs/comp-sys/component" }
ostd = { path = "../../../ostd" }
log = "0.4"
spin = "0.9.4"
component.workspace = true
log.workspace = true
ostd.workspace = true
spin.workspace = true
[lints]
workspace = true

View File

@ -1,16 +1,16 @@
[package]
name = "aster-console"
version = "0.1.0"
edition = "2024"
edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ostd = { path = "../../../ostd" }
component = { path = "../../libs/comp-sys/component" }
spin = "0.9.4"
font8x8 = { version = "0.2.5", default-features = false, features = [ "unicode" ] }
int-to-c-enum = { path = "../../libs/int-to-c-enum" }
component.workspace = true
font8x8.workspace = true
int-to-c-enum.workspace = true
ostd.workspace = true
spin.workspace = true
[lints]
workspace = true

View File

@ -8,10 +8,7 @@ use font8x8::UnicodeFonts;
/// A bitmap font.
///
/// Currently it's mainly used to draw texts on the framebuffer console. See
/// [`FramebufferConsole::set_font`].
///
/// [`FramebufferConsole::set_font`]: crate::FramebufferConsole::set_font
/// Currently it's mainly used to draw texts on the framebuffer console.
#[derive(Debug)]
pub struct BitmapFont {
width: usize,

View File

@ -1,17 +1,17 @@
[package]
name = "aster-framebuffer"
version = "0.1.0"
edition = "2024"
edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ostd = { path = "../../../ostd" }
component = { path = "../../libs/comp-sys/component" }
aster-console = { path = "../console" }
aster-input = { path = "../input" }
log = "0.4"
spin = "0.9.4"
aster-console.workspace = true
aster-input.workspace = true
component.workspace = true
log.workspace = true
ostd.workspace = true
spin.workspace = true
[lints]
workspace = true

View File

@ -213,8 +213,7 @@ impl FbConsoleHandler {
}
KeyCode::CapsLock => {
if key_status == KeyStatus::Pressed {
let new_caps = !self.caps_lock.load(Ordering::Relaxed);
self.caps_lock.store(new_caps, Ordering::Relaxed);
self.caps_lock.fetch_xor(true, Ordering::Relaxed);
}
return;
}

View File

@ -1,18 +1,18 @@
[package]
name = "aster-i8042"
version = "0.1.0"
edition = "2024"
edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
component = { path = "../../libs/comp-sys/component" }
ostd = { path = "../../../ostd" }
aster-cmdline.workspace = true
aster-input.workspace = true
bitflags = "2.5"
log = "0.4"
spin = "0.9.4"
aster-input = { path = "../input" }
aster-cmdline = { path = "../cmdline" }
component.workspace = true
ostd.workspace = true
log.workspace = true
spin.workspace = true
[lints]
workspace = true

Some files were not shown because too many files have changed in this diff Show More