obhq / obliteration

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

Implement SYS_WRITE #825

Open VocalFan opened 5 months ago

VocalFan commented 5 months ago

Sys_write gets used 3 times before we hard crash on mdbg mode currently. (This is mainly just the memory issue that's being worked on)

We should implement sys_write, but maybe also potentially let it be in the log as well? Currently I use this:

        unsafe {
            let data_slice = std::slice::from_raw_parts(ptr, len);
            let text_output = String::from_utf8_lossy(data_slice);
            info!("DEBUG: SYS_WRITE - {}", text_output);
        }

Which we get (in order)

++++++++++++++++++ I [00:00:00:05:487]:0x0000000000004b74: kernel\src\fs\mod.rs:395
DEBUG: SYS_WRITE - **** Base Mode ****
++++++++++++++++++ I [00:00:00:06:104]:0x0000000000004b74: kernel\src\fs\mod.rs:395
DEBUG: SYS_WRITE - [NpMgrSdkInit    ] sceNpManagerPrxStart() sceNpArchInit failed. ret = 0x8055800a
++++++++++++++++++ I [00:00:00:06:104]:0x0000000000004b74: kernel\src\fs\mod.rs:395
DEBUG: SYS_WRITE - [Sysmodule(123) 792] libSceNpManager cannot be loaded (0x80020064)