overdrivenpotato / rust-psp

Rust on PSP. Panic and allocation support. Access PSP system libraries.
Other
589 stars 31 forks source link

Init current working directory on startup #121

Closed MaxVerevkin closed 2 years ago

MaxVerevkin commented 2 years ago

This is what PSPSDK does.

Let me know if I should move rustfmt changes to a separate commit (or discard them).

sajattack commented 2 years ago

Just my opinion, but this seems like something that would be better as part of std.

MaxVerevkin commented 2 years ago

You mean rust std or psp std?

sajattack commented 2 years ago

You mean rust std or psp std?

rust-psp std :P (which will hopefully eventually become part of rust std) I've worked out a filesystem module (mostly), but haven't dealt with relative paths yet https://github.com/overdrivenpotato/rust/blob/1336f8fa79c3cc45daf38cf255ca5dcaa146c372/library/std/src/sys/psp/fs.rs#L260

MaxVerevkin commented 2 years ago

rust-psp std

Interesting. Do I need to compile (your) custom rust tool-chain to use it?

sajattack commented 2 years ago

Yeah, it hasn't been updated in quite some time, and was never easy to set up / use. But if you'd like to help us develop it, maybe we can chat more in the psp homebrew discord https://discord.gg/bePrj9W

MaxVerevkin commented 2 years ago

Hmmm, I don't understand how std is implemented now, but the entry point of the program is still in psp crate, right?

MaxVerevkin commented 2 years ago

Arguments that are passed to module_start are used to determine cwd, so I don't see how this can be a part of std at this point.

sajattack commented 2 years ago

Arguments that are passed to module_start are used to determine cwd, so I don't see how this can be a part of std at this point.

You might be right. I never quite figured out how to make it part of std. But it seemed like the logical place for it to me.