4lDO2
5ecba176f4
Compile on aarch64.
2024-03-16 17:49:31 +01:00
4lDO2
776a140212
Fix rax being overwritten, and compile on i686.
2024-03-16 17:49:31 +01:00
4lDO2
239bd317e9
Fix signal ordering wrt syscall return.
2024-03-16 17:49:31 +01:00
4lDO2
13bc46a30b
WIP: Implement scheme call cancelation.
2024-03-16 17:49:31 +01:00
4lDO2
e57573c428
Ensure signals can't start new contexts too early.
2024-03-16 17:49:30 +01:00
4lDO2
e012d6cfca
Fix altstack calculation typo.
2024-03-16 17:49:30 +01:00
4lDO2
c7da5a438c
Replace incorrect interrupt IA32-isms.
...
The code incorrectly documents and states that SS and RSP are
conditionally pushed, based on whether the privilege level changed. This
is correct on IA-32, but wrong on x86-64.
2024-03-16 17:49:30 +01:00
4lDO2
6d1e436d29
Remove some dead code.
2024-03-16 17:49:30 +01:00
4lDO2
0cf2ce632a
Only call sig handler in switch, not after EINTR.
2024-03-16 17:49:30 +01:00
4lDO2
6bf8238fb1
Unset procmask for kmain.
2024-03-16 17:49:30 +01:00
4lDO2
5ac0be7ec1
Start with full procmask, fix signal delivery.
2024-03-16 17:49:30 +01:00
4lDO2
5336cbd9e5
Improve signal interfaces and implementation.
2024-03-16 17:49:30 +01:00
4lDO2
10256b331c
Ensure only the kernel can return EINTR.
2024-03-16 17:49:26 +01:00
bjorn3
04f689cee7
Accept a single RSDP from the bootloader
2024-03-15 11:43:27 +01:00
bjorn3
08bb2537b5
Remove the deprecated bootstrap_entry field from KernelArgs
2024-03-15 10:59:58 +01:00
bjorn3
502016815d
Avoid unaligned access in the XsdtIter
...
The pointers in the XSDT table are only 4 byte aligned.
2024-03-15 10:53:45 +01:00
bjorn3
d5e1188b8e
Remove doc feature
2024-03-15 09:55:27 +01:00
bjorn3
672e36f401
Force the zero page of the kernel to be part of a segment
...
This will be necessary for limine and likely multiboot support. See the
comment in the linker scripts.
2024-03-14 21:22:13 +01:00
bjorn3
b5f94a5a2e
Fix bug in the unmapping code
...
Previously trying to funmap an address after the start of the grant
would result in an overflow only caught when compiling the kernel with
debug assertions enabled.
2024-03-14 12:15:43 +01:00
bjorn3
e81113349c
Fix get_page_info for frames in the last memory section
2024-03-13 19:41:24 +01:00
bjorn3
ecbc2b7e8d
Directly read the bootstrap entry point from the initfs header
2024-03-11 14:26:08 +01:00
bjorn3
fb66a8628f
Use PAGE_SIZE instead of hard coded constant
2024-03-10 21:39:55 +01:00
bjorn3
616c7d4398
Load the bootstrap blob at 4096 instead of 0
...
This way the NULL page can stay unmapped and the bootstrap code can
avoid UB when reading the initfs header (which is at the start of the
bootstrap code.
2024-03-10 21:14:46 +01:00
4lDO2
ec58d6c541
Compile on aarch64 as well.
2024-03-05 10:40:54 +01:00
4lDO2
d38d8b66bd
Fix i686 compilation.
2024-03-05 10:26:57 +01:00
4lDO2
b35c9d1e62
Properly free phys-contiguous grants, TLB-delayed.
2024-03-04 19:03:01 +01:00
4lDO2
4e392d05e4
Delay cow() dealloc until after TLB shootdown.
2024-03-04 19:03:01 +01:00
4lDO2
fa3e2a24d4
Optimize TLB flushing.
2024-03-04 19:03:01 +01:00
4lDO2
716f147cd4
Fix synchronization so acid tlb succeeds!
2024-03-04 19:03:01 +01:00
4lDO2
846d914a55
Improve synchronization.
2024-03-04 19:03:01 +01:00
4lDO2
1f8d7bc67c
Always check shootdown reqs when locking addrsp.
2024-03-04 19:03:01 +01:00
4lDO2
3a592b9079
Use regular non-NMI IPIs for TLB shootdown.
2024-03-04 19:03:00 +01:00
4lDO2
3a915c7fd5
Fix lock/guard mismatch, move r#move to wrapper.
2024-03-04 19:03:00 +01:00
4lDO2
b5efaceb51
Fix more synchronization.
2024-03-04 19:03:00 +01:00
4lDO2
098cdd6067
Fix flusher, currently only with -smp 1
2024-03-04 19:03:00 +01:00
4lDO2
79381249a2
Implement a TLB shootdown draft.
2024-03-04 19:03:00 +01:00
4lDO2
6bf90f9eee
Build the foundation for TLB shootdown.
2024-03-04 19:03:00 +01:00
4lDO2
156017a25d
Refactor: wrap RwLock<AddrSpace>.
2024-03-04 19:03:00 +01:00
4lDO2
749df4c869
Fail successfully with todo!
2024-03-04 19:03:00 +01:00
4lDO2
bb30530ea0
Track which CPUs are using any given AddrSpace.
2024-03-04 19:03:00 +01:00
4lDO2
0c6c857012
Improve LogicalCpu{Id,Set}, make set atomic.
...
Technically there should be an atomic and nonatomic set type, but perf
should be the same, as the nonatomic one would only be used when setting
the sched_affinity.
2024-03-04 19:02:56 +01:00
Jeremy Soller
15cbb40802
Format
2024-02-28 12:10:17 -07:00
Jeremy Soller
8390277eb2
Fix affinity alignment
2024-02-28 12:10:06 -07:00
bjorn3
e08eadf64a
Don't pass CallerCtx in file_op_generic
...
It isn't used by any of the callers.
2024-02-25 21:05:21 +01:00
bjorn3
24187b5f80
Move set_tss_stack call to switch_to
2024-02-25 20:10:49 +01:00
bjorn3
96f1a14115
Remove some dead code
2024-02-25 20:06:22 +01:00
bjorn3
52f4aaf741
Avoid unaligned access for serial over x86 io port
2024-02-25 18:36:41 +01:00
bjorn3
782ec87f27
Fix UB in the locking code of context switching
...
The spin crate considers it UB to call force_write_unlock while there is
a threads trying to obtain a read lock on the same rwlock.
This also switches to the spinning_lot crate for the context rwlock as
it has support for a write guard keeping a reference to the rwlock using
an Arc instead of a reference.
2024-02-25 17:07:41 +01:00
bjorn3
449abb8925
Share bootstrap_mem between all archs
2024-02-25 15:53:04 +01:00
bjorn3
e23f0ed66b
Share idt.rs between x86 and x86_64
2024-02-25 15:49:29 +01:00