Jump to content


Photo

Development : Xboxhdm ( Usb Edition)


  • Please log in to reply
22 replies to this topic

#1 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 23 April 2008 - 07:31 AM

Caution: None of this is likely to work and do not use it to rebuild your xbox - at least not until the thing is finished. This is a work in progress.


Concept of current xboxhdm:
xboxhdm currently uses option 1,2 to do xbox hdd preparation and this is based on kernel 2.4 as FATX support works well only in this version. option 3 is used for locking/unlocking and this uses kernel 2.6 as the underlying kernel support for the low-level IDE stuff only exists for that option.

Current weaknesses:
1. xboxhdm restricts you to using the primary master IDE to connect your xbox hdd.
2. xboxhdm forces you to reboot in between xbox hdd preparation and locking.
3. xboxhdm does not support USB booting.
4. xboxhdm requires an additional IDE connection for the cdrom. Modern PCs have only 1 IDE connection.
5. xboxhdm cannot do hotswapping to USB/IDE connections.

Solution:
1. Modify xboxhdm to boot from USB devices: flash drives, portable hdd etc
2. This eliminates the need for 2 IDE connections. Only 1 IDE is needed for the xbox hdd.
3. This also means the IDE connection can be any of the 4 possibilities: primary/secondary master/slave.

Detailed Solution:
1. Find a modern 2.6 Linux distribution that supports USB booting and is small enough to fit onto a 512MB flash drive.
2. Use qemu to emulate the 2.4 kernel for FATX support within the 2.6 host.
3. Modify ldot's locking scripts to work in the new environment.
4. Remove the menu for option 1,3,4 in xboxhdm in the 2.4 guest.
5. Use qemu to emulate a cdrom and run from the iso file. This frees the physical IDE connection restriction.
6. Update shell scripts to reference the new paths for eeprom, c folder, e folder etcs.

To be continued...










Replacement files in linux folder of xboxhdm:

CODE

begin-base64 700 message.txt
ICAgXyAgX18gX18gICAgICAgICBfICBfXyAgICBfXyAgX19fX19fICAgICBf
XyAgX19fICAgICAgX18gICAgICAgICAgICAKICB8IHwvIC8vIC9fICBfX19f
IHwgfC8gLyAgIC8gLyAvIC8gX18gXCAgIC8gIHwvICAvX19fIF8vIC9fX19f
XyAgX19fX18KICB8ICAgLy8gX18gXC8gX18gXHwgICAvICAgLyAvXy8gLyAv
IC8gLyAgLyAvfF8vIC8gX18gYC8gLy9fLyBfIFwvIF9fXy8KIC8gICB8LyAv
Xy8gLyAvXy8gLyAgIHwgICAvIF9fICAvIC9fLyAvICAvIC8gIC8gLyAvXy8g
LyAsPCAvICBfXy8gLyAgICAKL18vfF8vXy5fX18vXF9fX18vXy98X3wgIC9f
LyAvXy9fX19fXy8gIC9fLyAgL18vXF9fLF8vXy98X3xcX19fL18vICAgICAK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX18K
ICAgICAgICAgICAgICAgICAgICAgICAgIF9fX18gX19fX18gIF9fX18vIC8K
ICAgICAgICAgICAgICAgICAgICAgICAgLyBfXyBgLyBfXyBcLyBfXyAgLyAK
ICAgICAgICAgICAgICAgICAgICAgICAvIC9fLyAvIC8gLyAvIC9fLyAvICAK
ICAgICAgICAgICAgICAgICAgICAgICBcX18sXy9fLyAvXy9cX18sXy8gICAK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIF9fICAgICAgICAgICAgICBfXwogICBfX19fX19fXyAgX19fX19fX19f
IF8gICBfX19fXyAgX19fX19fXyAgX18gICAvIC9fX19fXyAgX19fXyAgLyAv
CiAgLyBfX18vIF8gXC8gX19fLyBfXyBcIHwgLyAvIF8gXC8gX19fLyAvIC8g
LyAgLyBfXy8gX18gXC8gX18gXC8gLyAKIC8gLyAgLyAgX18vIC9fXy8gL18v
IC8gfC8gLyAgX18vIC8gIC8gL18vIC8gIC8gL18vIC9fLyAvIC9fLyAvIC8g
IAovXy8gICBcX19fL1xfX18vXF9fX18vfF9fXy9cX19fL18vICAgXF9fLCAv
ICAgXF9fL1xfX19fL1xfX19fL18vICAgCiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIC9fX19fLyAgICAgICAgICAgICAgICAgICAgICAg
ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAKICAgICAgIDEpIEJvb3QgdGV4dC1jb25zb2xlIHdpdGggeGJveC1kcml2
ZSB1dGlsaXRpZXMK
====


CODE

