Commit Graph

2245 Commits

Author SHA1 Message Date
bjorn3 cd761ee679 Handle all cases in foreach_addrsp 2025-09-26 23:28:01 +02:00
bjorn3 12f908b1ba Take sighandler frames into account during the integrity check 2025-09-26 23:28:01 +02:00
bjorn3 4c85131e36 Always take syscall_head/tail into account during the integrity check
Previously it wouldn't be taken into account if currently used by the
kernel.
2025-09-26 23:28:01 +02:00
bjorn3 ede9a47f9c Move .bss and .data tests to inline asm
If .bss is not properly cleared or .data is incorrectly cleared, there
is no way to tell what will happen if we try to run Rust code.
2025-09-25 09:46:17 -06:00
bjorn3 ac35b7984a Fix kernel debugger 2025-09-25 17:26:31 +02:00
Jeremy Soller 0203ad750a Fix compilation on aarch64/riscv64gc 2025-09-23 13:46:44 -06:00
Jeremy Soller 4526acc259 Drop comment about fixed multi_core issues 2025-09-23 13:09:32 -06:00
Jeremy Soller b0d5fa0993 Copy all higher PML4 entries in setup_new_utable (fixes some AMD CPUs) 2025-09-23 13:09:12 -06:00
Jeremy Soller 89c182cca1 Restore return in percpu::switch_arch_hook 2025-09-23 13:08:34 -06:00
Jeremy Soller b6a5245556 Require passing loopback test for hard-coded serial 2025-09-23 11:33:37 -06:00
Jeremy Soller 6ce2101cf4 Do not mark soc ranges as device memory 2025-09-23 10:31:34 -06:00
Jeremy Soller 5dc6f7c3ba lock ordering 2025-09-22 07:48:48 -06:00
bjorn3 e7358e3e5b Deduplicate a bunch of things that use KernelArgs between archs 2025-09-20 19:10:19 +02:00
bjorn3 3f385ba79d Unify KernelArgs type between architectures 2025-09-20 19:10:19 +02:00
bjorn3 c35c17c67e Merge display.rs into debug.rs 2025-09-20 17:59:19 +02:00
bjorn3 b36deffa61 Replace scrolling with wraparound in graphical debug
Inspired by how Haiku does printing for its kernel debugger, this commit
gets rid of the scrolling when the bootlog reaches the end of the screen
and instead wraps around to the start of the screen. Between the last
written line and the first visible written line there is always a blank
line to provide visual separation.

Getting rid of the scrolling significantly simplifies the implementation
of graphical debug and removes the need for double buffering for
performance as we no longer need to read back the framebuffer when
scrolling which is very expensive on write-combining memory like the
framebuffer.
2025-09-20 17:15:02 +02:00
bjorn3 84ac36ca2f Inline DebugDisplay::write_char 2025-09-20 15:42:08 +02:00
bjorn3 3db8bf878e Remove workaround for Meteor Lake having an AP with hardware cpu id 0 2025-09-20 15:33:08 +02:00
bjorn3 f58bcd584e Separate logical and hardware cpu ids 2025-09-20 15:33:08 +02:00
bjorn3 3a47c3becc Move most HPET logs to the trace log level
This significantly reduces the amount of boot logs produced by the
kernel by default on x86. With this the full kernel boot logs now fit on
a single screen on my system.
2025-09-20 15:21:54 +02:00
bjorn3 99b626845d Cleanup after removing INIT_THREAD 2025-09-20 15:21:38 +02:00
Jeremy Soller 229a5de6ff Remove INIT_THREAD 2025-09-19 20:30:26 -06:00
Jeremy Soller 7abe4e1051 Remove slab allocator 2025-09-19 20:29:53 -06:00
Jeremy Soller eb69d37323 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: bjorn3 <4397-bjorn3@users.noreply.gitlab.redox-os.org>
2025-09-19 06:43:19 -06:00
Elle Rhumsaa 8255e74ffd fixup: scheme: remove unnecessary braces
Removes unnecessary braces to fix compilation error.

