The ZMan:So how does the Xna Framework on the Xbox call the native DirectX, Xact, Xinput and Xbox libraries?
With great difficulty :-)
Obviously there is a mechanism for calling from managed -> native, but it isn't anything nice like pinvoke on Windows. More like the DOS BIOS call mechanism if anything, if you remember how that worked, except with separate address spaces to make things even more awkward. We have to statically register all the interop functions during kernel startup (the whole kernel is just one static executable, there is no plugin mechanism), and then when managed code jumps into these available entrypoints, it can only marshall across a small number of primitive type parameters. Any more complicated or larger data needs to be manually transferred in both directions, using copy helper functions to transfer ranges of bits from one address space to the other.
Quite apart from the lack of a plugin mechanism, this is not the kind of developer experience I would wish on my worst enemy :-) It is one thing for us to take on the pain of making a small and carefully scoped set of APIs work across this boundary, but would be quite another to attempt to document all this, and then support other people who aren't experienced kernel level developers getting their code running in such an environment. Little details like the complete lack of any way to debug native code across the user mode boundary can cause a lot of developer pain: this is much much lower level than even regular native coding on Xbox.
XNA Framework Developer -
blog -
homepage