mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-24 23:36:00 +03:00
[PR #3771] [Draft] Full filesystem emulation with host integration #3710
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3710
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3771
Author: @marecl
Created: 11/3/2025
Status: 🔄 Open
Base:
main← Head:quasifs📝 Commits (10+)
8ea7ce6qfs integrationb0f31adinitial integrationc16ba68Implemented sceKernelTruncate (was missing)b105adeadded /dev/null properly538ee93Fixed incorrect size being read preventing actually reading anythingc328815Separated virtual from "regular" filescd49b6bPrepared Directory for normal and PFSab5a9dbAs above, forgor6d02f5bQuieted some messages (i'm lazy)60a32abmoar📊 Changes
100 files changed (+6731 additions, -2514 deletions)
View changed files
📝
CMakeLists.txt(+67 -25)📝
CMakeSettings.json(+2 -2)📝
documents/building-macos.md(+36 -0)📝
src/common/io_file.cpp(+0 -22)📝
src/common/io_file.h(+0 -1)➖
src/core/file_sys/devices/base_device.cpp(+0 -12)➖
src/core/file_sys/devices/base_device.h(+0 -76)📝
src/core/file_sys/devices/console_device.cpp(+3 -65)📝
src/core/file_sys/devices/console_device.h(+28 -21)📝
src/core/file_sys/devices/deci_tty6_device.cpp(+3 -65)📝
src/core/file_sys/devices/deci_tty6_device.h(+28 -21)📝
src/core/file_sys/devices/logger.cpp(+6 -19)📝
src/core/file_sys/devices/logger.h(+25 -9)📝
src/core/file_sys/devices/nop_device.h(+21 -54)➕
src/core/file_sys/devices/null_device.cpp(+23 -0)➕
src/core/file_sys/devices/null_device.h(+40 -0)📝
src/core/file_sys/devices/random_device.cpp(+14 -65)📝
src/core/file_sys/devices/random_device.h(+33 -21)📝
src/core/file_sys/devices/rng_device.cpp(+4 -59)📝
src/core/file_sys/devices/rng_device.h(+25 -18)...and 80 more files
📄 Description
This PR implements full on filesystem implementation, superseeds #3368.
Backend resembles how kernel treats files, with generic POSIX
inodeprototypes.Main goal: Accurate FS emulation
Side goal: fix games suffering from inconsistencies between POSIX/native FS calls and C++ streams (Catherine, Burnout IIRC).
What works
stat: nearly everything:fileno,nlink, (mostly) timestamps etc./dev/app0,/dataopen,link, etc.)file_systemstdout,urandometc.)Known issues
TODO
inodederivative)-UPDATEand-patchOptional
mount -o bind-equivalentu8buffer read/writes may or may not be the most intuitive solutionWhat's not supposed to be a part of this PR
Memory managements
Everything is based on
shared_ptr. My reasoning is that OG pointers can (and will) run out of scope, making MM a living hell. This wayinodeslive on in their own, getting freed on their own. Maybe some of those can be substituted withweak_ptrbut I want to make it work first.Disclaimer
All lists are not exhaustive. This is subject to a lot of changes.
It's also not like there are a lot of things not working and few working, it's quite the contrary. I just don't really remember anymore.
I'm well aware that some features may be an overkill, but so far I need time to make it work, wait for feedback and then evaluate what requires optimization.
Based on my own lib built specifically as a PoC for this usecase
This lib includes tests and examples on how to use and navigate QFS.
How QFS works
inodehaving basic file prototypes"/"HostIOto access the hostThere's a lot of inheritance, but I hope it's organized well enough.
HostIO
This is a proxy driver interacting with QFS and host's FS. All targets are independent.
Since this driver is completely separate, interacting with QFS requires setting up some context before file operations.
Hosts are not affected.
This lib is written with Linux as a target, since PS4 is running basically that. macOS is similar, but Windows needs to accomodate.
Disclaimer
So far it works, but my free time has been nerfed by a lot recently.
I hope I'll be able to push it out as far as I can.
If you have some spare time on your hands, feel free to review and question my design decisions.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.