begin-base64 700 isolinux.cfg
ZGVmYXVsdCAxCnByb21wdCAxCnRpbWVvdXQgMzAwCmRpc3BsYXkgbWVzc2Fn
ZS50eHQKbGFiZWwgMQogIGtlcm5lbCAvaXNvbGludXgvZmF0eEltYWdlCiAg
YXBwZW5kIGluaXRyZD1pbml0cmQuZ3ogbG9hZF9yYW1kaXNrPTEgcHJvbXB0
X3JhbWRpc2s9MCByYW1kaXNrX3NpemU9MjQwMDAgcncgcm9vdD0vZGV2L3Jh
bSBwY2k9Ymlvc2lycQo=
====


As the source code for ldot's detectpm and we now need to support the hdd on any of the 4 ide, I modified hdparm to do the same thing: display the security settings, hdd model , serial no:

CODE

begin-base64 700 hdsecinfo
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1
ZGUgPGVycm5vLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KI2luY2x1ZGUgPGxp
bnV4L3R5cGVzLmg+CiNpbmNsdWRlIDxlbmRpYW4uaD4KI2luY2x1ZGUgPHN5
cy9pb2N0bC5oPgojaW5jbHVkZSA8c3lzL3NobS5oPgojaW5jbHVkZSA8bGlu
dXgvdHlwZXMuaD4KI2luY2x1ZGUgPGxpbnV4L2hkcmVnLmg+CiNpbmNsdWRl
IDxsaW51eC9tYWpvci5oPgojaW5jbHVkZSA8YXNtL2J5dGVvcmRlci5oPgoj
aW5jbHVkZSA8c3lzL2ZjbnRsLmg+CiNpZiBfX0JZVEVfT1JERVIgPT0gX19C
SUdfRU5ESUFOCiNkZWZpbmUgX19VU0VfWE9QRU4KI2VuZGlmCgojaW5jbHVk
ZSAiaGRwYXJtLmgiCgovKiBkZXZpY2UgdHlwZXMgKi8KLyogLS0tLS0tLS0t
LS0tICovCiNkZWZpbmU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WxlZCIpOwogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIGdvdG8gaWRlbnRpZnlfYWJvcnQ7CiAgICAg
ICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAg
ICAgICAgICAgIGlkID0gKF9fdTE2ICopJmFyZ3NbNF07CiAgICAgICAgICAg
ICAgIAogICAgICAgICAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCAw
eDEwMDsgKytpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
X19sZTE2X3RvX2NwdXMoJmlkW2ldKTsKICAgICAgICAgICAgICAgICAgICAg
ICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpZGVudGlmeSgodm9pZCAq
KWlkKTsKCQlleGl0KDApOwppZGVudGlmeV9hYm9ydDoKCQkJOwoJCWV4aXQo
MSk7Cgp9CnZvaWQgcHJpbnRfYXNjaWkoX191MTYgKnAsIF9fdTggbGVuZ3Ro
KSB7CglfX3U4IGlpOwoJY2hhciBjbDsKCQoJLyogZmluZCBmaXJzdCBub24t
c3BhY2UgJiBwcmludCBpdCAqLwoJZm9yKGlpID0gMDsgaWk8IGxlbmd0aDsg
aWkrKykgewoJCWlmKCgoY2hhcikgMHgwMGZmJigoKnApPj44KSkgIT0gJyAn
KSBicmVhazsKCQlpZigoY2wgPSAoY2hhcikgMHgwMGZmJigqcCkpICE9ICcg
JykgewoJCQlpZihjbCAhPSAnXDAnKSBwcmludGYoIiVjIixjbCk7CgkJCXAr
KzsgaWkrKzsKCQkJYnJlYWs7CgkJfQoJCXArKzsKCX0KCS8qIHByaW50IHRo
ZSByZXN0ICovCglmb3IoOyBpaTwgbGVuZ3RoOyBpaSsrKSB7CgkJdW5zaWdu
ZWQgY2hhciBjOwoJCS8qIHNvbWUgb2xkZXIgZGV2aWNlcyBoYXZlIE5VTExz
ICovCgkJYyA9ICgqcCkgPj4gODsKCQlpZiAoYykgcHV0Y2hhcihjKTsKCQlj
ID0gKCpwKTsKCQlpZiAoYykgcHV0Y2hhcihjKTsKCQlwKys7Cgl9Cglwcmlu
dGYoIlxuIik7Cn0K
====


#2 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 23 April 2008 - 10:18 AM

SLAX 6 http://www.slax.org/ is found to be suitable. The shell scripts modifications are done. I'll highlight the important lines below:

