Updated Getting Started (markdown)

espes 2015-07-24 00:38:40 +10:00
parent 88c4fd9842
commit 920dae8903
1 changed files with 10 additions and 17 deletions

@ -6,31 +6,30 @@
./configure --cc=clang --enable-opengl --disable-vnc --disable-user --target-list=xbox-softmmu --extra-cflags="-march=native" --enable-debug ./configure --cc=clang --enable-opengl --disable-vnc --disable-user --target-list=xbox-softmmu --extra-cflags="-march=native" --enable-debug
make make
### For Windows ### For Windows
It's complicated (and not recently tested)! See FK's [excellent writeup](https://docs.google.com/document/d/1vW1XAdqC4r8RP6Vfb3F3cOulVuRIDBElGZx94JlIe4c/pub). It's complicated and unmaintained! FK posted an [excellent writeup](https://docs.google.com/document/d/1vW1XAdqC4r8RP6Vfb3F3cOulVuRIDBElGZx94JlIe4c/pub) months ago, but nobody's succeeded since.
### For Linux ### For Linux
#### Requirements: #### Requirements:
* Python 2 * [Everything QEMU requires](http://wiki.qemu.org/Hosts/Linux)
* Clang * Clang
* EGL/GL or GLX/GL * OpenGL with GLX and GLEW
For **Debian** most build dependencies can be installed by running: For **Debian** most build dependencies can be installed by running:
apt-get build-deps qemu apt-get build-deps qemu
apt-get install libglew-dev libtxc-dxtn-s2tc0 apt-get install libglew-dev libtxc-dxtn-s2tc0
If you have success with other distributions, please let us know in #xqemu on Freenode.
#### Building: #### Building:
./configure --cc=clang --enable-opengl --disable-vnc --disable-user --enable-kvm --disable-xen --target-list=xbox-softmmu --enable-debug --audio-drv-list=alsa --python=/usr/bin/python2 --extra-cflags="-march=native" ./configure --cc=clang --enable-opengl --disable-vnc --disable-user --enable-kvm --disable-xen --target-list=xbox-softmmu --enable-debug --audio-drv-list=alsa --python=/usr/bin/python2 --extra-cflags="-march=native"
make make
Make sure you make python point at your python2. Python 3 won't work. A version compiled with KVM can still be used with TCG, hence I'd recommend compiling with KVM. QEMU should automaticly disable the KVM compilation if your target CPU is not suitable. Make sure you make python point at your python2. Python 3 won't work.
## Run XQEMU ## Run XQEMU
XQEMU is a Low-Level Emulator, so you need to find a copy of the stuff the Xbox runs when it turns on: XQEMU is a Low-Level Emulator, so you need to find a copy of the stuff the Xbox runs when it turns on:
* Xbox MCP-X boot rom * Xbox MCP-X boot rom
* Xbox 1.0 compatible bios (cromwell, 3944, 4034, 4036 or 4627) * Xbox 1.0 compatible bios (cromwell, 3944, 4034, 4036, ...)
* Xbox dashboard files * Xbox dashboard files on a disk image
Here are some hashes. Check them to avoid common problems: Here are some hashes. Check them to avoid common problems:
@ -38,10 +37,10 @@ Here are some hashes. Check them to avoid common problems:
MD5 (3944_1M.bin) = e8b39b98cf775496c1c76e4f7756e6ed MD5 (3944_1M.bin) = e8b39b98cf775496c1c76e4f7756e6ed
MD5 (3944_256k.bin) = 542c62cb976a4993c8c5027dff9638ce MD5 (3944_256k.bin) = 542c62cb976a4993c8c5027dff9638ce
If your mcpx_1.0.bin has an MD5 196a5f59a13382c185636e691d6c323d you dumped it badly. It has a preceeding byte 0x7F which has to be removed (So the file starts with 0x33 0xC0 ..). Additionally one byte 0xEE has to be added to the very end of the file (So the file ends with .. 0x02 0xEE). If your mcpx dump has an MD5 of 196a5f59a13382c185636e691d6c323d you dumped it badly. It should start with 0x33 0xC0 and end with 0x02 0xEE.
Create an Xbox hard-disk image: Create an Xbox hard-disk image:
* Create an xboxhdm cd-rom with the dashboard files * Create an [xboxhdm](http://sourceforge.net/projects/xboxhdm2/) cd-rom with the dashboard files
* Create a blank hard-disk file: ```qemu-img create -f qcow2 xbox_harddisk.qcow2 8G``` * Create a blank hard-disk file: ```qemu-img create -f qcow2 xbox_harddisk.qcow2 8G```
* Run xboxhdm with qemu or something: ```i386-softmmu/qemu-system-i386 -hda xbox_harddisk.qcow2 -cdrom linux.iso``` * Run xboxhdm with qemu or something: ```i386-softmmu/qemu-system-i386 -hda xbox_harddisk.qcow2 -cdrom linux.iso```
@ -49,16 +48,10 @@ Launch XQEMU with something like...
xbox-softmmu/qemu-system-xbox -cpu pentium3 -machine xbox,bootrom=mcpx_rom.bin -m 64 -drive file=xbox_harddisk.qcow2,index=0,media=disk,locked=on -drive index=1,media=cdrom -bios xbox_bios.bin -usb -device usb-xbox-gamepad xbox-softmmu/qemu-system-xbox -cpu pentium3 -machine xbox,bootrom=mcpx_rom.bin -m 64 -drive file=xbox_harddisk.qcow2,index=0,media=disk,locked=on -drive index=1,media=cdrom -bios xbox_bios.bin -usb -device usb-xbox-gamepad
You can run with KVM acceleration on Linux with: On Linux, you can use [KVM](http://www.linux-kvm.org/page/Main_Page) by passing 'accel=kvm,kernel_irqchip=off' to -machine. This is not yet recommended.
xbox-softmmu/qemu-system-xbox -cpu pentium3 -machine xbox,bootrom=mcpx_1.0.bin,accel=kvm,kernel_irqchip=off -m 64 -drive file=xbox_harddisk.qcow2,index=0,media=disk,locked=on -drive index=1,media=cdrom -bios 3944_1M.bin -usb -device usb-xbox-gamepad
Finally, you can run with TCG acceleration using:
xbox-softmmu/qemu-system-xbox -cpu pentium3 -machine xbox,bootrom=mcpx_1.0.bin,accel=tcg -m 64 -drive file=xbox_harddisk.qcow2,index=0,media=disk,locked=on -drive index=1,media=cdrom -bios 3944_1M.bin -usb -device usb-xbox-gamepad
## Debugging Tips ## Debugging Tips
* QEMU can host a gdb stub! Launch with ```-s -S```, and with gdb run `target remote localhost:1234` * QEMU can host a gdb stub! Launch with ```-s -S```, and with gdb run `target remote localhost:1234`
* Protip: You can also attach to it with [IDA](https://www.hex-rays.com/products/ida/) if you're so inclined. You can then load in a database if you export it as a IDC script! * Protip: You can also attach to it with [IDA](https://www.hex-rays.com/products/ida/) if you're so inclined. You can then load in a database if you export it as a IDC script!
* XQEMU can emulate a XDK serial port (which with a debug bios hosts KD, as in [this](http://msdn.microsoft.com/en-us/library/hh406279.aspx) and [this](http://www.reactos.org/wiki/Techwiki:Kd))! Launch with something like ```-device lpc47m157 -serial unix:/tmp/xserial,server```. With some effort you can wrestle the unix socket into a vm for with WinDbg. There's also a very barebones perl KD client in scripts/windpl * XQEMU can emulate a XDK serial port (which with a debug bios hosts KD, as in [this](http://msdn.microsoft.com/en-us/library/hh406279.aspx) and [this](http://www.reactos.org/wiki/Techwiki:Kd))! Launch with something like ```-device lpc47m157 -serial unix:/tmp/xserial,server```. With some effort you can wrestle the unix socket into a vm for with WinDbg. There's also a very barebones perl KD client in scripts/windpl
* You can preceed your command line with apitrace trace -a egl (in case of EGL, change it for "glx" and "cgl") to generate an apitrace. * [apitrace](https://apitrace.github.io/) is useful for tracking down rendering bugs.