Commit Graph

1784 Commits

Author SHA1 Message Date
Wildan M c72e0a67f9 Prevent drop on AddrSpace 2026-02-27 10:47:45 +07:00
Jeremy Soller d34090f352 Accurately strip ANSI escape sequences in graphical debug display 2026-02-26 10:33:46 -07:00
Wildan M ac0bd2af74 Fix compilation 2026-02-26 04:33:10 +07:00
Anhad Singh 8eb6d22ab4 misc(scheme/user): remove some debug logs
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-25 08:21:36 -07:00
Anhad Singh 955b4b2a1c feat(stdfscall): flocking
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-25 08:21:36 -07:00
Wildan M 14349d1649 Propagate ordered lock of event trigger 2026-02-25 11:42:31 +07:00
Wildan M 3c2b1a11c5 Add ordered lock for time offset mutex 2026-02-25 11:42:17 +07:00
Wildan M 735c68ec30 Add ordered lock for WaitQueue mutex 2026-02-25 09:48:13 +07:00
auronandace bf396c7f61 replace manual stripping 2026-02-23 15:49:32 +00:00
auronandace 8138826200 avoid direct indexing in wait_condition 2026-02-23 06:34:20 -07:00
auronandace 7770a9452c avoid direct indexing futexes 2026-02-23 11:57:28 +00:00
auronandace a19be5da11 avoid direct indexing in AlignedBox 2026-02-22 13:43:37 +00:00
auronandace aeb75d577f add assert to ensure both arrays are equal length 2026-02-21 20:37:08 +00:00
auronandace 8689e31674 remove an instance of direct indexing 2026-02-21 15:28:55 +00:00
auronandace df469ddcb3 apply is_multiple_of lint 2026-02-21 08:39:26 +00:00
auronandace 28ba26cc2b move lints to Cargo.toml file 2026-02-20 15:59:27 +00:00
Anhad Singh fc60dcced0 misc(main): add feature btree_cursors
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-21 00:59:24 +11:00
Anhad Singh a8699a7e72 feat(memory): handle grant merges when mutating
This commit fixes the following panic when running nodejs:
```
KERNEL PANIC: panicked at src/context/memory.rs:267:18:
grant cannot magically disappear while we hold the lock!
  FP ffff80002021f650: PC ffffffff8005e45b
    FFFFFFFF8005E2E0+017B
    kernel::panic::panic_handler_inner
  FP ffff80002021f730: PC ffffffff80057559
  FP ffff80002021f740: PC ffffffff8009a0ff
  FP ffff80002021f770: PC ffffffff8009c214
  FP ffff80002021f7d0: PC ffffffff80010997
    FFFFFFFF8000FDD0+0BC7
    kernel::context::memory::AddrSpaceWrapper::mprotect
  FP ffff80002021fd40: PC ffffffff8008cb0b
    FFFFFFFF8008CA40+00CB
    kernel::syscall::process::mprotect
  FP ffff80002021fd70: PC ffffffff8006ce6c
    FFFFFFFF8006CBE0+028C
    kernel::syscall::syscall
  FP ffff80002021fe90: PC ffffffff8008d3cf
    FFFFFFFF8008D320+00AF
    __inner_syscall_instruction
  FP ffff80002021ff50: PC ffffffff800830c3
    FFFFFFFF80083080+0043
    kernel::arch::x86_64::interrupt::syscall::syscall_instruction
  00007ffffffffaf0: GUARD PAGE
CPU #1, CID 0xffffff7f8015b910
NAME: /usr/bin/node, DEBUG ID: 74
SYSCALL: mprotect(0x203C0000, 262144, Some(MapFlags(0x0)))
HALT
```

The grant did not magically disappear. When going through the
`grant_span_res` regions, the function adds (and removes) grants to the
`self.grants` tree. The insertion and deletion functions also merge
adjacent grants together when possible. This is an issue since we can no
longer use the keys we established before we started iterating. This
commit modifies the places where `remove` is used in this fashion to use
`remove_containing` instead. The `remove_containing` function will
remove the grant that *contains* the page.