Menu system:
CODE

   $echo "           1) Activate xboxhdm Stage 2 on Primary Master\n"
   $echo "           2) Activate xboxhdm Stage 2 on Primary Slave\n"
   $echo "           3) Activate xboxhdm Stage 2 on Secondary Master\n"
   $echo "           4) Activate xboxhdm Stage 2 on Secondary Slave\n"
   $echo "           5) Lock drive on Primary Master\n"
   $echo "           6) Lock drive on Primary Slave\n"
   $echo "           7) Lock drive on Secondary Master\n"
   $echo "           8) Lock drive on Secondary Slave\n"
   $echo "           9) Quit\n"


To run qemu, hda to change based on menu choice.
CODE

if [ "$cmd" = "yes" ]; then
    exec /usr/local/bin/qemu -hda /dev/hda -cdrom /mnt/sda/linux.iso -boot d
      fi


Locking:
CODE

    exec    /usr/local/bin/lockhd -a /dev/hda


In lockhd/unlockhd the changes are:

CODE

$echo "\n  Lock a HDD for use with the Xbox console"
         $echo "\n  Usage:    lockhd [-a] [-p] [-f] <device>"
         $echo "            -a  Automatically get password from Eeprom"
         $echo "            -p  Type in password on commandline"
         $echo "            -f  Get password from file only containing the password\n\n"
         $echo "            <device> IDE device to lock\n\n"
...

       case $1 in
          -a ) eeprom=1 device=$2;;
          -p ) pass=1 Epath=$2 device=$3
               shift;;
          -f ) pfile=1 Epath=$2 device=$3
               shift;;
          * ) usage; exit 1;;
       esac
       shift



I've also removed the cloning option, all functions related to floppy drive from the original xboxhdm. Reason is I feel that once the drive is unlocked, you are better off using other disk cloning tools that are Windows based or even dd for Linux.

Now I need a few things to round this up:

1. Is there a nice xbox-scene logo somewhere I can use as the bootup screen for this: I call it xboxhdm2 ?
2. Anybody wants to test this? Bear in mind very likely there are bugs everywhere since this is a major change of things. Preferable you have a single IDE connection, can boot from USB and your BIOS doesn't implement freeze lock. And you don't mind thrashing your drive tongue.gif

Edited by ldotsfan, 23 April 2008 - 10:20 AM.


#3 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 23 April 2008 - 10:52 AM

I just want to add: Slax supports booting from CD/DVD and DOS as well so xboxhdm2 will inherit those features.

#4 ugenn

ugenn

    X-S Member

  • Members
  • Pip
  • 86 posts
  • Location:Fucking, Austria
  • Xbox Version:unk
  • 360 version:unknown

Posted 23 April 2008 - 02:10 PM

why not just concentrate on getting fatx functional on 2.6? maybe using fuse.

#5 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 24 April 2008 - 01:11 AM

When FATX in 2.6 is mature, we can remove the qemu part. I am not optimistic as development effort in xbox linux is elsewhere and there hasn't been much progress since 3 or so years ago. I'm watching what lalee (from xbox linux) is doing though and hopes it works out.

#6 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 24 April 2008 - 11:03 AM

Image of the menu:

IPB Image

Stage 2 refers to the qemu emulation of the original xboxhdm (2.4 kernel). All the usual options in xboxhd are available except cloning and those functions for the floppy. In the boot menu, options 1,3 and 4 are taken out leaving 2.

The locking options will call lockhd -a on the respective hdd.

I've not included cloning in the menu but the script:clonehd is there should the user wants it.







#7 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 05 May 2008 - 03:02 PM

The tool has been released as an alpha release at: http://forums.xbox-s...howtopic=649031

Yet another untested feature:

1. In the slax folder, there is a make_iso.bat, you can use that to create an iso for example:
make_iso c:\linux.iso

Why do this when you can use the older version of xboxhdm? It might support SATA dvd/cd rom drives due to a newer kernel. But I don't have a SATA drive to test it with. And due to the change, the eeprom folder will change, so you have to type the full path to the eeprom.bin, which could be /mnt/hdX/eeprom/eeprom.bin where X depends on where your SATA dvd drive is connected to: a,b,c,d when you want to lock the hdd.

Edited by ldotsfan, 05 May 2008 - 03:03 PM.


#8 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 04 May 2009 - 04:27 PM

Some documentation on how I got hdd locking working. Should have read this thread. This was the key.

I recompiled the SLAX kernel from ftp://ftp.slax.org/source/slax/kernel/2.6.27.8/ , modified .config to turn on the CONFIG_IDE_TASK_IOCTL flag and replace the stock vmlinuz in SLAX's boot folder with my copy and the hdtool in xboxhdm2 (which I've recycled from xboxhdm) worked.

Also took the opportunity to update to SLAX 6.1.1 and reused ltools.lzm and qemu-0.9.1-i386.lzm from the alpha 1 release of xboxhdm2.

There's a lot of hidden gems in the old threads to pick from pop.gif

#9 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 06 June 2009 - 04:09 PM

Documenting the latest development:

