xboxscene.org forums

Author Topic: Xbox Gpu Drivers  (Read 143 times)

evanRogers

  • Archived User
  • Newbie
  • *
  • Posts: 2
Xbox Gpu Drivers
« on: October 08, 2004, 03:57:00 PM »

Hi,
I'm looking into extracting the xbox's GPU driver and porting it to xbox linux. I haven't found anyone else expressing an interest in doing this, but I have some questions for anyone who is knowledgeable. Also, please tell me if you have read about anyone doing this or something similar.

First, how legal is this? Will MS or nvidia try to sue the pants off of me? (This will be a non-profit project.)

Second, how should I go about doing this? So far the best resrouce i've found is Caustik's CXBX emulator project (http://www.caustik.com/cxbx/progress.htm) He writes that the gpu driver is a statically linked library packaged with every game binary. His emulator finds the library's address in the code segment so it can intercept calls to its functions. He has written source to do this which is available here:

http://cvs.sourceforge.net/viewcvs.py/cxbx...1.1&view=markup

Theoretically, could I use the same method to extract the library binary code so I could port it to a linux shared library?

---
Here's a variety of other technical questions:

Have there been similar projects in the past I could use as a reference, perhaps using different but similar binary executable file formats?

The source appears to only identify the Direct3D 8 library. I assume this means that games using OpenGL or later versions of Direct3D wouldn't work. Is this true? What other limitations or compatability issues might the driver have? I know the xbox can't handle high resolutions, for example. Would the Direct3D API be at all changed or extended to make use of the xbox's hardware? (like the unified memory, for example.)

Any ideas on what other parts of the .xbe would I need to extract? Like the kernel image thunk table or the Thread Local Storage structure? (The .XBE file format can be found below)

http://sourceforge.net/docman/display_doc....&group_id=56780

- Evan
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Xbox Gpu Drivers
« Reply #1 on: October 08, 2004, 10:08:00 PM »

QUOTE
First, how legal is this? Will MS or nvidia try to sue the pants off of me? (This will be a non-profit project.)

Depends on you local law. On bottom of Xbox-Linux page (which has a lot of reverse-engineered info) it says "Everything done on this project is for the sole purpose of writing interoperable software under Sect. 1201 (f) Reverse Engineering exception of the DMCA.". Violating copyright (ex. by copying and spreading code from Xbox's libraries) is offcourse illegal.

QUOTE
Theoretically, could I use the same method to extract the library binary code so I could port it to a linux shared library?

From what I know CXBX basically captures calls to the main Direct3D interface and passes them to a normal Windows Direct3D interface. I don't see how this Direct3D stuff would help in writing a driver for the Xbox Nvidia GeForce "2.5" (or "MX 3" as some call it smile.gif). DirectX is merely an API, the Nvidia GPU is the hardware.

QUOTE
I assume this means that games using OpenGL or later versions of Direct3D wouldn't work. Is this true?

All native Xbox games are DirectX 8 _only_. It's the only API in the XDK.

QUOTE
Would the Direct3D API be at all changed or extended to make use of the xbox's hardware?

Compared to the Windows one it has extra (Xbox-specific) functions, but not a lot of changes it terms of using the interface as a developer.

QUOTE
Any ideas on what other parts of the .xbe would I need to extract?

Why extract code from compiled and linked and optimized .XBEs when you can take "more raw" version of it from the XDK (if you have access to it)?

I have an idea you don't know exactly what you want. Do you want to
1) Run the MS driver for Nvidia on Linux? (impossible, different OS/kernel/everything/whatever)
2) Document the Nvidia GPU? (is being done already by reverse-engineering, but not finished)
3) Make DirectX on Linux possible? (see Wine).
Logged

evanRogers

  • Archived User
  • Newbie
  • *
  • Posts: 2
Xbox Gpu Drivers
« Reply #2 on: October 09, 2004, 01:45:00 AM »

QUOTE
From what I know CXBX basically captures calls to the main Direct3D interface and passes them to a normal Windows Direct3D interface. I don't see how this Direct3D stuff would help in writing a driver for the Xbox Nvidia GeForce "2.5" (or "MX 3" as some call it ). DirectX is merely an API, the Nvidia GPU is the hardware.


I don't plan on writing a driver, but finding the address of the driver library in the .xbe. CXBX appears to search the code segment for the functions in the library, but couldn't i theoretically also find the beginning and end of the library itself?

QUOTE
have an idea you don't know exactly what you want. Do you want to
1) Run the MS driver for Nvidia on Linux? (impossible, different OS/kernel/everything/whatever)
2) Document the Nvidia GPU? (is being done already by reverse-engineering, but not finished)
3) Make DirectX on Linux possible? (see Wine).


I want to run the ms driver for nvidia on linux. Aren't the OS and the kernel the same thing? Couldn't I emulate calls to the kernel the same way CXBX does?

QUOTE
Why extract code from compiled and linked and optimized .XBEs when you can take "more raw" version of it from the XDK (if you have access to it)?

You're right, I hadn't considered that, but it would probably be easier. I figured using a pirated copy of the xdk would destroy any chance that this might be considered legal reverse engineering. But if you're right about copying and distributing code (even compiled code?) from xbox libraries being illegal, then I guess I'm screwed anyways. If that were true, wouldn't distributing xbox games as roms be considered illegal then too?
Logged

TOOGAM

  • Archived User
  • Newbie
  • *
  • Posts: 26
Xbox Gpu Drivers
« Reply #3 on: October 11, 2004, 03:51:00 PM »

QUOTE (evanRogers @ Oct 9 2004, 08:45 AM)

I figured using a pirated copy of the xdk would destroy any chance that this might be considered legal reverse engineering.


That is true.

QUOTE (evanRogers @ Oct 9 2004, 08:45 AM)

But if you're right about copying and distributing code (even compiled code?) from xbox libraries being illegal, then I guess I'm screwed anyways.


That is also true.

QUOTE (evanRogers @ Oct 9 2004, 08:45 AM)

If that were true, wouldn't distributing xbox games as roms be considered illegal then too?


And yes, that is true too (assuming that by "xbox games" you are referring to official, commercial Xbox games).   In fact, that statement is the most blatantly true statement of any of these.
Logged