fix(relibc): implement getrlimit defaults + getdtablesize return; add kwin stub; kernel graphical_debug defer

This commit is contained in:
2026-04-27 01:57:14 +01:00
parent 45e2016918
commit 8644e8b6d0
4 changed files with 68 additions and 0 deletions
+19
View File
@@ -126,3 +126,22 @@ index 3159b9c4..c691eb8d 100644
_ => MadtEntry::Unknown(entry_type),
};
diff --git a/src/devices/graphical_debug/mod.rs b/src/devices/graphical_debug/mod.rs
index b701c9a8..00cc984d 100644
--- a/src/devices/graphical_debug/mod.rs
+++ b/src/devices/graphical_debug/mod.rs
@@ -59,7 +59,12 @@ pub fn init(env: &[u8]) {
);
let debug_display = DebugDisplay::new(width, height, stride, virt as *mut u32);
- *DEBUG_DISPLAY.lock() = Some(debug_display);
+ // FIXME: Writing to the framebuffer during early boot causes a hang on some
+ // QEMU configurations (virtio-vga, ramfb). The bootloader maps the framebuffer
+ // with default caching; the kernel remaps it with write-combining in memory::init().
+ // Early kernel access before that remap appears to stall. Deferring DEBUG_DISPLAY
+ // setup avoids the hang; userspace vesad/fbbootlogd handles graphical output.
+ // *DEBUG_DISPLAY.lock() = Some(debug_display);
}
#[allow(unused)]
@@ -0,0 +1,40 @@
diff --git a/src/header/unistd/mod.rs b/src/header/unistd/mod.rs
index 573d69ad..d7ebe10d 100644
--- a/src/header/unistd/mod.rs
+++ b/src/header/unistd/mod.rs
@@ -534,7 +534,7 @@ pub extern "C" fn getdtablesize() -> c_int {
};
if r == 0 {
let cur = unsafe { lim.assume_init() }.rlim_cur;
- match cur {
+ return match cur {
c if c < i32::MAX as u64 => c as i32,
_ => i32::MAX,
};
}
-1
}
diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs
index 752339a7..3f44171b 100644
--- a/src/platform/redox/mod.rs
+++ b/src/platform/redox/mod.rs
@@ -736,10 +736,15 @@ impl Pal for Sys {
}
fn getrlimit(resource: c_int, mut rlim: Out<rlimit>) -> Result<()> {
- todo_skip!(0, "getrlimit({}, {:p}): not implemented", resource, rlim);
+ // Return sensible defaults without logging; full kernel syscall not yet available.
+ let (cur, max) = match resource {
+ sys_resource::RLIMIT_NOFILE => (65536, 65536),
+ sys_resource::RLIMIT_STACK => (8 * 1024 * 1024, RLIM_INFINITY as u64),
+ _ => (RLIM_INFINITY as u64, RLIM_INFINITY as u64),
+ };
rlim.write(rlimit {
- rlim_cur: RLIM_INFINITY,
- rlim_max: RLIM_INFINITY,
+ rlim_cur: cur,
+ rlim_max: max,
});
Ok(())
}
+8
View File
@@ -86,6 +86,14 @@ exit 0
EOFBIN
chmod +x "${STAGE}/bin/kwin_wayland"
# Dummy kwin_wayland_wrapper binary
cat > "${STAGE}/bin/kwin_wayland_wrapper" << 'EOFBIN'
#!/bin/sh
echo "KWin stub: kwin_wayland_wrapper not yet available on Redox (args: $@)"
exit 0
EOFBIN
chmod +x "${STAGE}/bin/kwin_wayland_wrapper"
# Minimal kwin header stubs for downstream compilation
cat > "${STAGE}/include/kwin/kwinevents.h" << 'EOFHDR'
#pragma once
+1
View File
@@ -31,6 +31,7 @@ patches = [
"../../../local/patches/relibc/P3-inet6-pton-ntop.patch",
"../../../local/patches/relibc/P3-tcp-sockopt-forward.patch",
"../../../local/patches/relibc/P3-dns-aaaa-getaddrinfo-ipv6.patch",
"../../../local/patches/relibc/P3-getrlimit-getdtablesize.patch",
]
[build]