1. Extracted out the FreeDOS disk image from xboxhdm for the hddisable, hdlock, hdunlock , unlockX and atapwd binaries and combined this with the FreeDOS files from FrostyTheSnowMan's 360 Modification USB Drive and the USB Drive Format Tool to create the xboxhdm2 equivalent - usb booting version of the DOS tools.

2. HX DOS extender : HX + Qemu + xboxhdm linux.iso = FreeDOS version of xboxhdm2? Not sure if there's any merits in pursuing the idea though. Is there any value for a DOS version of xboxhdm2? Especially if there is no eeprom support in the DOS version of the hdd locking tools. Faster boot time? FreeDOS is a lot leaner than SLAX used in xboxhdm2.

Edited by ldotsfan, 06 June 2009 - 04:11 PM.


#10 kingroach

kingroach

    X-S Hacker

  • Dev/Contributor
  • PipPipPipPipPipPip
  • 2,741 posts
  • Xbox Version:v1.4
  • 360 version:v5.0 (360S - trinity)

Posted 13 June 2009 - 01:07 PM

Freedos version of xboxhdm might be useful if a tiny dos eeprom can be made.. Then it can probably read the eeprom, read the lock/unlock keys and feed that data in hddunlock/hddlock. It shouldn't be that hard to make. Last time I did any C++ programming was like 2 years ago.. But I can try or anyone more experienced can step in.

#11 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 13 June 2009 - 07:49 PM

QUOTE(kingroach @ Jun 13 2009, 08:07 PM)  

Freedos version of xboxhdm might be useful if a tiny dos eeprom can be made.. Then it can probably read the eeprom, read the lock/unlock keys and feed that data in hddunlock/hddlock. It shouldn't be that hard to make. Last time I did any C++ programming was like 2 years ago.. But I can try or anyone more experienced can step in.

The old code for dos hddunlock and hddlock I can find were in Pascal and some parts in assembly. An alternative would be to adapt Xkutils for DOS.

I still have difficulty getting HX to work with Qemu though.

#12 obcd

obcd

    X-S Hacker

  • Moderator
  • PipPipPipPipPipPip
  • 2,737 posts
  • Xbox Version:v1.0
  • 360 version:none

Posted 13 June 2009 - 08:12 PM

It shouldn't be very hard to make a C equivalent of the pascal / assembly code. If you take a look at the ATA spec's, than the code pretty much explains itself. You can find the eeprom decoding sources in the liveinfo beta 3 sources. (and probably in other sources as well.)

I don't want to temper your enthousiasm, but the tendens for pc mobo's is totally removing the ide connectors. I know you have sata to ide converters, but I don't know if they are still supported in dos.
I don't think the legacy dos ports that are used to acces an ide port are still usable with such a converter.


regards.

#13 ldotsfan

ldotsfan

    X-S Messiah

  • Dev/Contributor
  • PipPipPipPipPipPipPip
  • 3,100 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 14 June 2009 - 04:09 AM

QUOTE(obcd @ Jun 14 2009, 03:12 AM)  


I don't want to temper your enthousiasm, but the tendens for pc mobo's is totally removing the ide connectors. I know you have sata to ide converters, but I don't know if they are still supported in dos.
I don't think the legacy dos ports that are used to acces an ide port are still usable with such a converter.
regards.

You have a point there - I forgot about one of the motivation for development of xboxhdm2 tongue.gif

Anyway the lxhdm boot disc and the existence of error 5 hotswapping technique will allow a softmod xbox owner to upgrade hdd even if PC motherboard remove all IDE connections eventually.

#14 QQ_ghost

QQ_ghost

    X-S Enthusiast

  • Members
  • 28 posts
  • Location:DFW, TX
  • Interests:Reverse engineering, modification, personalization.
  • Xbox Version:v1.0
  • 360 version:none

Posted 16 June 2009 - 06:53 AM

QUOTE(obcd @ Jun 13 2009, 01:12 PM)  

I don't want to temper your enthousiasm, but the tendens for pc mobo's is totally removing the ide connectors. I know you have sata to ide converters, but I don't know if they are still supported in dos.
I don't think the legacy dos ports that are used to acces an ide port are still usable with such a converter.
regards.


I have one such converter. If I could get the software you people have, I would happily test it. If you want to upload it to my server, just PM me and I'll set up an account and give you login details. I would love to help in any way I can. I am excellent at bash scripting too, if that can help.

#15 QQ_ghost

QQ_ghost

    X-S Enthusiast

  • Members
  • 28 posts
  • Location:DFW, TX
  • Interests:Reverse engineering, modification, personalization.
  • Xbox Version:v1.0
  • 360 version:none

Posted 16 June 2009 - 08:31 AM

BTW: for some polish, shouldn't the script be done with "dialog" (look at slackware install routine), or is it a bonus for most people to see what was last done through scrollback?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users