-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with BDM devices and fileXio after #671 #683
Comments
Sadly, it doesn't seem to fix the issue.
Example:
Your example also fails on both my console and PCSX2 if there are no USB devices connected:
PCSX2:
|
@uyjulian looks like we still have something wrong with current The next dummy example (using #include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <loadfile.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <iopcontrol.h>
#include <sbv_patches.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ps2_filesystem_driver.h>
// Used to get BDM driver name
#define NEWLIB_PORT_AWARE
#include <fileXio_rpc.h>
#include <io_common.h>
#include <usbhdfsd-common.h>
#include <ps2sdkapi.h>
static void reset_IOP() {
SifInitRpc(0);
#if !defined(DEBUG) || defined(BUILD_FOR_PCSX2)
/* Comment this line if you don't wanna debug the output */
while (!SifIopReset(NULL, 0)) {};
#endif
while (!SifIopSync()) {};
SifInitRpc(0);
sbv_patch_enable_lmb();
sbv_patch_disable_prefix_check();
}
static void init_drivers() {
init_ps2_filesystem_driver();
}
static void deinit_drivers() {
deinit_ps2_filesystem_driver();
}
int main(int argc, char **argv) {
int res, fd;
reset_IOP();
init_drivers();
printf("Opening FONTM\n");
fd = open("rom0:FONTM", O_RDONLY);
if (fd < 0) {
printf("ERROR: Failed to open: %d, errno: %d\n", fd, errno);
} else {
close(fd);
}
printf("Done");
deinit_drivers();
SleepThread();
}
|
Cannot reproduce the issue on either PCSX2 or real hardware After rebuilding ps2sdk ( e3bea49 ) and ps2_drivers
|
@fjtrujy @uyjulian
It looks like #671 introduced a serious issue with mixed usage of
fileXio
and POSIX calls (at least) on BDM devices.NHDDL needs to get the device driver name and device number for launching Neutrino.
Currently, the only way to get those is to use the
fileXioIoctl2
call.Since after #671 has been merged, I keep getting strange errors on real PS2 hardware (PS2 SCPH-70000), even when compling using the latest PS2SDK commit.
When multiple BDM modules and devices are loaded, I get errors when using
opendir
/closedir
calls.Most of the times
opendir
can't openmass0:
even though it was successfully opened and closed withfileXioDopen
previously. Sometimes trying to callclosedir
on an opened directory when traversing directories crashes PS2 because the DIR pointer suddenly becomes NULL.In addition to this, when only one BDM device is initialized, using
mkdir
call afterfileXioIoctl2
causesopen("rom0:FONTM"...)
to fail. This particular issue can be reliably reproduced with the following code when launched from PS2LINK:https://github.com/pcm720/ps2sdk-test/blob/main/main.c
Note that the issue occurs only on a real hardware when using
fileXio.irx
.It never fails with
fileXio_verbose.irx
or when running on PCSX2.Reverting 2a131ac or calling
fileXioExit
afterfileXioIoctl2
fixes all of those issues.@fjtrujy's example that demonstrates this issue on PCSX2 with USB mass drivers:
https://github.com/fjtrujy/helloWorldPS2/blob/mass_driver_bug/main.c
The text was updated successfully, but these errors were encountered: