obhq / obliteration

Experimental free and open-source PlayStation 4 kernel
https://obliteration.net
Apache License 2.0
623 stars 17 forks source link

Implements Read and Seek on VFile, removes fdopen #747

Closed SuchAFuriousDeath closed 6 months ago

SuchAFuriousDeath commented 6 months ago

This is more of a rough sketch. I had the VnodeBackend::open in mind a long time ago. I think that if you look at implementations of vop_open, the file* is basically passed to them just so that they can call finit on it, which is the equivalent of returning the filetype and setting it in open as I did.

This PR

I'll be gradually splitting this into multiple PRs so that it's easier to review.

Things to consider: Is it ok to do pwritev every time in HostFile? It's probably possible to store the next expected offset and if it matches the provided one, do a simple writev.

SuchAFuriousDeath commented 6 months ago

@ultimaweapon What do you think about using OwnedFd in HostFile?

SuchAFuriousDeath commented 6 months ago

@ultimaweapon FYI, we currently fail on looking up libkernel image

SuchAFuriousDeath commented 6 months ago

I'm past that, now the read seems to fail

SuchAFuriousDeath commented 6 months ago

Ok, I got the path wrong, so I was trying to read a directory, oops. Now we're failing at devfs getattr which is being called by revoke :heart_eyes:

SuchAFuriousDeath commented 6 months ago

We're currently stuck at opening dipsw, which isn't implemented for us

SuchAFuriousDeath commented 6 months ago

Closing this as it has been split into several smaller PRs