Should it be done this way (requires unstable feature `btree_cursors`)?

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-21 00:59:24 +11:00
Anhad Singh 124b74e816 fix(context/memory): Grant::remap delegate write
`Grant::remap` should not directly mark entries as writeable because the
entry could be private and requires Copy-On-Write (COW) handling. This
bug fixes the random panics that occur when running programs that
incorrectly mark private memory regions as writeable. This also
inadvertently caused other systems to crash. This is because The Zeroed
Frame is mapped instead of allocating a new zeroed memory region every
time. Only after the first write is the frame actually allocated. This
means that with this bug one could remap a freshly mmap'ed ANONYMOUS
region with the write flag and rewrite the contents of The Zeroed Frame,
which is a big problem. This means that any program that allocated
memory with the ANONYMOUS flag after this would not receive zeroed
memory.

Example of `make` hitting this bug when the shared `ld.so` patches are
applied:
```
....
[page at 0x48bd000] is mapped to the zeroed frame with PageFlags { present: true, write: false, executable: false, user: true, bits: 0x8000000000000005 }
[page at 0x49b1000] is mapped to the zeroed frame with PageFlags { present: true, write: true, executable: false, user: true, bits: 0x8000000000000007 }
[page at 0x49b2000] is mapped to the zeroed frame with PageFlags { present: true, write: true, executable: false, user: true, bits: 0x8000000000000007 }
[page at 0x49b3000] is mapped to the zeroed frame with PageFlags { present: true, write: true, executable: false, user: true, bits: 0x8000000000000007 }
[page at 0x49b4000] is mapped to the zeroed frame with PageFlags { present: true, write: true, executable: false, user: true, bits: 0x8000000000000007 }
0x43ff000..0x49b5000 :: MapFlags(PROT_WRITE | PROT_READ)
[page at 0x49b5000] is mapped to the zeroed frame with PageFlags { present: true, write: false, executable: false, user: true, bits: 0x8000000000000005 }
[page at 0x49b6000] is mapped to the zeroed frame with PageFlags { present: true, write: false, executable: false, user: true, bits: 0x8000000000000005 }
....
```

and causing the following crash:

```
Page fault: 0000000000001718 P | WR | US
RFLAG: 0000000000010202
CS:    000000000000002b
RIP:   00000000004125fd
RSP:   00007fffffffdd80
SS:    0000000000000023
FSBASE  00000000003f6000
GSBASE  0000000000000000
KGSBASE ffff80007a800000
RAX:   0000000000001718
RCX:   0000000000000000
RDX:   ffffffffffffffff
RDI:   000000000043b5a0
RSI:   00000000004537e0
R8:    0000000000000030
R9:    000000000043b5a0
R10:   0000000000000030
R11:   00000000000000ff
RBX:   0000000000000000
RBP:   00007fffffffddb0
R12:   000000000043b5a0
R13:   00000000004537e0
R14:   00000000004537e0
R15:   000000000043b5a0
  FP 00007fffffffddb0: PC 000000000042614a
  FP 00007fffffffde40: PC 0000000000411ae9
  FP 00007fffffffde80: PC 0000000000417187
  FP 00007fffffffdee0: PC 0000000000411d39
  FP 00007fffffffdf90: PC 000000000041207d
  FP 00007fffffffe020: PC 000000000040bc4c
  FP 00007fffffffe0c0: PC 000000000040c7c9
  FP 00007fffffffe0f0: PC 00000000004276ba
  FP 00007fffffffe1a0: PC 0000000000428087
  FP 00007fffffffe210: PC 000000000041eb6a
  FP 00007fffffffe400: PC 00000000004205c3
  FP 00007fffffffe490: PC 00000000004208dd
  FP 00007fffffffe4d0: PC 000000000040747e
  FP 00007ffffffffd60: PC 000000000092111c
  <Invalid next frame pointer 0x0000000000438490; stack walk ended>
  FP ffff80001b5bfe80: PC ffffffff80046dad
    FFFFFFFF80046BD0+01DD
    kernel::arch::x86_shared::interrupt::exception::page::inner
  FP ffff80001b5bff50: PC ffffffff8003ffbb
    FFFFFFFF8003FF84+0037
    kernel::arch::x86_shared::interrupt::exception::page
  00007fffffffddb0: GUARD PAGE
kernel::context::signal:INFO -- UNHANDLED EXCEPTION, CPU #1, PID 6548, NAME /usr/bin/make, CONTEXT 0xffffff7f8013fdc0
```

