[PR #3682] [MERGED] Kernel.Fs: Device file cleanup and /dev/rng implementation #3654

Closed
opened 2026-02-27 22:04:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3682
Author: @StevenMiller123
Created: 10/1/2025
Status: Merged
Merged: 10/1/2025
Merged by: @squidbus

Base: mainHead: rng_device


📝 Commits (9)

📊 Changes

19 files changed (+371 additions, -245 deletions)

View changed files

📝 CMakeLists.txt (+2 -0)
📝 src/core/file_sys/devices/base_device.cpp (+1 -1)
📝 src/core/file_sys/devices/base_device.h (+12 -12)
📝 src/core/file_sys/devices/console_device.cpp (+26 -27)
📝 src/core/file_sys/devices/console_device.h (+14 -14)
📝 src/core/file_sys/devices/deci_tty6_device.cpp (+26 -27)
📝 src/core/file_sys/devices/deci_tty6_device.h (+14 -14)
📝 src/core/file_sys/devices/logger.cpp (+6 -6)
📝 src/core/file_sys/devices/logger.h (+5 -5)
📝 src/core/file_sys/devices/nop_device.h (+12 -12)
📝 src/core/file_sys/devices/random_device.cpp (+27 -27)
📝 src/core/file_sys/devices/random_device.h (+14 -14)
src/core/file_sys/devices/rng_device.cpp (+87 -0)
src/core/file_sys/devices/rng_device.h (+39 -0)
📝 src/core/file_sys/devices/srandom_device.cpp (+28 -29)
📝 src/core/file_sys/devices/srandom_device.h (+14 -14)
📝 src/core/file_sys/devices/urandom_device.cpp (+27 -28)
📝 src/core/file_sys/devices/urandom_device.h (+14 -14)
📝 src/core/libraries/kernel/file_system.cpp (+3 -1)

📄 Description

This PR does two major things, cleaning up various issues with device files, and implementing RngDevice.
For the former, I've adjusted includes to better suit our current code preferences, fixed various incorrect function types, and adjusted the Device Create functions to use similar logic to the Directory Create functions.

For the latter, I've implemented the RngDevice, which is required for libSceSsl2 to run LLE (I have not actually LLE'd the library here, but this fixes internal library issues when trying to run it LLE).
The actual implementation for RngDevice ioctls is based entirely around code from fpPS4, though I've confirmed that libSceSsl2 works with what I've implemented.

I'm open to feedback, especially with my ioctls for the RngDevice, as I'm not too confident in how that code looks.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3682 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 10/1/2025 **Status:** ✅ Merged **Merged:** 10/1/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `rng_device` --- ### 📝 Commits (9) - [`97a1b6c`](https://github.com/shadps4-emu/shadPS4/commit/97a1b6cef7a7289f179219eede83c52f4d62197c) Add RNG device - [`b89286f`](https://github.com/shadps4-emu/shadPS4/commit/b89286f899f4914ec836581e5dc58b0941ba640a) rng device implementation - [`45dfac9`](https://github.com/shadps4-emu/shadPS4/commit/45dfac9a93d3d3b3303618942909aa420f9a6e00) Device file function types and log fixups - [`2b5609e`](https://github.com/shadps4-emu/shadPS4/commit/2b5609e8bfa597284c64468ccf4b7d21b95d08a1) Updated creates - [`4e7587b`](https://github.com/shadps4-emu/shadPS4/commit/4e7587bd815880956565c3dffe020bb68753b767) Fix compile - [`32e7068`](https://github.com/shadps4-emu/shadPS4/commit/32e7068aaf7a3bd03e23873e0432977550467dab) Includes cleanup - [`2b476ee`](https://github.com/shadps4-emu/shadPS4/commit/2b476ee222e44aac79151adabe34da311f258833) Fix buffer size - [`9fc6bdc`](https://github.com/shadps4-emu/shadPS4/commit/9fc6bdce080a62930eb61ccafde11bd63e054512) Bring back cstdlib imports - [`850b222`](https://github.com/shadps4-emu/shadPS4/commit/850b222507a68854372c584e9672b9763076f080) Merge branch 'shadps4-emu:main' into rng_device ### 📊 Changes **19 files changed** (+371 additions, -245 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+2 -0) 📝 `src/core/file_sys/devices/base_device.cpp` (+1 -1) 📝 `src/core/file_sys/devices/base_device.h` (+12 -12) 📝 `src/core/file_sys/devices/console_device.cpp` (+26 -27) 📝 `src/core/file_sys/devices/console_device.h` (+14 -14) 📝 `src/core/file_sys/devices/deci_tty6_device.cpp` (+26 -27) 📝 `src/core/file_sys/devices/deci_tty6_device.h` (+14 -14) 📝 `src/core/file_sys/devices/logger.cpp` (+6 -6) 📝 `src/core/file_sys/devices/logger.h` (+5 -5) 📝 `src/core/file_sys/devices/nop_device.h` (+12 -12) 📝 `src/core/file_sys/devices/random_device.cpp` (+27 -27) 📝 `src/core/file_sys/devices/random_device.h` (+14 -14) ➕ `src/core/file_sys/devices/rng_device.cpp` (+87 -0) ➕ `src/core/file_sys/devices/rng_device.h` (+39 -0) 📝 `src/core/file_sys/devices/srandom_device.cpp` (+28 -29) 📝 `src/core/file_sys/devices/srandom_device.h` (+14 -14) 📝 `src/core/file_sys/devices/urandom_device.cpp` (+27 -28) 📝 `src/core/file_sys/devices/urandom_device.h` (+14 -14) 📝 `src/core/libraries/kernel/file_system.cpp` (+3 -1) </details> ### 📄 Description This PR does two major things, cleaning up various issues with device files, and implementing RngDevice. For the former, I've adjusted includes to better suit our current code preferences, fixed various incorrect function types, and adjusted the Device Create functions to use similar logic to the Directory Create functions. For the latter, I've implemented the RngDevice, which is required for libSceSsl2 to run LLE (I have not actually LLE'd the library here, but this fixes internal library issues when trying to run it LLE). The actual implementation for RngDevice ioctls is based entirely around code from fpPS4, though I've confirmed that libSceSsl2 works with what I've implemented. I'm open to feedback, especially with my ioctls for the RngDevice, as I'm not too confident in how that code looks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:04:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3654
No description provided.