obhq / obliteration

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

Implements mkdir for Windows #757

Closed ultimaweapon closed 6 months ago

ultimaweapon commented 6 months ago

Closes #755.

ultimaweapon commented 6 months ago

@VocalFan can you test this?

VocalFan commented 6 months ago

Ah, you reached the same point I did, sadly.

@ultimaweapon

++++++++++++++++++ E [00:00:00:00:250]:0x0000000000004eb0: kernel\src/main.rs:670
Error while running kernel: filesystem initialization failed -> cannot lookup /dev -> couldn't open the specified file -> Access is denied. (os error 5).

It's mainly due to the folder already existing.

If I delete the empty dev folder, it creates the folder and continues to mnt... Which since mnt already exists:

++++++++++++++++++ E [00:00:00:00:211]:0x0000000000004f90: kernel\src/main.rs:670
Error while running kernel: couldn't mount /mnt -> fspath is not found -> cannot lookup 'mnt' from component #0 -> couldn't open the specified file -> Access is denied. (os error 5).
ultimaweapon commented 6 months ago

This is bad. Why Windows report access is denied instead of something like file already exists.

ultimaweapon commented 6 months ago

I think I found a solution now.

VocalFan commented 6 months ago

I think I found a solution now.

...Got 8 minutes then I gotta go :P

VocalFan commented 6 months ago

@ultimaweapon Before I test this when I go home... I basically had an identical implementation, however, the error code number for when I got access denied was (-1073741790)... Don't know if that helps

VocalFan commented 6 months ago
++++++++++++++++++ E [00:00:00:00:366]:0x0000000000003124: kernel\src/main.rs:670
Error while running kernel: filesystem initialization failed -> cannot lookup /dev -> couldn't open the specified file -> Access is denied. (os error 5).
VocalFan commented 6 months ago
>Err_6.4.5.exe -1073741771
# for decimal -1073741771 / hex 0xc0000035

  STATUS_OBJECT_NAME_COLLISION                                   ntstatus.h
# Object Name already exists.
# as an HRESULT: Severity: FAILURE (1), FACILITY_NULL (0x0), Code 0x35
VocalFan commented 6 months ago

Okay, so I confirmed that STATUS_OBJECT_NAME_COLLISION is the actual error code, but... That doesn't work with your ERROR_FILE_EXISTS unwrapping, it just errors anyways with access denied.

I printed your Err(Error::from_raw_os_error(ERROR_FILE_EXISTS.try_into().unwrap())) and got... The file exists. (os error 80)

ultimaweapon commented 6 months ago

Wait, the previous version already correct. The error you got came from another issue so I will revert my last commit.