Also the crash info would vary every time you run the program since the
contents of The Zeroed Frame would have been mutated. Sneaky bug :^)

This also fixes the crashes that happen when running node.js (and maybe
other programs): https://gitlab.redox-os.org/redox-os/relibc/-/issues/229

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-19 19:54:14 +11:00
Ibuki Omatsu 5a8858ff81 refactor: Initialize sys schem resources when they are first accessed. 2026-02-12 06:24:43 -07:00
Jeremy Soller 934162f35a Implement stdfscall 2026-02-11 12:12:49 -07:00
bjorn3 858b712df5 Use naked_asm!() instead of global_asm!() where possible 2026-02-09 22:28:38 +01:00
bjorn3 d51fe0c7e0 Avoid concat!() in inline asm
It is no longer necessary in modern rustc versions.
2026-02-09 22:12:20 +01:00
bjorn3 6bd204e1a3 Remove always true supports_on_close field 2026-02-08 17:23:50 +01:00
bjorn3 4c2c2b6757 Remove Option from State::Waiting.fds 2026-02-08 17:08:59 +01:00
bjorn3 0576db1fb4 Inline UserInner::call and rename call_extended to call 2026-02-08 13:01:14 +01:00
bjorn3 3d1188cf1e Introduce Response::as_regular 2026-02-08 12:54:04 +01:00
bjorn3 99ff55ee1b Demux results as soon as we receive them from a user scheme 2026-02-08 12:50:53 +01:00
bjorn3 f88cbf96ee Remove unnecessary clones and pass CallerCtx to call() 2026-02-08 12:46:08 +01:00
bjorn3 5c6af01a9a Remove two unnecessary uses of spin::Once 2026-02-07 13:14:48 +01:00
bjorn3 e14a20aae2 Mark two functions as private 2026-02-07 12:59:24 +01:00
bjorn3 4e41ed987a Fix /scheme/sys/context header 2026-02-07 12:31:42 +01:00
bjorn3 2f8a3b3d67 Remove unused SchemeNamespace type 2026-02-06 22:05:42 +01:00
bjorn3 f334e760bb Remove ens field from Context
It is no longer used due to the capability rework.
2026-02-06 22:00:18 +01:00
bjorn3 9f218c5b3a Fix assertion in Args::args() 2026-02-06 21:07:16 +01:00
bjorn3 7ff1898765 Fix a couple of warnings 2026-02-06 20:54:42 +01:00
bjorn3 6ddd0a9098 Replace scheme::schemes() with scheme::get_scheme()
We never need to iterate over all schemes. We only ever need to access
individual schemes.
2026-02-06 20:54:42 +01:00
bjorn3 ace9038720 Reduce visibility of a couple of methods 2026-02-06 20:34:16 +01:00
Jeremy Soller 2055a205f1 Remove legacy path message 2026-01-29 10:12:04 -07:00
Ibuki Omatsu 5ac00f5533 Remove namespace management from the kernel. 2026-01-20 20:43:34 -07:00
Jeremy Soller 1c850605d0 Only read time once during context switch 2026-01-20 14:18:33 -07:00
Jeremy Soller 81a49d211b Fix potential preempt guard deadlock 2026-01-20 13:58:31 -07:00
Anhad Singh 7d42e8d966 fix(switch): deadlock
During the snapshot shown, interrupts would be _disabled_ on both CPUs and both
would have have the _same_ address space (i.e.
`PercpuBlock::current().current_addrsp`).

