Commit Graph

271 Commits

Author SHA1 Message Date
Jianfeng Jiang 33a7da9991 Fix typos in API documentation 2024-06-09 22:57:14 +08:00
Jianfeng Jiang 6e59617fc7 Add missing docs in aster-frame 2024-06-09 22:57:14 +08:00
Jianfeng Jiang a93f922a25 Add description and license for align-ext 2024-06-09 22:57:14 +08:00
Jianfeng Jiang e192579405 Fix broken link in documentation 2024-06-09 22:57:14 +08:00
YanWQ-monad e8c8c027c5 Declare `kernel_task_entry` as `extern "C"` 2024-06-07 16:59:29 +08:00
Ruihan Li e0c6c29481 Fix memory leak of `Task` structures 2024-06-04 14:47:18 +08:00
Ruihan Li ff83ce7667 Deny `dead_code` and `unused_variables` at crate level 2024-06-04 10:25:45 +08:00
Ruihan Li 9107a1771e Allow `dead_code` and `unused_variables` at file level 2024-06-04 10:25:45 +08:00
Zhang Junyang 232e62b053 Redo segment with `Arc` rather than creating `SegmentHeadMeta` 2024-06-03 22:16:02 +08:00
Zhang Junyang 3fa3d7f15a Revised page table activation and drop management 2024-06-03 22:16:02 +08:00
Zhang Junyang 7095b37e7e Refactor the source structure in `aster_frame::mm` 2024-06-03 22:16:02 +08:00
Zhang Junyang e8595b95fe Add missing safety explanations for the page table node 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 03a39c94ca Refactor the representation of page metadata 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 141fbeaf0c Optimize the page table implementation using the frame metadata
This PR also refactored the page table cursor, distinguishing `Cursor` from `CursorMut`, and split
a lot of functions to reduce dynamic condition checking.

There are also other sanitizations performed, including refactoring PTE's `is_huge` API to `is_last`,
hardening tracked mapping checks, and making `VmFrame` any size.
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 c84efe7a90 Introduce CPU clock and CPU timer 2024-06-03 20:03:46 +08:00
Chen Chengjun f1c1011f2b Set PROCESSOR cpu-local 2024-06-03 20:03:46 +08:00
Ruihan Li 0bafc0f18a Add unit tests for `WaitQueue` and `Waiter` 2024-06-03 15:45:56 +08:00
Ruihan Li a664f1a9fc Revise the public APIs of `WaitQueue` 2024-06-03 15:45:56 +08:00
anbo 140640c5d6 Modify CR3 solely during context switching 2024-06-03 15:37:11 +08:00
jellllly420 e1480f94ee fix: enable timely delivery of POSIX signals while busy-looping 2024-06-01 20:08:11 +08:00
Fabing Li 34e9d71fe4 Add condition variable implementation 2024-05-31 20:25:31 +08:00
mag1cian 6e9516daa4 Fix 'early_println' with no arguments 2024-05-31 16:09:53 +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
YanWQ-monad fa7d0a787f Extract x86-specific trap handler code 2024-05-31 11:41:02 +08:00
Ruihan Li 28b66c1c8c Avoid creating linear mappings with the SHARED flag set 2024-05-30 20:45:59 +08:00
Zhang Junyang 56a4909211 Revert `fast_copy` and `fast_copy_nonoverlapping` in the framework
This reverts commit 657d6719c7.
2024-05-28 22:35:25 +08:00
YanWQ-monad 2636bb0838 Extract x86-specific `TaskContext` 2024-05-24 16:57:35 +08:00
Ruihan Li 69abc09f5a Add missing TLB flushes to `VmSpace` 2024-05-23 10:34:58 +08:00
Ruihan Li 83b88229a3 Unify headers of safety comments 2024-05-22 13:21:16 +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
LI Qing 657d6719c7 Add the `fast_copy` and `fast_copy_nonoverlapping` in frame 2024-05-21 09:48:43 +08:00
Chen Chengjun 2002db5481 Add wait_until_or_cancelled API to WaitQueue 2024-05-20 16:09:27 +08:00
Chen Chengjun 91152bceed Add a small patch to CpuLocal 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 ccc4e6ec6b Move whole kernel ELF to VMA 2024-05-15 21:31:09 +08:00
Ruihan Li dbc234ada6 Rename `cx_ptr` to `ctx_ptr` 2024-05-14 10:00:59 +08:00
Ruihan Li 47fe10f17b Avoid poorly chosen variable names 2024-05-14 10:00:59 +08:00
Ruihan Li a215cb54d9 Use `UnsafeCell` to store `UserContext` 2024-05-14 10:00:59 +08:00
Ruihan Li 83c2aba0b0 Use `SpinLock` to protect `PROCESSOR` 2024-05-13 19:39:50 +08:00
LI Qing 81cca42205 Refine `WaitQueue` with fast path to return early 2024-05-11 11:11:12 +08:00
Zhang Junyang 035e12a4bd Identify the page table free-reuse-then-read problem and feature gate it 2024-05-10 19:07:05 +08:00
Zhang Junyang 679e5dac68 Remove the VA to PA API and tidy up kernel space 2024-05-10 19:07:05 +08:00
Zhang Junyang cf5cfb3475 Enable global page and add a global TLB flushing function 2024-05-10 19:07:05 +08:00