Commit Graph

2646 Commits

Author SHA1 Message Date
4lDO2 283ada82a0 WIP: Remove SYS_CLONE (to be done in userspace). 2022-07-27 10:52:03 +02:00
4lDO2 563121596d Fix running on multi_core.
Turns out the problem all along was that the ActivePageTable was never
dropped in usermode_bootstrap. So as soon as any other hardware thread
tried to do page table business, it deadlocked!
2022-07-27 10:51:45 +02:00
4lDO2 6e5015dcab WIP: Add necessary interfaces for setuid/setgid. 2022-07-27 10:51:45 +02:00
4lDO2 37f9b292f1 Add kfmap to fix properly reobtaining grants. 2022-07-27 10:51:45 +02:00
4lDO2 de28cc4918 Add a Scheme supertrait for kernel-only methods. 2022-07-27 10:51:45 +02:00
4lDO2 31c4bc8a1c Remove kernel support for fmap_old and funmap_old. 2022-07-27 10:51:45 +02:00
4lDO2 23f49414bd Fix phys offset, lock grants correctly. 2022-07-27 10:51:45 +02:00
4lDO2 15b029de36 Fix everything all the way to booting to desktop. 2022-07-27 10:51:45 +02:00
4lDO2 e6e1348072 Implement exec, and change UserGrant allocator. 2022-07-27 10:51:44 +02:00
4lDO2 f7f722f81c Don't use identity mapping for ACPI.
This is so that any process can use pointers to ACPI tables, since they
now point to the universally-accessible KERNEL_OFFSET+physaddr virtual
addresses.
2022-07-27 10:51:44 +02:00
4lDO2 846318e716 WIP: Attempt implementing fexec in userspace. 2022-07-27 10:51:43 +02:00
4lDO2 67edfbfc42 Remove the unused USER_HEAP_PML4. 2022-07-27 10:50:53 +02:00
4lDO2 9462df03e7 Add support for unmapping parents.
Currently, this uses a relatively naive method of simply scanning the
512 entries for the PRESENT flag. But, unless the optimizer cannot, it
can be reduced to calculating the bitwise OR of every entry and then
checking that.

If this turns out to be too slow, which it might be when unmapping lots
of pages, then we can (1) either fall back to using a counter like the
old paging code did, or even better (2) use the now-1:1 grants tree to
check if it became empty. Putting the grants code in RMM might be
suboptimal, so instead we can add "unmap_range" and have the kernel
paging code take the offset of the next grant, if any, and then possibly
unmap entire P1s/P2s/P3s -- whatever is in the page tables within that
range.

Note that I am fairly certain that method (1) was the cause of the
visually notorious orbital memory corruption bug.
2022-07-27 10:49:49 +02:00
4lDO2 229ae5da40 Add remaining interfaces to user RMM for user mem. 2022-07-27 10:49:49 +02:00
4lDO2 efc67a2012 Use wrapped flags for PageEntry. 2022-07-27 10:49:49 +02:00
4lDO2 fad6afa7d8 Flush on Drop, unless explicitly ignored. 2022-07-27 10:49:49 +02:00
4lDO2 7a209c83c9 Implement Debug for X8664Arch. 2022-07-27 10:49:49 +02:00
4lDO2 c847b1e2a8 Implement FrameAllocator for mutable refs of impls. 2022-07-27 10:49:49 +02:00
4lDO2 2f16dddf25 Add a page flusher trait. 2022-07-27 10:49:49 +02:00
Jeremy Soller 76d29bac78 Update rmm 2022-07-26 20:16:47 -06:00
Jeremy Soller 0944b17983 Add initial x86 32-bit support 2022-07-26 20:13:55 -06:00
Jeremy Soller ec284ca8e3 Update rust-toolchain 2022-07-26 19:01:42 -06:00
Jeremy Soller ac38e62398 Update syscall 2022-07-26 15:30:51 -06:00
Jeremy Soller b5a9301706 Map live disk only if not already mapped 2022-04-26 12:01:55 -06:00
Jeremy Soller 65bbd50416 Update kernel version to match syscall version 2022-04-26 08:28:05 -06:00
Jeremy Soller e88e7d6df1 Fix HPET on real hardware with better debugging 2022-04-25 15:08:09 -06:00
Jeremy Soller 6f83a0800a Set graphical_debug by default 2022-04-25 08:47:10 -06:00
Jeremy Soller 6e98736c94 Do not map live disk twice 2022-04-25 08:43:51 -06:00
Jeremy Soller 7205dd7463 Unmap xAPIC page if already mapped 2022-04-12 20:17:27 -06:00
Jeremy Soller 8f06672153 Merge branch 'external-initfs' into 'master'
External initfs

