Hacking the Xbox
Hacking the Xbox
Hacking the Xbox
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
130<br />
<strong>Hacking</strong> <strong>the</strong> <strong>Xbox</strong>: An Introduction to Reverse Engineering<br />
HyperTransport bus<br />
reset line<br />
HyperTransport<br />
Data (200 MHz DDR)<br />
HyperTransport<br />
Clock<br />
Adjust clocking phase on a bit<br />
by bit basis to compensate for<br />
FPGA delays<br />
Dual-edge<br />
triggered<br />
data demux<br />
9 9<br />
D QP<br />
div by 2<br />
div by 2<br />
QN<br />
2x200 MHz<br />
SDR<br />
9<br />
4x100 MHz<br />
SDR<br />
Quad-phase<br />
data demux<br />
9<br />
DP QPP<br />
9<br />
QPN<br />
DN<br />
9<br />
QNP<br />
9<br />
QNN<br />
32-bit up<br />
counter<br />
RESET<br />
Align<br />
vs<br />
Clock Phase<br />
32<br />
4<br />
compare<br />
and trigger<br />
2 kB x 36<br />
deep FIFO<br />
memory<br />
Figure 8-7: Block diagram of <strong>the</strong> data logger built in <strong>the</strong> Xilinx Virtex-E FPGA.<br />
data<br />
sequence<br />
count<br />
logged<br />
data<br />
alignment<br />
automated place-and-route tool handle <strong>the</strong> non-critical parts of <strong>the</strong><br />
circuit. Figure 8-7 shows <strong>the</strong> overall design that was used to capture <strong>the</strong><br />
data on <strong>the</strong> HyperTransport bus.<br />
read<br />
strobe<br />
The design is fairly simple in concept: take <strong>the</strong> high speed data off of <strong>the</strong><br />
HyperTransport bus and clock it into four phases of a quarter speed clock,<br />
creating a data stream that is four times slower but four times wider. This<br />
confines all hand-placing and tweaking to just <strong>the</strong> first few input flip flops.<br />
Next, realign <strong>the</strong> data using a set of delays and rotators, and store <strong>the</strong> data<br />
one piece at a time inside a first in, first out (FIFO) memory. The signal that<br />
triggers <strong>the</strong> start of FIFO capture is generated by a timer-comparator that<br />
starts counting up from first reset. Long windows of data can be captured<br />
by concatenating <strong>the</strong> results of multiple runs, each with <strong>the</strong> capture trigger<br />
point delayed from <strong>the</strong> previous. A later optimization applied to <strong>the</strong> trigger<br />
circuit is a “do not store zeros” (DNSZ) function. In <strong>the</strong> DNSZ mode, data<br />
consisting of all 0’s is not stored in <strong>the</strong> FIFO. This is helpful in culling out<br />
all of <strong>the</strong> idle data on <strong>the</strong> HyperTransport bus. The resulting data traces are a<br />
time-stamped series of 32-bit words.<br />
The most difficult part of <strong>the</strong> FPGA data logger design was calibrating <strong>the</strong><br />
delays on <strong>the</strong> input paths. Delay calibration was accomplished by using an<br />
oscilloscope to probe a small window of data on <strong>the</strong> HyperTransport bus.<br />
Wire delays and byte-wide rotations were tweaked until <strong>the</strong> probed data<br />
matched <strong>the</strong> log data. This process was aided by <strong>the</strong> fact that during idle<br />
times, a common sequence of commands was repeated on <strong>the</strong> bus every<br />
few hundred microseconds, which served as <strong>the</strong> calibration reference.<br />
Determining <strong>the</strong> Bus Order and Polarity<br />
The final challenge after logging <strong>the</strong> data is figuring out <strong>the</strong> order of <strong>the</strong><br />
signals on <strong>the</strong> HyperTransport bus and <strong>the</strong>ir polarities. Note that while <strong>the</strong><br />
two most important signals of <strong>the</strong> HyperTransport bus on <strong>the</strong> <strong>Xbox</strong><br />
mo<strong>the</strong>rboard are labeled for us, <strong>the</strong> remaining eight data lines have ambiguous<br />
polarity and bit ordering.