rust3ds / ctru-rs

Rust wrapper for libctru

Home Page:https://rust3ds.github.io/ctru-rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create a safe SVC module

Meziu opened this issue · comments

commented

svc is one of the most unsafe and dangerous interfaces of the 3DS' system. However, thanks to the current state of thing in the Rust ecosystem, we could do great things by implementing the svc wrapper to use Rust's async/awaitsyntax.

This has the potential become one of the strong points of our toolchain. Nontheless, development is impaired by the lack of threading support.

(I'm assuming the async/await stuff you're talking about would be wrapping over services/IPC. Sorry if this is the wrong place to ask about this)

I've been reading 3dbrew trying to learn about how IPC works, and looking at some example code online. It looks like getThreadCommandBuffer is necessary for constructing IPC commands but is not exposed in ctru-sys. How are things included/excluded from the bindings?

commented

(I'm assuming the async/await stuff you're talking about would be wrapping over services/IPC. Sorry if this is the wrong place to ask about this)

It is the wrong place (no worries though). I was talking specifically about the srv module.

I've been reading 3dbrew trying to learn about how IPC works, and looking at some example code online. It looks like getThreadCommandBuffer is necessary for constructing IPC commands but is not exposed in ctru-sys. How are things included/excluded from the bindings?

It seems the ctru-sys currently in master was built with a bindgen older than this PR, so static inline functions (like getThreadCommandBuffer) weren't included. We should update ctru-sys.

Could you elaborate more about your vision for this? I'm still confused about which parts of svc you're thinking of.

commented

After further research, this issue seems mostly impossible/out-of-scope/still to determine/unnecessary. If I find the right inspiration and ideas about something similar I'll open a more specific PR.