Commit Graph

31 Commits

Author SHA1 Message Date
vasilito 0f3840a5b5 absorb: 7 orphaned kernel patches re-applied (Phase 1.0A)
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the kernel
fork was carrying only 21 of 45 patches in local/patches/kernel/.
The other 24 patches' content was silently missing from the fork
working tree, even though their .patch files were preserved.

This commit re-applies 7 patches that genuinely still apply
cleanly. The other 17 patches in the orphan list had hunks that
were already partially present in the fork (conservative audit
flagged them as orphan but the changes were material and only
partially diverged) or no longer apply (file was restructured
upstream). After this commit, the kernel fork reflects the
intended Red Bear work for:

- P1-memory-map-overflow: stack-guard on startup memory map
- P3-eventfd-kernel: scheme support for eventfd fd-table ops
- P5-context-mod-sched: context-switch optimization (mod.rs)
- P8-msi-foundation: MSI/MSI-X driver foundation (src/arch/x86_shared/device/msi.rs)
- P8-msi: device-level MSI plumbing (vector.rs)
- P9-proc-lock-ordering: scheme/proc lock ordering fix
- redox: Makefile patch

Untracked files msi.rs and vector.rs created by patch application.
mtn/ tree and proc.rs.orig cleaned up (leftovers from absolute-path
patch context lines).
2026-07-12 01:28:23 +03:00
vasilito 9493db389a kernel: merge-fix — restore upstream scheduler fields, NUMA init, ordered lock try_write_arc
Merge resolution artifacts fixed:
- context.rs: restore EEVDF scheduler fields (vtime, vd, rem_slice, is_active, queue_key)
- context.rs: restore Status::is_dead() method and cmp::Reverse import
- context.rs: restore pub const CONTEXT_NAME_CAPAC
- memory.rs: restore AddrSpaceSwitchReadGuard struct
- percpu.rs: restore new_addrsp_guard field
- ordered.rs: restore try_write_arc method
- startup/memory.rs: return BumpAllocator instead of calling init_mm internally
- acpi/mod.rs: restore fadt/facs module declarations, slit/srat from upstream
2026-07-11 13:16:54 +03:00
vasilito 7aa2a165df Merge remote-tracking branch 'upstream/master' into kernel-0.3.0
# Conflicts:
#	src/acpi/mod.rs
#	src/acpi/rsdt.rs
#	src/acpi/rxsdt.rs
#	src/acpi/srat/aarch64.rs
#	src/acpi/xsdt.rs
#	src/arch/x86_shared/start.rs
#	src/context/mod.rs
#	src/context/switch.rs
#	src/main.rs
#	src/memory/mod.rs
#	src/numa.rs
#	src/scheme/sys/mod.rs
#	src/startup/mod.rs
2026-07-11 11:31:19 +03:00
R Aadarsh bfbbec47a9 Create seperate free lists for each NUMA memory regions 2026-07-08 21:33:02 +05:30
vasilito ca67b1da37 0.3.0: converge kernel onto upstream master
- Rebase all Red Bear kernel changes onto upstream master (4d5d36d4).
- Update version to 0.5.12+rb0.3.0 and add Red Bear author attribution.
- Switch redox_syscall direct dependency to local fork path (../syscall).
- Bump rust-toolchain.toml to nightly-2026-05-24.
- Regenerate Cargo.lock for +rb0.3.0 suffixes and path deps.
2026-07-06 18:43:52 +03:00
R Aadarsh cb88ed59a2 Parse ACPI tables for NUMA information without allocating from the heap 2026-07-03 20:19:46 +05:30
R Aadarsh a2a3df33c6 Split acpi::init to perform two stage initialisation 2026-07-01 10:36:07 -06:00
bjorn3 654ee6ca3e size_of and align_of are part of the prelude nowadays 2026-04-09 15:23:34 -06:00
bjorn3 bbb9d98570 Unconditionally compile part of the DTB code 2026-04-04 14:01:19 +02:00
bjorn3 0f540e6f15 Don't physmap the kernel itself
We don't actually need to and this is a bit safer against memory corruption.
2026-04-02 20:29:36 +02:00
bjorn3 49eb21ce0e Use KERNEL_OFFSET from linker script 2026-04-02 20:29:36 +02:00
bjorn3 dc7e823f70 Deduplicate kernel page flags 2026-04-02 20:29:36 +02:00
bjorn3 c8879531ae rmm: Add device_memory and uncachable flags to PageFlags 2026-03-30 20:34:45 +02:00
bjorn3 c4b064ea44 Move arch specific EntryFlags into rmm 2026-03-30 18:49:15 +02:00
bjorn3 a876d66648 rmm: Reduce visibility of PageTable methods
This disallows direct manipulation of the page tables. Only manipulation
through PageMapper is allowed.
2026-03-29 14:16:53 +02:00
bjorn3 abf710b4a2 Move handling of kernel page table entry copying to RMM
This way it can ensure those page table entries never get unmapped,
ensuring they are kept in sync between all processes.
2026-03-29 14:16:53 +02:00
auronandace 4c734e461a prefer saturating methods over direct arithetic 2026-03-05 10:58:45 +00:00
auronandace fc6ffd59ff avoid direct indexing in MemoryMap register function 2026-03-03 17:22:44 +00:00
auronandace 14b8c2b0c1 enforce two lints and collapse some ifs 2026-03-03 14:51:32 +00:00
bjorn3 021cdf47f4 Fix a bunch of warnings 2025-10-19 14:27:43 +02:00
bjorn3 ff65afd003 Don't depend on the stack setup by the bootloader
This way we can choose our own size for the stack and don't have to
identity map it manually. Also this way the bootloader doesn't have to
change the stack pointer right before calling into the kernel (which it
currently does in an unsound way)
2025-10-19 06:23:39 -06:00
Speedy_Lex 0931a7f49f Resolve a huge portion of the clippy lints 2025-10-06 06:30:23 -06:00
bjorn3 e7358e3e5b Deduplicate a bunch of things that use KernelArgs between archs 2025-09-20 19:10:19 +02:00
bjorn3 5a6117b5ae Replace the log crate with a custom logging system
This avoids the need to explicitly set a logger early during boot, which
reduces the amount of moving parts that could go wrong slightly. And it
cuts the kernel image size by 13kb.
2025-09-13 18:55:16 +02:00
bjorn3 f9a4178898 Always enable graphical_debug
We already gracefully handle a missing framebuffer.
2025-09-11 21:41:30 +02:00
bjorn3 cea93f7647 cargo fix --edition & rustfmt
Or to be precise:
RUST_TARGET_PATH=$(pwd)/targets cargo fix --edition \
--target targets/x86_64-unknown-kernel.json \
--target targets/i686-unknown-kernel.json \
--target targets/aarch64-unknown-kernel.json \
--target targets/riscv64-unknown-kernel.json \
-Zbuild-std=core,alloc --allow-dirty --bin kernel
cargo fmt
2025-09-10 16:44:36 +02:00
bjorn3 c404598296 Use cfg!() rather than #[cfg] for the cfg in map_memory 2025-09-07 13:26:04 +02:00
bjorn3 b7566e66bd Fix 32bit x86 2025-09-07 13:00:40 +02:00
4lDO2 f044ffb03b Remove stable #![feature] and most x86_64 static mut. 2025-02-21 14:16:58 +01:00
Andrey Turkin 55041e2eeb Use a custom config flag to conditionally compile DTB-specific areas
Would be great if we could use a feature instead, but Cargo can't do target-specific defaults features
2024-10-19 21:03:43 +03:00
Andrey Turkin 0a6a90415a Refactor initial memory paging 2024-10-19 08:44:46 +03:00