See merge request redox-os/kernel!192
2022-04-11 21:09:08 +00:00
4lDO2 df37b1f634 External initfs 2022-04-11 21:09:08 +00:00
Jeremy Soller dc9e6eaf0c Merge branch 'clone_grant_using_fmap_v2' into 'master'
Fix "clone grant using fmap"

See merge request redox-os/kernel!193
2022-04-11 20:19:41 +00:00
4lDO2 4d7da495f5 Fix "clone grant using fmap"
This does the same as the previous MR, but fixes the issue where the
parent process got the mapping (and at the wrong address) and not the
child process.
2022-04-11 21:31:36 +02:00
4lDO2 e72fd5a0e4 Fix a kernel deadlock in empty().
For more information, see https://gitlab.redox-os.org/4lDO2/kernel/-/commit/b3b5d1b864eec030d53ccd2ab907c68958f140aa
2022-04-09 13:38:59 +02:00
Jeremy Soller 87b3bef06c Revert "Merge branch 'clone_grant_using_fmap' into 'master'"
This reverts merge request !190
2022-03-30 14:54:49 +00:00
Jeremy Soller 37ebef2d35 Merge branch 'pipe_list_const_fn' into 'master'
Move more of `pipe:`'s initialization to compile time.

See merge request redox-os/kernel!182
2022-03-30 13:54:27 +00:00
Jeremy Soller cbc2902852 Merge branch 'context_list_const_fn' into 'master'
Pre-initialize the context list at compile time.

See merge request redox-os/kernel!181
2022-03-30 13:53:57 +00:00
Jeremy Soller c5c5b33b6a Merge branch 'clone_grant_using_fmap' into 'master'
Clone grant using fmap

See merge request redox-os/kernel!190
2022-03-30 13:53:08 +00:00
4lDO2 b9c34b3c05 Merge branch 'update-toolchain-2022' into 'master'
Update to latest toolchain.

See merge request redox-os/kernel!191
2022-03-27 09:17:09 +00:00
4lDO2 51e339c973 Update rmm and syscall. 2022-03-24 15:55:16 +01:00
Jeremy Soller 507f7ccd4a Merge branch 'update-toolchain-2022' into 'master'
Update to latest toolchain.

See merge request redox-os/rmm!5
2022-03-23 18:06:11 +00:00
4lDO2 a5f4e9a52a Update syscall. 2022-03-19 22:09:17 +01:00
4lDO2 8644f82b48 Remove unused Xargo.toml. 2022-03-19 22:09:03 +01:00
4lDO2 6255bea143 Update to latest toolchain.
Multi-core is slightly broken when using the latest version of spin
(0.9.2). I believe this is because Once used to do SeqCst loads/stores
everywhere, which might have made any possible data race much harder to
come by.
2022-03-12 17:10:36 +01:00
Jeremy Soller 80376a95dc Improve graphical debug performance 2022-03-08 07:36:01 -07:00
Jeremy Soller 150717f18e Enable local apic error interrupt on all processors 2022-03-07 13:56:46 -07:00
Jeremy Soller b62496f50e Debug HPET init 2022-03-07 13:56:17 -07:00
4lDO2 e2648005ba Update to latest toolchain. 2022-03-06 11:34:22 +01:00
Jeremy Soller 7e2e7b8c21 Log reasons why HPET not used 2022-03-02 08:43:11 -07:00
Jeremy Soller ae3bdea4bc Update raw-cpuid 2022-03-01 18:12:06 -07:00