View Single Post
Old May 15th, 2008   #3 (permalink)
blueshogun96
Emu author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Unidentified
Posts: 2,162
I'm sorry, but that's not going to work. Xbox may have PC compatible hardware, but it exactly doesn't run like one and definitely doesn't execute like one. Sure the boot vector is the same, but the overall boot process and hardware initialization isn't. If you need some technical explanations, read below.

1. Since the Xbox uses an Intel x86 CPU, it does boot at the same address as a normal PC does (IIRC) which is 0xFFFFFFF0 (I'll explain more next). I don't exactly know how a PC bios initializes it's hardware, but an Xbox's bios is very hardware specific. If the code to properly emulate Xbox's hardware does not exist, then it won't boot. It's just like flashing your PC with an Xbox bios trying to turn it into an Xbox. Don't try this at home kids Another thing, before the Xbox even dreams of running any x86 code, it runs a secret "hidden" bios that configures certain hardware using PCI configuration statements. I'll explain more on this later (paragraph 4).

2. The Xbox's Pentium III processor is indeed identical to a PC's IA-32 CPU, but it has a few differences and oddities to it. One is the fact that when an instruction is executed at the top of the address space (0xFFFFFFFF, the BIOS occupies this area), if that last instruction is not a variation of "jump" or "call", the program counter/instruction pointer (EIP) will rollover to 0x00000000 without generating a page fault (#PF) exception. A normal PC will always do that, which is a problem. I'll explain more about this on the next paragraph why this is a problem. If that last instruction does redirect the EIP register, then it will expect the xbox's ram to be in a very exact location. More on this next.

3. I'm not sure how a PC maps it's physical memory, but an Xbox's physical memory is located at 0x00000000 - 0x03FFFFF for Xbox's with 64 MB, Debug Xboxes and moddified Xboxes that have 128 MB can expect 0x00000000 - 0x07FFFFFF. IIRC, 0x00000000 isn't even a mapped region of memory on a PC, whereas on an Xbox it's ram (which is executable memory) and the Xbox likes to insert executable code into ram during boot time.

4. The PC's and Xbox's PCI hardware works exactly the same, but the overall layout is different. Some PCI addresses that exist on PC don't exist on Xbox (or are in different locations). If Xbox's PCI isn't properly emulated, it won't boot.

5. There are other hardware specific things that would prevent this from being a reality. For instance, the Xbox's GPU (NV2A) and the Audio system (AC'97 audio codec, NVIDIA SoundStorm APU, Motorola 56000 DSP, Wolfson Micro DSP, possibly more chipsets) are similar to their PC counterparts, but not identical and have to be emulated to these exact specifications. Bochs doesn't even emulate this kind of hardware. It only emulates a standard VGA compatble card (the NV2A is too, but with exclusive registers), and a SoundBlaster sound card (IIRC). Then there is the controller. It's a USB compatible device and Xbox's USB 1.1 is exactly identical to a PC's, but code will still have to be written for it since it isn't a standard USB device. Also there is the PIC which is not identical to a PC's at all, and many more details, but I think I've stressed this enough already.

The reason I posted all of that is because some people tend to fight over ideas like this (both here once before, and other forums as well) so I just wanted to give the exact reasons why this won't work. Don't get me wrong, if you take the bochs source code and rewrite much of it to suit the needs of the Xbox, it can become an Xbox emulator (a painfully slow one at that), but just sticking your Xbox bios in the bios folder of bochs isn't going to work. Sorry.
__________________

[Sagat] Windows XP x64 Pro | AMD Athlon 3000+ (~2.0GHz) | NVIDIA GeForce 6600 PCI-E | Realtek AC97 Audio | 512MB Ram | NVIDIA NForce 4-4X chipset | Seagate HDD 160GB | LG 8614 DVD-ROM | HP DVD 1040d CD/DVD -/+ RW w/ LightScribe

GeneralEmu - December 27, 2005 and beyond!
My programming, emulation and Xbox blog! - Click or die! (Updated Thursday, October 2, 2008)
Visit my YouTube page! http://www.youtube.com/blueshogun96
blueshogun96 is offline   Reply With Quote