```rs
// CPU 0                                                                                             CPU 1 (inside `context::switch()`)
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// let guard = current_addrsp.acquire_write()
// let flusher = Flusher::with_cpu_set(&addrsp.used_by, &current_addrsp.tlb_ack);
// ...
// drop(flusher); // Flusher::flush()
//     // send IPI to CPU 1 as it is in the `active_set`
//     shootdown_tlb_ipi(Some(1));
//                                                                                                    percpu::switch_arch_hook();
//     // spin until TLB shootdown IPI has been acknowledged by CPU 1                                 // acquire_read() to remove the CPU from the `used_by` set in `prev_addrsp`
//     while ackword < affected_cpu_count                                                             prev_addrsp.acquire_read()
//         PercpuBlock::current().maybe_handle_tlb_shootdown();
//         spin_loop();
//     }
// drop(guard);
```

Now CPU 0 will spin _until_ CPU 1 has acknowledged the IPI. However, CPU 1 has
interrupts disabled and is in the middle of a context switch. To complete the
context switch it needs to remove itself from the `used_by` set in
`prev_addrsp` (which is the current address space atm). To do that it needs to
`acquire_read()` lock but it cannot since it is held by CPU 0 and won't release
it until CPU 1 has acknowledged the IPI; creating a deadlock.

Also note:

```rs
// src/context/memory.rs
// NOTE: Lock must be held, which must be guaranteed by the caller.
pub fn flush(&mut self) {
```

Here is some output from GDB to back this up:

```
pwndbg> info threads
  Id   Target Id                    Frame
  1    Thread 1.1 (CPU#0 [running]) core::sync::atomic::atomic_compare_exchange_weak<usize> (dst=0xffffff7f801972f0, old=0, new=1, success=core::sync::atomic::Ordering::Acquire, failure=core::sync::atomic::Ordering::Relaxed)
    at /mnt/redox/prefix/x86_64-unknown-redox/sysroot/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:4100
  2    Thread 1.2 (CPU#1 [running]) kernel::context::memory::Flusher::flush (self=0xffff80004212f4b8) at src/context/memory.rs:2827
  3    Thread 1.3 (CPU#2 [running]) spin::rwlock::RwLock<kernel::context::context::Context, spin::relax::Spin>::write<kernel::context::context::Context, spin::relax::Spin> (self=0xffffff7f801a99c0)
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spin-0.9.8/src/rwlock.rs:239
* 4    Thread 1.4 (CPU#3 [running]) 0xffffffff80059cf9 in kernel::context::memory::AddrSpaceWrapper::acquire_read (self=0xffffff7f80188110)
    at /mnt/redox/prefix/x86_64-unknown-redox/sysroot/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:25
pwndbg> p kernel::context::arch::CONTEXT_SWITCH_LOCK
$1 = core::sync::atomic::AtomicBool {
  v: core::cell::UnsafeCell<u8> {
    value: 1
  }
}
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[0].p.value).wants_tlb_shootdown.v.value
$2 = 0
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[1].p.value).wants_tlb_shootdown.v.value
$3 = 0
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[2].p.value).wants_tlb_shootdown.v.value
$4 = 1
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[3].p.value).wants_tlb_shootdown.v.value
$5 = 0
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[3].p.value).current_addrsp
$6 = core::cell::RefCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
  borrow: core::cell::Cell<isize> {
    value: core::cell::UnsafeCell<isize> {
      value: 0
    }
  },
  value: core::cell::UnsafeCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
    value: core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>::Some(alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global> {
        ptr: core::ptr::non_null::NonNull<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>> {
          pointer: 0xffffff7f80188100
        },
        phantom: core::marker::PhantomData<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>>,
        alloc: alloc::alloc::Global
      })
  }
}
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[2].p.value).current_addrsp
$7 = core::cell::RefCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
  borrow: core::cell::Cell<isize> {
    value: core::cell::UnsafeCell<isize> {
      value: 0
    }
  },
  value: core::cell::UnsafeCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
    value: core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>::Some(alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global> {
        ptr: core::ptr::non_null::NonNull<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>> {
          pointer: 0xffffff7f80188100
        },
        phantom: core::marker::PhantomData<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>>,
        alloc: alloc::alloc::Global
      })
  }
}
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[1].p.value).current_addrsp
$8 = core::cell::RefCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
  borrow: core::cell::Cell<isize> {
    value: core::cell::UnsafeCell<isize> {
      value: 0
    }
  },
  value: core::cell::UnsafeCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
    value: core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>::Some(alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global> {
        ptr: core::ptr::non_null::NonNull<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>> {
          pointer: 0xffffff7f80188100
        },
        phantom: core::marker::PhantomData<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>>,
        alloc: alloc::alloc::Global
      })
  }
}
pwndbg> p (*kernel::percpu::ALL_PERCPU_BLOCKS[0].p.value).current_addrsp
$9 = core::cell::RefCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
  borrow: core::cell::Cell<isize> {
    value: core::cell::UnsafeCell<isize> {
      value: 0
    }
  },
  value: core::cell::UnsafeCell<core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>> {
    value: core::option::Option<alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global>>::Some(alloc::sync::Arc<kernel::context::memory::AddrSpaceWrapper, alloc::alloc::Global> {
        ptr: core::ptr::non_null::NonNull<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>> {
          pointer: 0xffffff7f80133ac8
        },
        phantom: core::marker::PhantomData<alloc::sync::ArcInner<kernel::context::memory::AddrSpaceWrapper>>,
        alloc: alloc::alloc::Global
      })
  }
}
```

