MuscleNerd pointed out that some of the initrd kill offsets for 2.4.4-TiVo-3.0 on 3.1.1c did not match up:
Code:
{
"2.4.4-TiVo-3.0 from TiVo OS 3.1.1c",
0x8000432c, 0x8019f380, 0x0e6fae51, 0x801b8304, 0x40,
"\x02\x00\x28\x21" /* do as i say, not as i do. */
"\x3c\x1f\x80\x00"
"\x20\x1e\x00\x3a"
"\xa7\xfe\x4e\x4a"
"\x20\x1e\x00\x33"
"\xa7\xfe\x4e\x86"
"\x20\x1e\x00\x30"
"\xa7\xfe\x4e\x92"
"\x20\x1e\x00\x2e"
"\xa7\xfe\x4e\x9a"
"\x3c\x1f\x80\x12"
"\xaf\xe0\x68\xf0"
"\x3c\x1f\x80\x00"
"\x27\xff\x43\x2c"
"\x03\xe0\x00\x08"
"\x00\x00\x00\x00"
},
Based on the changes made by killinitrd-3.x at tivoutils.sf.net, these are the new offsets I came up with:
Code:
{
"2.4.4-TiVo-3.0 from TiVo OS 3.1.1c",
0x8000432c, 0x8019f380, 0x0e6fae51, 0x801b8304, 0x40,
"\x02\x00\x28\x21" /* do as i say, not as i do:
move $a1, $s0 */
"\x3c\x1f\x80\x00" /* lui $ra, 0x8000 */
"\x20\x1e\x00\x3a" /* li $s8, 0x003a */
"\xa7\xfe\x4e\x4a" /* sh $s8, 0x4e4a($ra) */
"\x20\x1e\x00\x33" /* li $s8, 0x0033 */
"\xa7\xfe\x4e\x66" /* sh $s8, 0x4e66($ra) */
"\x20\x1e\x00\x30" /* li $s8, 0x0030 */
"\xa7\xfe\x4e\x72" /* sh $s8, 0x4e72($ra) */
"\x20\x1e\x00\x2e" /* li $s8, 0x002e */
"\xa7\xfe\x4e\x7a" /* sh $s8, 0x4e7a($ra) */
"\x3c\x1f\x80\x12" /* lui $ra, 0x8012 */
"\xaf\xe0\x68\xf0" /* sw $zero, 0x68f0($ra) */
"\x3c\x1f\x80\x00" /* lui $ra, 0x8000 */
"\x27\xff\x43\x2c" /* addiu $ra, $ra, 0x432c */
"\x03\xe0\x00\x08" /* jr $ra */
"\x00\x00\x00\x00" /* nop */
},
Remember that byte 0x20 of the kernel image is loaded to 0x80002000 on all known Series2 (NEC Vr5432 based) kernels.
Does "do as I say, not as I do" refer to the weird offsets, or does it refer to taking $a1 (BORD type) from $s0 - something that clearly breaks when you are loading the kernel from something other than the TiVo PROM code?
Both the original code and the new code worked correctly when I tried them, but it is disturbing to see potential corruption of kernel memory.
Comments?