Signed-off-by: Elle Rhumsaa <elle@weathered-steel.dev>
2025-09-19 06:43:19 -06:00
Elle Rhumsaa 0022bd448c dtb: remove allocation for in-memory DTB
Replaces the `Once<Vec<u8>>` with `Once<&'static [u8]>` to avoid an
unnecessary allocation.

Adds some basic documentation.

Signed-off-by: Elle Rhumsaa <elle@weathered-steel.dev>
2025-09-19 06:43:19 -06:00
bjorn3 68526b2af5 Use naked asm for riscv exception handler 2025-09-18 17:29:50 +02:00
bjorn3 081efd6cfa Allocate IDT for APs on the BSP and statically allocate BSP IDT
This allows them to be immediately installed by kstart/kstart_ap without
having to wait for the page tables to be set up correctly. This removes
the initial IDT.
2025-09-17 21:03:36 +02:00
bjorn3 e81db007b7 Couple of cleanups to the IDT handling 2025-09-17 21:03:36 +02:00
bjorn3 742a7f4492 Remove Option around IDTs HashMap 2025-09-17 21:03:36 +02:00
Jeremy Soller 2bf580b260 Reimplement iostat 2025-09-16 20:39:06 -06:00
bjorn3 25d526e9a1 Inline load_segments 2025-09-16 19:58:56 +02:00
bjorn3 647c87c5a0 Allocate PCR for APs on the BSP
This allows them to be immediately installed by kstart_ap without having
to wait for the page tables to be set up correctly. This removes the
initial GDT.
2025-09-16 19:57:31 +02:00
bjorn3 dbe25b78e3 Make it possible to change KernelArgsAp without changing the trampolines 2025-09-16 19:33:07 +02:00
bjorn3 019564ee0e Statically allocate PCR for the BSP 2025-09-15 22:01:15 +02:00
bjorn3 4884d749af Make PercpuBlock const constructable 2025-09-15 19:00:03 +02:00
bjorn3 3329a41121 Unify set_tss_stack and set_userspace_io_allowed signatures between x86 and x86_64 2025-09-15 18:37:27 +02:00
bjorn3 05e344bd9e Unify tss alignment method between x86 and x86_64 2025-09-15 18:23:29 +02:00
bjorn3 9a14f9a80d Unify gdt handling between x86 and x86_64 2025-09-14 20:30:57 +02:00
bjorn3 d1c7177038 Remove unused macro 2025-09-14 20:21:46 +02:00
bjorn3 200aeac2ba Reduce visibility of a couple of idt things 2025-09-14 19:10:09 +02:00
bjorn3 d3b17177b2 Avoid allocating during panics and infer kernel image size without explicitly storing it 2025-09-14 13:11:13 +02:00
bjorn3 9f71f02532 Reduce indentation in stack_trace 2025-09-13 21:34:02 +02:00
bjorn3 6334977090 Inline symbol_trace into strack_trace 2025-09-13 21:34:02 +02:00
bjorn3 30bbafdfa4 Use the object crate for panic backtraces
This increases the kernel image size by about 16kb, but in return
significantly simplifies things.
2025-09-13 21:34:02 +02:00
bjorn3 ad4ea619e8 Fix interrupt race condition on arm64 and riscv64 2025-09-13 20:29:32 +02:00
bjorn3 9e37ccaae8 Fix enable_and_halt on arm64
I accidentally used nop instead of wfi
2025-09-13 19:07:01 +02:00
bjorn3 83b4538d7c Merge two asm blocks
There is no guarantee they will be atomic otherwise
2025-09-13 18:55:16 +02:00
bjorn3 61db2b2ad5 Use core::hint::spin_loop() where possible 2025-09-13 18:55:16 +02:00
bjorn3 711ea9a4ed Move system76_ec::init() into serial::init() 2025-09-13 18:55:16 +02:00