```
pwndbg> thread 4
[Switching to thread 4 (Thread 1.4)]
25	in /mnt/redox/prefix/x86_64-unknown-redox/sysroot/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs
pwndbg> info threads
  Id   Target Id                    Frame
  1    Thread 1.1 (CPU#0 [running]) core::sync::atomic::atomic_compare_exchange_weak<usize> (dst=0xffffff7f801972f0, old=0, new=1, success=core::sync::atomic::Ordering::Acquire, failure=core::sync::atomic::Ordering::Relaxed)
    at /mnt/redox/prefix/x86_64-unknown-redox/sysroot/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:4100
  2    Thread 1.2 (CPU#1 [running]) kernel::context::memory::Flusher::flush (self=0xffff80004212f4b8) at src/context/memory.rs:2827
  3    Thread 1.3 (CPU#2 [running]) spin::rwlock::RwLock<kernel::context::context::Context, spin::relax::Spin>::write<kernel::context::context::Context, spin::relax::Spin> (self=0xffffff7f801a99c0)
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spin-0.9.8/src/rwlock.rs:239
* 4    Thread 1.4 (CPU#3 [running]) 0xffffffff80059cf9 in kernel::context::memory::AddrSpaceWrapper::acquire_read (self=0xffffff7f80188110)
    at /mnt/redox/prefix/x86_64-unknown-redox/sysroot/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:25
pwndbg> thread 4
[Switching to thread 4 (Thread 1.4)]
25	in /mnt/redox/prefix/x86_64-unknown-redox/sysroot/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs
pwndbg> bt
```

This is *after* everything freezes.

For relibc tests, if I run `while true; do
/root/relibc-tests/pthread/once; done` it eventually does freeze up and
does so at the same location:

