Repository navigation
feat(libkernel): report hw.realmem through sysctl - #5098
Merged
oneandonlydean merged 1 commit intoOct 14, 2026
Merged
Conversation
This was referenced Oct 13, 2026
Author
|
Linux run of this change: Ubuntu in WSL2, GCC 15.2.0, Ninja Release, |
|
Tested on Linux x86-64 (Release build), with b16f8f3 cherry-picked onto main 14036cb:
It also cherry-picks cleanly together with #5078, which edits the same files. |
This was referenced Oct 13, 2026
11 tasks done
This was referenced Oct 13, 2026
11 tasks done
The dolphin_libretro core of RetroArch (PPSA99169) reads {CTL_HW,
HW_REALMEM} as the machine's memory size and stopped on the unsupported
MIB. It reports the same value as hw.physmem.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oneandonlydean
force-pushed
the
claude/sysctl-hw-realmem
branch
from
October 14, 2026 01:25
b16f8f3 to
fe54938
Compare
Collaborator
|
Rebased onto main to resolve the conflict in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Dolphin core that RetroArch (PPSA99169) ships,
cores/dolphin_libretro.so, stops on Windows a few seconds into a GameCube boot:MIB {6, 12} is {
CTL_HW,HW_REALMEM}. Dolphin'sMemPhysicalreads it on FreeBSD as the machine's memory size, into asize_t, without checking the result.sysctlnow answers {6, 12}, andsysctlbyname("hw.realmem")maps to it. It returns the same value and checks ashw.physmem{6, 5}: 8 bytes holding the_SC_PHYS_PAGESpages of 16 KiB, read-only (EPERMfor a write) andENOMEMfor a short buffer, the same handling FreeBSD'ssysctl_hw_realmemgives it next tosysctl_hw_physmem. FreeBSD reports there the memory the firmware describes, which is at leasthw.physmem; AnyPS5 has one memory size and the console's values are unknown. This is recorded under Unknown function info indocs/dev/debt/libkernel.md.Tested
--executable picker/picker.bin --executable es-de/es-de.binand started in its game mode (--ps5-mode=game). The game request names/app0/cores/dolphin_libretro.soand a 288-byte GameCube DOL I wrote: one text section at 0x80003100 holdingb .. No game files were involved.Starting core = GameCube mode, loads its Vulkan shader caches andBooting from executable: /app0/selftest/loop.dol, then runs for the whole 75 s run.selecton pipes, which RetroArch's web server needs) merged.guest_system_configuration: thehw.physmemcheck now also runs for {6, 12} andhw.realmem(length query, value, short buffer,EPERMfor a write throughsysctlandsysctlbyname). All 124 libkernel tests pass on Windows; Linux was not built locally.python tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code