Commit Graph

1489 Commits

Author SHA1 Message Date
Ruihan Li 9107a1771e Allow `dead_code` and `unused_variables` at file level 2024-06-04 10:25:45 +08:00
Zhang Junyang 7095b37e7e Refactor the source structure in `aster_frame::mm` 2024-06-03 22:16:02 +08:00
Zhang Junyang 3579d88aa6 Fortify the metadata memory model and adjust the `Page` casting APIs 2024-06-03 22:16:02 +08:00
Zhang Junyang 14e1b1a9fc Rename various concepts related to memory management 2024-06-03 22:16:02 +08:00
Zhang Junyang 39aa31a69d Remove the `VmIO` implementation of `VmSpace` 2024-06-03 22:16:02 +08:00
Zhang Junyang 69d464fc6b Use metadata to track `VmFrame`s
In this commit, the frame metadata storage schema is implemented. The bootstrap process is refactored
and a boot page table is introduced to perform early stage metadata mapping. The metadata is then used
to track `VmFrame`s instead of the former `Arc` approach.
2024-06-03 22:16:02 +08:00
Chen Chengjun c5ec2e181e Add itimer-related syscalls 2024-06-03 20:03:46 +08:00
Chen Chengjun 13fd173b24 Enable Timer to set an absolute time 2024-06-03 20:03:46 +08:00
Chen Chengjun e952a16954 Support more clock ids 2024-06-03 20:03:46 +08:00
Chen Chengjun c84efe7a90 Introduce CPU clock and CPU timer 2024-06-03 20:03:46 +08:00
Ruihan Li a664f1a9fc Revise the public APIs of `WaitQueue` 2024-06-03 15:45:56 +08:00
anbo 901bccadfe Add syscall rt_sigpending 2024-06-03 15:30:52 +08:00
Weijie Liu 2ecca7af6b Add dummy syscall sched_getaffinity 2024-06-01 20:10:09 +08:00
jellllly420 e1480f94ee fix: enable timely delivery of POSIX signals while busy-looping 2024-06-01 20:08:11 +08:00
jellllly420 5a23de1932 fix: fully use ThreadOptions while building new kernel thread 2024-06-01 20:08:11 +08:00
Fabing Li 34e9d71fe4 Add condition variable implementation 2024-05-31 20:25:31 +08:00
Jianfeng Jiang c04fd0c9a0 Add syscall sendfile 2024-05-31 16:10:46 +08:00
Jianfeng Jiang 14ada9000a Add read_at and write_at for FileLike and InodeHandle 2024-05-31 16:10:46 +08:00
Chen Chengjun e22d78f04d Enable tasklet mechanism 2024-05-31 16:05:58 +08:00
Chen Chengjun 558248a070 Enable softirq mechanism 2024-05-31 16:05:58 +08:00
Chen Chengjun c02eacd50c Use deny(unsafe_code) instead of forbid(unsafe_code) 2024-05-31 16:05:58 +08:00
skpupil 4101d8328a Add syscall creat 2024-05-31 15:19:17 +08:00
HaiQiu1998 85e292ce7e Fix typo 2024-05-23 09:02:47 +08:00
Jianfeng Jiang 07fbbcfd8c Add syscall clone3 2024-05-21 19:22:13 +08:00
YanWQ-monad a5707b4ddc Extract OS-specific part from `UserContextApi` 2024-05-21 09:53:37 +08:00
Chen Chengjun 2002db5481 Add wait_until_or_cancelled API to WaitQueue 2024-05-20 16:09:27 +08:00
Chen Chengjun 2d17177cb5 Re-implement the alarm syscall 2024-05-20 16:09:27 +08:00
Chen Chengjun b226928349 Remove the timer module from the aster-frame and adjust the related code 2024-05-20 16:09:27 +08:00
Chen Chengjun d019de29f9 Add abstractions for Clock and Timer 2024-05-20 16:09:27 +08:00
YanWQ-monad 0d5131c822 Extract x86-specific syscall dispatch to arch/x86 2024-05-17 21:29:04 +08:00
YanWQ-monad 82220748c0 Use a seedable RNG instead of `getrandom` crate 2024-05-17 10:28:18 +08:00
Jianfeng Jiang b11e6d2d62 Add syscall accept4 2024-05-16 19:17:38 +08:00
Jianfeng Jiang ea25157790 Support mmap shared anonymous memory 2024-05-16 19:13:32 +08:00
Jianfeng Jiang 89b21ba3b4 Add syscall rt_sigsuspend 2024-05-16 19:10:04 +08:00
Chen Chengjun 25b7007ffa Improve the read/write efficiency of Vmo 2024-05-16 18:58:51 +08:00
LI Qing f4ea23b72c Revise the pages() method in the page cache to only return a reference 2024-05-16 18:54:39 +08:00
LI Qing 770a123415 Change the return value of dup() for Vmo<Rights> 2024-05-16 18:54:39 +08:00
LI Qing e6b0fd8aa3 Optimize the RamFs to reduce the use of redundant locks 2024-05-16 18:54:39 +08:00
LI Qing 27bcece750 Optimize the `ThreadStatus` to be lock-free 2024-05-16 18:54:39 +08:00
LI Qing 0eaa6e637d Optimize the `SigQueues` to return early without lock 2024-05-16 18:54:39 +08:00
Zhenchen Wang 8bcadee540 Extract dentry.rs and mount.rs to path module, rename Dentry and DentryMnt and check usage of pub.
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2024-05-16 13:30:52 +08:00
Zhenchen Wang 8d18a12385 Refactor DentryMnt and fix some issues
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2024-05-16 13:30:52 +08:00
plucky 60fa4d104a Rename struct Path to struct DentryMnt
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2024-05-16 13:30:52 +08:00
plucky 6d486c6c01 Add struct Path for VFS
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2024-05-16 13:30:52 +08:00
Jianfeng Jiang 078f9a8891 Add syscall eventfd and eventfd2 2024-05-15 21:52:17 +08:00
Ruihan Li 4e1d98a323 Poll interfaces at the right time 2024-05-15 18:32:02 +08:00
Jianfeng Jiang 5189f889a3 Support Channel sending data which does not implement Copy 2024-05-13 20:04:09 +08:00
Zhang Junyang 989970429a Refactor the definition of page properties and permissions 2024-05-10 19:07:05 +08:00
Zhang Junyang ef1ab72ebe Let page table own frames and remove MemorySet 2024-05-10 19:07:05 +08:00
Zhang Junyang 82bdadf754 Add a PTE extension mechanism 2024-05-10 19:07:05 +08:00
Zhang Junyang 24a868a670 Implement an efficient ranged page table 2024-05-10 19:07:05 +08:00
Chuandong Li a6055bb092 Fix a deadlock issue in ramfs 2024-05-10 11:05:41 +08:00
Chen Chengjun c3d0c59041 Fix the logics for the coarse resolution clock id in VDSO. 2024-05-09 17:34:10 +08:00
Chen Chengjun ff3ff0a598 Fix the potential bugs of read and write in Vmar 2024-05-09 17:23:55 +08:00
Zhang Junyang d1990869ae Make ID allocator a separate crate and use it in the frame 2024-05-09 14:35:12 +08:00
LI Qing 8f3b1f8ddf Reduce some redundant usage of `current!` and `current_thread!` 2024-05-09 14:33:21 +08:00
LI Qing 98a2e623e2 Avoid computation of log message arguments in syscall handler 2024-05-09 14:33:21 +08:00
Zhang Junyang da5873e990 Allow implementations for dynamically borrowed `RwMutex` guards 2024-05-09 10:41:21 +08:00
Zhang Junyang d15b4d9115 Allow dynamically borrowed mutex guard 2024-05-09 10:41:21 +08:00
Zhang Junyang 11e4984df2 Allow dynamically borrowed `RwLock` guards 2024-05-09 10:41:21 +08:00
Fabing Li c2d09675b3 Rename FileDescripter to FileDesc 2024-05-09 10:23:46 +08:00
Chen Chengjun 0594a73ac9 Improve the efficiency of unmap in VmMappingInner 2024-05-08 16:05:18 +08:00
Ruihan Li ab87f473c4 Remove pointless error codes in `unregister_observer` 2024-05-08 15:48:55 +08:00
StanPlatinum 2b67dee1fc Add syscall epoll_pwait 2024-05-06 14:17:58 +08:00
Chen Chengjun 1435dd0896 Add syscall nanosleep 2024-05-06 14:15:24 +08:00
Jianfeng Jiang cd3faa8123 Inherit HasDaddr for reference type 2024-04-29 20:33:57 +08:00
Jianfeng Jiang a482c87696 Remove add_buf from VirtQueue 2024-04-29 20:33:57 +08:00
Jianfeng Jiang 2256f6ae8a Extend Safeptr to support DmaStream 2024-04-29 20:33:57 +08:00
Jianfeng Jiang 345ab8f838 Add write_vals for VmIo 2024-04-29 20:33:57 +08:00
Jianfeng Jiang abb377b695 Replace SpinLock with RwLock in driver callbacks 2024-04-29 20:33:57 +08:00
Jianfeng Jiang cd1575bc6d Refactor virtio drivers with DMA APIs 2024-04-29 20:33:57 +08:00
Hsy-Intel 5e127b2da0 Remove local tdx-guest crate 2024-04-29 10:13:04 +08:00
Chuandong Li e77026c30e Fix some performance issue in `VmMapping` 2024-04-26 17:09:00 +08:00
LI Qing c875201c3f Fix deadlocks that may arise after converting virtio-blk to async
The IRQ part of the driver must NOT share a SpinLock with
the normal part of the driver unless the SpinLock is acquired
with IRQ disabled in the task context.
2024-04-26 14:36:46 +08:00
LI Qing 349d7baa24 Fix the algorithm error for recycling descriptors in `VirtQueue` 2024-04-26 14:36:46 +08:00
LI Qing b7131e721c Modify the virtio-blk to async 2024-04-26 14:36:46 +08:00
Yingdi Shan efa75a2f31 Improve the performance of page_cache by using fine-grained lock and allow page discarding 2024-04-26 11:37:55 +08:00
LI Qing c44b2b35ff Fix the issue about acquiring `Mutex` after a `RwLock` in ramfs 2024-04-26 11:31:50 +08:00
Ruihan Li 698e748150 Set socket errors after connecting 2024-04-25 18:40:08 +08:00
Ruihan Li 27c5c27fd0 Implement non-blocking `connect` 2024-04-25 18:40:08 +08:00
Ruihan Li 9211061181 Add proper IO events for unbound sockets 2024-04-25 18:40:08 +08:00
Ruihan Li 8628543067 Implement `(un)register_observer` for TCP/UDP 2024-04-25 18:40:08 +08:00
Jianfeng Jiang 29ebf8e60c Support reading argv and envp from init stack 2024-04-25 18:27:08 +08:00
YanWQ-monad 4f575e2028 Fix `writev` fault when `io_vec.len` is 0 2024-04-22 15:16:46 +08:00
Jianfeng Jiang c778e0c07c Remove redundant empty page in init stack 2024-04-22 15:15:15 +08:00
Fabing Li c335873d12 Enable kernel mode unit tests in kernel threads 2024-04-22 13:57:22 +08:00
Chuandong Li 57cb922253 Increase user stack size 2024-04-22 10:40:46 +08:00
Fabing Li dac41e9a2f Support T:?Sized as type parameter for Mutex, SpinLock, RwLock, and RwMutex 2024-04-17 08:51:59 +08:00
Ruihan Li 92a9f5616e Fix error codes in `bind`, `listen`, and `accept` 2024-04-12 14:39:54 +08:00
Ruihan Li 346887ace5 Fix error codes in UDP `sendto` and `recvfrom` 2024-04-12 14:39:54 +08:00
Ruihan Li 00cfdf86c8 Fix error codes in TCP `sendto` and `recvfrom` 2024-04-12 14:39:54 +08:00
Ruihan Li 51080c1925 Fix error codes in `get{sock,peer}name` 2024-04-12 14:39:54 +08:00
Ruihan Li 8b094454aa Use `From<IpEndpoint>` for `SockAddr` (not `TryFrom`) 2024-04-12 14:39:54 +08:00
LI Qing c3c6b0c19d Use Dma APIs for virtio-block driver 2024-04-11 15:22:18 +08:00
Jianfeng Jiang d8a841f88a Add DmaBuf for DMA-capable memory areas 2024-04-11 15:22:18 +08:00
LI Qing a60a8ad3e1 Support big file for Ext2 2024-04-10 13:44:12 +08:00
Ruihan Li bd8be26b30 Access the console device table with IRQ disabled 2024-04-10 12:14:28 +08:00
StanPlatinum e4fd51bc6f sigretrun --> sigreturn 2024-04-09 22:06:57 +08:00
Chen Chengjun afc4bf7520 Modify the behavior of mapping segment vmo 2024-04-08 18:54:46 +08:00
Chen Chengjun 33c8727a13 Introduce XArray and refactor the COW mechanism of Vmo 2024-04-08 18:54:46 +08:00
Jianfeng Jiang 10690063eb Reimplement reading cstring from user space 2024-04-01 17:31:15 +08:00
Jianfeng Jiang a18fc9eb25 Write time to user only if addr is not zero 2024-04-01 13:58:18 +08:00
Yingdi Shan 679a8d8d98 Add asynchronous I/O supports for page cache 2024-03-27 17:57:41 +08:00
Fabing Li 30a2553a70 Fix observer missing in socket for mongoose support 2024-03-27 11:06:17 +08:00
Jianfeng Jiang a2e9b0aaae Make background polling thread sleep 2024-03-25 18:32:11 +08:00
Fabing Li b450eef166 Add potential integer overflow check among Framework APIs 2024-03-25 16:55:54 +08:00
Zhenchen Wang ed0752aacc Add syscall chroot
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>

Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2024-03-25 16:34:35 +08:00
Chen Chengjun f924eb3694 Adding split functionality to VmMapping for optimizing page permission management 2024-03-23 09:45:29 +08:00
Jianfeng Jiang fad1e42e56 Remove WNOHANG from regression test 2024-03-21 17:03:36 +08:00
Ruihan Li c88d10524c Remove `AlwaysSome` 2024-03-21 10:49:47 +08:00
Yingdi Shan 650c7dfbad Add exFAT file system 2024-03-19 16:26:55 +08:00
Zhang Junyang 52f07458f7 Understanding memory space and move higher the stack 2024-03-19 16:19:54 +08:00
Zhang Junyang b49e11a25e Fix all doc warnings 2024-03-17 19:12:33 +08:00
Zhang Junyang 132d36bf20 Fix a huge immediate allocation in loading 2024-03-17 17:49:24 +08:00
Ruihan Li 595c6ab288 Replace `Poisoned` state by `takeable` crate 2024-03-14 21:22:44 +08:00
Ruihan Li a10d04c5f9 Remove `Arc`s in TCP and UDP states 2024-03-14 21:22:44 +08:00
Jianfeng Jiang 3f402d2d88 Add syscall alarm 2024-03-14 17:26:23 +08:00
LI Qing 3de5c42afd Support the close-on-exec file descriptor flag 2024-03-08 11:44:27 +08:00
LI Qing e0d92b5203 Add support for converting from `VmFrame` to `VmSegment` 2024-03-07 10:56:20 +08:00
LI Qing 437ab804f3 Add support for setpriority and getpriority 2024-03-04 09:47:44 +08:00
Jianfeng Jiang a51b3c7076 Format OSDK documentation 2024-03-01 13:41:49 +08:00
Zhang Junyang f415585dff Fix workspace clippy usage 2024-02-28 16:30:48 +08:00
Zhang Junyang 7eac2772d0 Gone with x86_64-custom 2024-02-28 16:30:48 +08:00
Zhang Junyang e3c227ae06 Refactor project structure 2024-02-28 16:30:48 +08:00
Zhang Junyang f97d0f1260 Implement OSDK functionalities and opt-in OSDK for asterinas 2024-02-28 16:30:48 +08:00
Jianfeng Jiang ab03ef0fe8 Rename aster-std to aster-nix 2024-02-06 10:43:40 +08:00
Jianfeng Jiang faaa4438d6 License rust and c source files 2024-01-18 08:22:58 +08:00
Jianfeng Jiang 99f6765ced Rename jinux to asterinas in documentation and code 2023-12-26 11:49:24 +08:00
Jianfeng Jiang 93781df27b Rename crates from jinux-* to aster-* 2023-12-26 11:49:24 +08:00
Yuke Peng d809eca81d Rename print in framework to early_print 2023-11-23 09:15:37 +08:00
Zhang Junyang 45a6b2f46c Implement should_panic for ktest and clear the codebase 2023-11-09 13:22:34 +08:00
Zhang Junyang bb0560530f Enable usermode unit test for specific crates 2023-11-09 13:22:34 +08:00
Zhang Junyang b8818bb740 Add ktest framework 2023-11-09 13:22:34 +08:00
Yuke Peng 7d5e67e368 Refactor Virtio 2023-09-03 13:36:05 +08:00
Zhang Junyang 47a51eb423 Adapt Multiboot2 and switch from Limine to Grub2 2023-07-24 16:31:38 +08:00
Jianfeng Jiang 9137ef434f Use docker as dev environment 2023-07-19 11:28:31 +08:00
LI Qing 902b0421c3 Use bootloader to load initramfs 2023-05-25 14:59:49 +08:00
Tate, Hongliang Tian 7e1584fca9 Update the README to describe code organization 2023-04-17 13:11:47 +08:00
Jianfeng Jiang 271a16d492 Reorganize the codebase 2023-04-10 14:49:39 +08:00