```
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ THREADS (4 TOTAL) ]──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ► 1   "" stopped: 0xffffffff800750a2 <kernel::context::switch::switch+1282>
    4   "" stopped: 0xffffffff80074d5a <kernel::context::switch::switch+442>
    3   "" stopped: 0xffffffff80059cf9 <kernel::context::context::Context::set_addr_space+217>
    2   "" stopped: 0xffffffff80020839 <kernel::context::memory::Flusher::flush+361>
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
```

Related: https://gitlab.redox-os.org/redox-os/kernel/-/issues/175

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-19 15:21:13 +11:00
Pascal Reich a919d2626b Inline Documentation Fixes 2026-01-10 16:19:34 -07:00
Jeremy Soller ea06685903 Do not allow recursively registering the same event queue 2026-01-09 12:08:16 -07:00
Anhad Singh a245e49e75 fix(syscalls/futex): premature timeout
Previously, if a futex with a timeout was woken up (even via
`futex_wake`), it was treated as though the timeout had expired. When
the timeout expires, the scheduler sets `wake` to `None` and unblocks
the process. Hence if `wake` is `None` and if a timeout was given to
futex, it has expired. Otherwise the process was woken up by
`futex_wake`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-07 14:45:01 +11:00
Anhad Singh 5ccd2414af fix(context/memory): incorrect remaining_src_span
The `AddrSpaceWrapper::r#move` is used by `mremap` to move, expand or
shrink existing mappings.

`src_span.count`: Size of old region in pages
`new_page_count`: Size of new region in pages

Fixes the following panic when running `cargo`:

```
KERNEL PANIC: panicked at src/context/memory.rs:1969:9:
assertion failed: self.info.can_extract(false)
  FP ffff80000cbbf2c0: PC ffffffff8004ced5
    FFFFFFFF8004CD50+0185
    kernel::panic::panic_handler_inner
  FP ffff80000cbbf3a0: PC ffffffff8004ac99
  FP ffff80000cbbf3b0: PC ffffffff800a34df
  FP ffff80000cbbf3e0: PC ffffffff800a34b4
  FP ffff80000cbbf430: PC ffffffff8001c029
    FFFFFFFF8001BF10+0119
    kernel::context::memory::Grant::extract
  FP ffff80000cbbf4a0: PC ffffffff800181ac
    FFFFFFFF80016D30+147C
    kernel::context::memory::AddrSpaceWrapper::move
  FP ffff80000cbbfd30: PC ffffffff80037c08
    FFFFFFFF80035660+25A8
    kernel::syscall::syscall
  FP ffff80000cbbfe90: PC ffffffff8008efbf
    FFFFFFFF8008EF10+00AF
    __inner_syscall_instruction
  FP ffff80000cbbff50: PC ffffffff80085d33
    FFFFFFFF80085CF0+0043
    kernel::arch::x86_64::interrupt::syscall::syscall_instruction
  0000000000004455: GUARD PAGE
CPU #2, CID 0xffffff7f80133690
NAME: /scheme/initfs/bin/redoxfs, DEBUG ID: 43
SYSCALL: mremap(0x2177F000, 0x8000, 0x0, 0xC7000, 0x60000)
HALT
```

```
mremap_flags = MremapFlags(
    0x0,
)
prot_flags = MapFlags(
    PROT_WRITE | PROT_READ,
)
```

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-03 22:56:03 +11:00
Wildan M 92132132c1 Implement clock_getres and handle path to time scheme 2025-12-21 05:24:13 +07:00
Ibuki Omatsu e30ed9ab6a Introduce syscall6. Add unlinkat and remove unlink and rmdir. 2025-12-17 18:31:04 -07:00
Anhad Singh d9eae6bb75 fix(sync/wait_condition): deadlock in WaitCondition::wait
Instead of using a simple switch to determine if preemption is enabled
(`is_preemptable: bool`), a counter is used instead. This handles the
case where a function holding a `PreemptGuard` calls another function
that creates a new `PreemptGuard`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-15 13:05:29 +11:00