Commit Graph

248 Commits

Author SHA1 Message Date
Zhang Junyang 327e991477 Rename boot-wrapper to bzimage-setup 2024-01-02 07:21:36 +08:00
Zhang Junyang 302b547a0d Bump version to 0.3.0 2024-01-02 07:21:36 +08:00
Zhang Junyang 85d4cfdeb7 Do mapping in the wrapper 2024-01-02 07:21:36 +08:00
Zhang Junyang e922eaa428 Fix errors raised by the new clippy 2024-01-02 07:21:36 +08:00
Zhang Junyang 6c50c10001 Remove unnecessary #[allow(unused)] 2024-01-02 07:21:36 +08:00
Zhang Junyang 9d2be39b83 Add unit test for linux-boot-params 2024-01-02 07:21:36 +08:00
Zhang Junyang 432f0c34b0 Bring both EFI and legacy to test 2024-01-02 07:21:36 +08:00
Zhang Junyang 487e0cdd15 Recognize kernel memory regions in the Linux boot path 2024-01-02 07:21:36 +08:00
Zhang Junyang e71c2701d6 Rename trojan to wrapper and add docs 2024-01-02 07:21:36 +08:00
Zhang Junyang 12d01ca1e4 Update image and Rust toolchain 2024-01-02 07:21:36 +08:00
Zhang Junyang 97323f612b Fix boot phase mappings 2024-01-02 07:21:36 +08:00
Zhang Junyang ebbe451cc4 Apply relocations to enable vtable 2024-01-02 07:21:36 +08:00
Zhang Junyang 32e62080ce Add EFI stub 2024-01-02 07:21:36 +08:00
Zhang Junyang acf4a057d9 Make trojan compile in 64-bit mode 2024-01-02 07:21:36 +08:00
Zhang Junyang 953ff66fcc Introduce the boot trojan 2024-01-02 07:21:36 +08:00
LI Qing 9473889c6b Add Ext2 fs and basic bio layer 2023-12-28 04:54:48 +08:00
Yuke Peng 1616f2d32c Change block device trait 2023-12-28 04:54:48 +08:00
Jianfeng Jiang 7b7e3c4b7a Rename the path of dependent crates 2023-12-26 11:49:24 +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
Ruihan Li 14ee9c2dc7 Fix missing kernel/initramfs memory regions 2023-12-26 06:32:01 +08:00
Ruihan Li 7278589aa2 Prettify bootloader code 2023-12-26 06:32:01 +08:00
Ruihan Li af81741f23 Workaround for QEMU BUG that causes CI to hang 2023-12-14 11:28:24 +08:00
Yuke Peng f1a7c767d2 Fix IoMem read and write bugs 2023-12-14 11:26:37 +08:00
Chen Chengjun 715072b9f3 Implement a high precision gettime based on tsc 2023-12-06 19:31:19 +08:00
Chen Chengjun ba08895fc3 Fix the frequecy bug caused by IOAPIC 2023-12-06 19:31:19 +08:00
Chuandong Li 5aa3124e66 Make the upgrade method of read-write locks atomic 2023-12-06 10:40:11 +08:00
Chuandong Li 07dd0fbd38 Fix the misuse of spin::mutex 2023-12-06 10:22:03 +08:00
Chuandong Li 0fd7a473da Support streaming dma mappings 2023-11-29 13:39:54 +08:00
Chuandong Li ceaba95fa0 Support coherent dma mappings 2023-11-29 13:39:54 +08:00
徐启航 576578baf4 Improve aquisition logic 2023-11-24 15:43:57 +08:00
徐启航 3790efb0d9 Fix unexpected unlock of mutexes 2023-11-24 15:43:57 +08:00
Ruihan Li 9e09196043 Timeout list should be accessed with IRQ disabled 2023-11-23 16:36:53 +08:00
Yuke Peng 232888982c Rename TrapInformation 2023-11-23 09:15:37 +08:00
Yuke Peng edd808bd3d Refactor drivers 2023-11-23 09:15:37 +08:00
Yuke Peng d809eca81d Rename print in framework to early_print 2023-11-23 09:15:37 +08:00
Yuke Peng 34e66a51d9 Reimplement print in std 2023-11-23 09:15:37 +08:00
Chuandong Li e9544d489f Rename some confusing booleans 2023-11-23 07:10:18 +08:00
Chen Chengjun 5cc9f250dd Implement a guard page for the kernel stack 2023-11-13 08:43:14 +08:00
Zhang Junyang c776954dfc Print backtrace when there is uncaught panic 2023-11-09 13:22:34 +08:00
Zhang Junyang ec3daca5fd Add ktest whitelist support 2023-11-09 13:22:34 +08:00
Zhang Junyang 8eb1e06c2a Implement should_panic expectation and refactor ktest 2023-11-09 13:22:34 +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
LI Qing d7cc52c615 Update the version of pod 2023-11-09 03:38:37 +08:00
Yuke Peng 0e7f279bd6 Enable CI for MicroVM 2023-11-08 13:50:10 +08:00
LI Qing 4c72f5b7fa Add VmSegment and rewrite the vm allocation code with VmAllocOptions 2023-11-08 06:31:21 +08:00
LI Qing b0b25f9282 Add VmReader and VmWriter 2023-11-08 06:31:21 +08:00
Chen Chengjun cf1d4faab4 Fix a minor bug that lead to a crash in release mode 2023-11-06 08:55:48 +08:00
Yuke Peng 0c7df54513 Impl virtio-mmio transport 2023-10-30 09:39:23 +08:00
Yuke Peng 4d927fed19 Impl virtio-mmio bus 2023-10-30 09:39:23 +08:00
Yuke Peng 0a6aeb4a36 Enable IOApic 2023-10-30 09:39:23 +08:00
Yuke Peng eeac55e2e5 Refactor console 2023-10-30 09:39:23 +08:00
Zhang Junyang 0a17d90532 Polish namings and interfaces of linux boot 2023-10-26 12:05:12 +08:00
Zhang Junyang a532340c65 Implement linux x86 32bit legacy boot protocol 2023-10-26 12:05:12 +08:00
Zhang Junyang 9d0e0bbc70 Fix the rust setup machine state 2023-10-26 12:05:12 +08:00
Zhang Junyang 052fc795a5 Successfully entered setup rust entrypoint 2023-10-26 12:05:12 +08:00
Zhang Junyang 922fbd0c91 Minor fix to get entrypoint in the right place 2023-10-26 12:05:12 +08:00
Yuke Peng aeea333945 Split kernel mode and user mode page table 2023-10-16 17:52:15 -05:00
Zhang Junyang fb884cd038 Fallback to regular paging for the boot pagetable 2023-10-13 02:24:31 -05:00
Zhang Junyang 503252e8e8 Fix multiboot entry in UEFI boot 2023-10-12 14:38:36 -05:00
Zhang Junyang cdc2b960dc Switch to EFI boot and use official release for QEMU and GDB 2023-10-12 14:38:36 -05:00
Zhang Junyang aea8f38dc1 Implement boot setup and loader utils 2023-10-12 14:38:36 -05:00
Zhang Junyang d0c84e0b6f Add protected mode sub-crate for Linux boot setup 2023-10-12 14:38:36 -05:00
Zhang Junyang 7d5295ab25 Refactor build system, boot and added Linux Boot facilities 2023-10-12 14:38:36 -05:00
Jianfeng Jiang 0d6f6f001c Refactor the implementation 2023-10-10 16:52:40 -05:00
Jianfeng Jiang bd6a4d34ff Support timeout for WaitQueue 2023-10-10 16:52:40 -05:00
Chuandong Li 7419f6b56b Add the bottom half mechanism of workqueue 2023-10-09 18:08:15 -05:00
Chuandong Li e2b4302620 Add basic preemptive scheduling 2023-10-09 18:08:15 -05:00
Yuke Peng d9fcb486c0 Support microvm boot option 2023-09-28 11:52:33 +08:00
Yuke Peng 66a8b404c2 Support multiboot legacy protocol 2023-09-28 11:52:33 +08:00
Hsy-Intel e8a2779bca Polish trap handler code 2023-09-28 03:47:55 +08:00
Hsy-Intel f2b2c20967 Handle other CPU exceptions & use trait method 2023-09-28 03:47:55 +08:00
Hsy-Intel c90f757b86 Polish tdx-guest crate and Jinux VE handler 2023-09-28 03:47:55 +08:00
Hsy-Intel 82518955d7 Abstract the virtual_exception_handler function. 2023-09-28 03:47:55 +08:00
Hsy-Intel 4f0df44b29 Add tdx early init and ve handler functions 2023-09-28 03:47:55 +08:00
Hsy-Intel d7710207bb make tdcall and tdvmcall public and polish code 2023-09-28 03:47:55 +08:00
Hsy-Intel 12fc074f56 Add tdx-guest crate 2023-09-28 03:47:55 +08:00
Jianfeng Jiang 9ca64c281e Fix clippy and compiler warings 2023-09-05 18:42:06 +08:00
Yuke Peng dbf5a423b1 Rename IrqAllocateHandle and move alloc functions 2023-09-03 13:36:05 +08:00
Yuke Peng 7d5e67e368 Refactor Virtio 2023-09-03 13:36:05 +08:00
Yuke Peng df42397cea Remove jinux-pci and hide PCI ports 2023-09-03 13:36:05 +08:00
Yuke Peng d7bf193bf1 Change IoMem creation to unsafe 2023-09-03 13:36:05 +08:00
Yuke Peng df81434088 Fix pci framework bugs 2023-09-03 13:36:05 +08:00
Yuke Peng 739eb30138 Implement Clone for IrqAllocateHandle 2023-09-03 13:36:05 +08:00
Chuandong Li 6d101c5b6d Use Mutex and RwLock in jinux-frame for jinux-std 2023-09-02 17:06:39 +08:00
Yuke Peng df7bd65e70 TLB flush when modifying page table 2023-08-22 19:57:20 +08:00
Jianfeng Jiang ddb7be9296 Refactor current net codes 2023-08-15 20:54:10 +08:00
Zhang Junyang 7b390d9f8a Runner should return error if qemu itself fails 2023-08-14 10:45:01 +08:00
Yuke Peng f0f498e46a Support TSC-Deadline mode APIC timer 2023-08-09 22:14:35 +08:00
Yuke Peng c38e4f0800 Replace InFramePtr with SafePtr 2023-08-09 11:57:53 +08:00
Chen Chengjun c321e411f6 Fix the bug caused by opt-level=1 2023-08-08 21:30:23 +08:00
Zhang Junyang acfbc7efdc Fix multiple issues in the initproc path 2023-08-04 11:37:34 +08:00
Zhang Junyang f674874e91 Rename eval to syscall test and fix return value 2023-08-04 11:37:34 +08:00
Zhang Junyang bb03be3cbd Refactor the build package to absorb the script 2023-08-04 11:37:34 +08:00
Zhang Junyang 2e4b0432e0 Implement split instead of using heavy regex 2023-08-04 11:37:34 +08:00
Zhang Junyang 807c8355c0 Implement kernel command line with init configuring 2023-08-04 11:37:34 +08:00
Zhang Junyang 69cbfc72f5 Refactor boot and add placeholder kcmdline struct 2023-08-04 11:37:34 +08:00
Zhang Junyang eb8eb440b3 Initialize FxsaveArea with zero 2023-08-04 11:37:12 +08:00
Zhang Junyang 8fc4fa6f10 Fix for new format checks in the latest toolchain 2023-08-04 11:37:12 +08:00
Zhang Junyang 5cf624f9ac Update toolchain to nightly 08-01 2023-08-04 11:37:12 +08:00
Zhang Junyang e6f13a0612 Fix or workaround 4 errors from linter 2023-08-04 11:37:12 +08:00
Zhang Junyang 901cbebe44 Fix spurious bitflags usage 2023-08-04 11:37:12 +08:00
Yuke Peng 054f13e32f Support IOMMU page fault reporting 2023-08-01 20:49:04 +08:00
Chuandong Li 9cb759efa2 Add a runtime check for scheduler with spin locks 2023-07-25 12:56:06 +08:00
Zhang Junyang c6145b450a Removed boot protocol configuring 2023-07-24 16:31:38 +08:00
Zhang Junyang cad808f05c Align the usable regions in the frame allocator 2023-07-24 16:31:38 +08:00
Zhang Junyang 5012779e38 Fix memory region glob re-export 2023-07-24 16:31:38 +08:00
Zhang Junyang e3adb6e482 Fix params of truncate 2023-07-24 16:31:38 +08:00
Zhang Junyang b5e04ea5ad Fix boot documentations and comments 2023-07-24 16:31:38 +08:00
Zhang Junyang c932878dd1 Give multiboot2 entry magic a name 2023-07-24 16:31:38 +08:00
Zhang Junyang 41d8e4228f Rename Rust entrypoint 2023-07-24 16:31:38 +08:00
Zhang Junyang e96884b72d Minor fixes, use small pages to make it work 2023-07-24 16:31:38 +08:00
Zhang Junyang 47a51eb423 Adapt Multiboot2 and switch from Limine to Grub2 2023-07-24 16:31:38 +08:00
Yuke Peng 49f2750108 Rename mmio to IoMem 2023-07-24 15:56:22 +08:00
Yuke Peng a6dcdf6952 Implement the PCI bus framework 2023-07-24 15:56:22 +08:00
Yuke Peng 6d621dc4ef Fix vaddr to paddr error 2023-07-21 20:14:56 +08:00
Jianfeng Jiang 3a3cb7cd15 Implement copy for VmFrame 2023-07-21 10:57:04 +08:00
Jianfeng Jiang 38ee2cafcd Inherit vmo at page granularity 2023-07-21 10:57:04 +08:00
Jianfeng Jiang c452fc35c6 Implement rescue for heap allocator 2023-07-20 13:29:48 +08:00
Yuke Peng a47b98b160 Support IOMMU 2023-07-13 22:57:56 +08:00
Yuke Peng 829575b3a6 Upgrade POD and trapframe 2023-07-13 22:57:56 +08:00
Yuke Peng c21c25a7d5 Refactor page table 2023-07-13 22:57:56 +08:00
Jianfeng Jiang a5d719579d Remove redundant is_finished flag 2023-07-12 00:05:29 +08:00
LI Qing 3600a3a439 Add support for chmod, fchmod, fchmodat 2023-07-09 11:07:42 +08:00
Jianfeng Jiang 9f1680d0f3 Only add task when waking up a sleeping task 2023-07-07 19:12:07 +08:00
LI Qing d692c102ae Support compressed initramfs image 2023-07-03 14:51:10 +08:00
Chuandong Li fba4a9405e Support the wait queue that allows sleeping 2023-07-03 13:22:44 +08:00
Chuandong Li 9edcbe743d Implement the `RwMutex` based on blocking 2023-07-03 13:22:44 +08:00
Chuandong Li 9dbbe1f5c9 Implement the `RwLock` based on spinning 2023-07-03 13:22:44 +08:00
Chuandong Li b3a7899428 Re-implement mutex with waiter queue 2023-07-03 13:22:44 +08:00
Chuandong Li 25b45326ab Optimize the atomic ordering in spin lock 2023-07-03 13:22:44 +08:00
Chuandong Li 7401eee455 Reimplement the DisableLocalIrqGuard 2023-07-03 13:22:44 +08:00
Chuandong Li 78de1af348 Update spin lock users to lock_irq_disabled() 2023-07-03 13:22:44 +08:00
Chuandong Li ba4121cd6a Add spin lock without disabling local irq 2023-07-03 13:22:44 +08:00
Jianfeng Jiang 8e199f46ef Import inherit-methods-macro from seperate repo 2023-06-28 13:22:15 +08:00
Yuke Peng 893b174dc9 Support x2APIC 2023-06-27 20:52:41 +08:00
Jianfeng Jiang 0e8b2aff7b Make heap allocator interrupt safe 2023-06-27 19:45:01 +08:00
Jianfeng Jiang 288374ee09 Fix dead lock in canonical mode 2023-06-27 19:45:01 +08:00
Jianfeng Jiang 7803d9037e Add uninit option for VmAllocOption 2023-06-03 21:10:53 +08:00
Jianfeng Jiang 2985cdced6 Replace Mutex with Spinlock in tty to avoid deadlock 2023-05-31 20:59:01 +08:00
Jianfeng Jiang d96fe31e36 Fix typos and add utils 2023-05-31 11:50:50 +08:00
Yuke Peng 39380f09b9 Use volatile read/write for the MMIO 2023-05-30 21:32:25 +08:00
Yuke Peng 358f44b3c0 Implement VmIo for smart pointers to VmIo 2023-05-30 21:32:25 +08:00
Yuke Peng 42ecbe1b04 Change physical address accees to MMIO 2023-05-06 16:51:51 +08:00
Yuke Peng 5656805520 Impl MMIO access method 2023-05-06 16:51:51 +08:00
Jianfeng Jiang 271a16d492 Reorganize the codebase 2023-04-10 14:49:39 +08:00