XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 04:35:16 PM


Login with username, password and session length


Pages: 1 2 3 »
  Print  
Author Topic: How to use your 8050L or 3120L in Windows & Linux, the plug & play way!  (Read 38570 times)
MacDennis
Xbox Hacker
*****
Posts: 614


View Profile
« on: April 14, 2006, 06:30:25 PM »

Hi all,

I wanted to share a nice trick with you guys which I'm currently using to talk with my 8050L and 3120L drives.

How about a way to talk with these drives in Windows / Linux without the need for: reboots, open computer cases, hotswap tricks, a dedicated Linux pc and funky ide/sata adapters?

Well, here's how. You will need the following:


On with the show ..

Follow this guide to install Ubuntu inside the VM player virtual machine on your PC, I assume your host is WindowsXP:
http://johnbokma.com/mexit/2005/11/07/vmware-player-ubuntu-installation.html

If Ubuntu is up and running on your Windows machine inside the virtual machine then use this guide to compile and upgrade your kernel to a fresh copy:
http://www.ubuntuforums.org/showthread.php?t=56835
It would be wise to enable the two usb driver debugging options while configuring the kernel.

If the new kernel is up and running then it's time to play with the adapter. I have been testing both the 8050L and 3120L drive in this virtual Ubuntu environment. The USB adapter was picked up by Linux and Windows without any problems. Ubuntu / Linux completey detected hotplugging of the adapter. Normal PC drive worked fine attached to the adapter in both environment. The 8050L and 3120L didn't. If you enable the USB debugging option then debug messages regarding the detection of these drives will appear in dmesg / syslog. After some research I came to the conclusion that Linux sends a normal ATAPI inquiry command. Note that Windows uses an ATA command to detect devices on an IDE port.

The Linux ATAPI inquiry command failed for the 8050L and 3120L drives. I also verified this with my LA connected on the ATA bus. No inquiry data was being transmitted to the host. This is why these drives don't work with an USB adapter in Linux and Windows. After some more research I discovered that the Linux usb-storage can be modified to also accept devices/drives which do not behave according to specs. The source of the usb-storage driveris located at /usr/src/linux/drivers/usb/storage.

I added an extra entry to the file unusual_devices.h for my specific USB ada. You will need the vendor and product ID of the adapter but you can find that in the device manager of Ubuntu. You need to add an entry which has the 'fix inquiry' statement. Plenty of examples in the file. Then you can 'fake' the inquiry data by providing your own inquiry data in this entry. The usb-storage driver won't send the inquiry command to the drive but will use the info you provided. I then compiled the usb-storage drive to a kernel module. I installed it to the system by using rmmod usb-storage and insmod usb_storage.ko. This first removes the usb storage driver from the running kernel and then loads the new patched driver.

Then it was time to test adapter again. The 8050L drive was detected immediately. Ubuntu auto-mounted xbox/x360 disc which I could browse without any problems. plscsi also worked fine to talk with the drive at /dev/sda. Only the inquiry command returns the fake data.

The beauty of the adapter is that it supports both IDE and SATA devices. It's a pretty safe 'hotplug' solution for these devices. It's also nice that you don't need to reboot your OS after flashing a LG drive. Just power the drive off and on and you are good to go again. The OS will immediately pickup the changes. That's how I have been testing the sector flasher, by changing the inquiry string of the 8050L drive.

Here's how to use the 3120L in Linux. First unplug the usb adapter. Connect the 3120L drive to the adapter using the SATA connection on the adapter. Power on the console. Now plug in the usb adapter, VM Player and Ubuntu should pick up the adapter. After a while the drive should also be detected and if a disc is in the drive, the disc should be auto-mounted. Now you can use plscsi to talk with the drive. To enter modeb, simple use the linux tool made by SeventhSon to force modeb. The disc will spin up loudly if the drive enters modeB. You can use plscsi to play with the drive, you can even use the sector flasher to brick your drive.  Wink The drive will stay in modeb, even if you unplug the usb adapter.

How to use the 3120L in Windows then? Simply. VM Player 'owns' the usb adapter, Windows can't use it because VM Player has taken control. Simply click on the usb adapter in the title bar of VM Player. This will disable the adapter in the virtual machine and Windows will now pick it up correctly. But it will also pick up the drive and the disc automatically! No need to reboot, no need to rescan for hardware changes. Now you can do whatever you need to do on the drive in Windows. If you need the drive in Linux again, simply enable the adapter in VM player again.

I have been testing the sector flashing tool on these drives by using this method without any problems at all.

Hope this helps. If you have any questions, feel free to ask.
Logged
Slack3er
Master Hacker
****
Posts: 110


View Profile
« Reply #1 on: April 14, 2006, 07:03:11 PM »

VERY impressive work, MacDennis.  Smiley More tools to play with, lol.  Grin

Small Tip: For those who are TOO lazy or uncomfortable installing linux. You can find pre-built linux virtual machines here: Ex. Gentoo, Debian, Ubuntu. Or FreeBSD  Grin
http://www.vmware.com/vmtn/appliances/directory/

Or you can find the pre-built Ubuntu VM here. Hopefully it will save you from installing..  Wink
http://cdimage.ubuntu.com/vmware/Ubuntu-5.10.zip

Regards;
Logged
vu2vu
Member
**
Posts: 20


View Profile
« Reply #2 on: April 14, 2006, 07:05:59 PM »

Thanks for the tips MacDennis.  I already have a linuxbox but didn't know I could use a usb-sata adapter to flash.  Now I have a reason to crack my warranty seal on my xbox 360.
Logged
probutus
Master Hacker
****
Posts: 394

$#!t happens


View Profile
« Reply #3 on: April 14, 2006, 07:32:03 PM »

finally, my usb to sata adapter arrived and I could do some basic testing...
I did some modifications to usb.c which makes a generic approach for attaching the xbox drives through usb adapters:

http://rapidshare.de/files/18025453/usb.c.html (it is for the 2.6.16.1 kernel)

You can do the following:
modprobe usb-storage fix_inq_vendor_id="your adapters' vendor id"  fix_inq_prod_id="your adapters' product id"

I will upload a slax iso containing the module so that life can get much easier, and yes I discovered this by using MacDennis' "A few beers" option  Wink
« Last Edit: April 14, 2006, 07:34:08 PM by probutus » Logged
patx
Hacker
***
Posts: 68


View Profile
« Reply #4 on: May 13, 2006, 08:06:46 AM »

I need help with the new entry, here is what I did.

I installed the wmware player and downloaded  this pre-built Ubuntu VM »»» http://cdimage.ubuntu.com/vmware/Ubuntu-5.10.zip ...
when you browse to the file system, /usr/src/ is empty cause this version of ubuntu have no sources... to get the sources, first i created a root account to ubuntu, when I was logged as root I commented the first line of /etc/apt/sources.list ( deb cdrom...) and then I did apt-get install linux-headers-2.6.12-9-386...

Now I have 2 files (Kconfig + makefile) in /usr/src/linux-headers-2.6.12-9-386/drivers/usb/storage but I need more infos from this point... where do I write this new entry ?!?


I added an extra entry to the file unusual_devices.h for my specific USB ada. You will need the vendor and product ID of the adapter but you can find that in the device manager of Ubuntu. You need to add an entry which has the 'fix inquiry' statement. Plenty of examples in the file.

@mcdennis: Can you post your modded file or provide an example !?!? I didn't see any in my files...
Logged
sindri1980
Member
**
Posts: 14


View Profile
« Reply #5 on: May 13, 2006, 08:15:56 AM »

I think the process is much easier If you use the live-cd uploaded by Probutus. That way I got my drive recognized by linux (thanks Probutus for your help), but what I don´t know now is how to put the drive in modeb...
It´s not really a plug and play method, I guess
Logged
SeventhSon
Global Moderator
Master Hacker
*****
Posts: 276


View Profile WWW
« Reply #6 on: May 13, 2006, 09:24:53 AM »

... I got my drive recognized by linux (thanks Probutus for your help), but what I don´t know now is how to put the drive in modeb...
Here's a piece of Linux code that will put the drive into modeB.

http://www.kev.nu/360/code/modeb.c

This is the app that MacDennis was talking about in the second to last paragraph.

-Kev
Logged
sindri1980
Member
**
Posts: 14


View Profile
« Reply #7 on: May 13, 2006, 09:52:57 AM »

Yes, I have that app, but I don´t know how to use it. I´m a really new to Linux. Anyway I managed to get my drive recognized by Linux using the Live-cd. I could see the contents of a game, but I´m stuck at that point.
Today I tried "./modeb.c" but I only got a few error messages about command lines, I probably did it wrong. So, once that I have the drive seen by Linux, ¿which are the commands to use the modeb app? Thanks!
Logged
BlueCop
Master Hacker
****
Posts: 316


"When the going gets weird, the weird turn pro."


View Profile
« Reply #8 on: May 13, 2006, 09:56:23 AM »

sindri1980: The Live CD puts the drive into mode b for you. You can then reboot into windows without powering down the drive or some other operating system and the drive will remain in mode b.
Logged
sindri1980
Member
**
Posts: 14


View Profile
« Reply #9 on: May 13, 2006, 09:58:36 AM »

Really?, i´ve already tried this and Windows doesn´t see it at all...
After getting the drive recognized, I reboot using ctrl + alt + del, without plugging off the USB adapter, but nothing happens in Windows.
Logged
BlueCop
Master Hacker
****
Posts: 316


"When the going gets weird, the weird turn pro."


View Profile
« Reply #10 on: May 13, 2006, 10:04:08 AM »

try going into the device manager and see if its there. you might have to go into its properties and populate the drive.
Logged
sindri1980
Member
**
Posts: 14


View Profile
« Reply #11 on: May 13, 2006, 10:05:19 AM »

Done that as well, I only see an error icon in the Usb Mass Storage driver in Windows device manager...
Logged
patx
Hacker
***
Posts: 68


View Profile
« Reply #12 on: May 13, 2006, 10:22:56 AM »

I think the process is much easier If you use the live-cd uploaded by Probutus. That way I got my drive recognized by linux (thanks Probutus for your help), but what I don´t know now is how to put the drive in modeb...
It´s not really a plug and play method, I guess

Yeah !!! but what I want is to test the samsung + mtkflasher using mcdennis method with my usb.brando adapter...So can someone help me with the entry?!?!

this thread has gone offtopic... for help with probutus slax iso. use this thead »»»  http://www.xboxhacker.net/index.php?option=com_smf&Itemid=33&topic=350.0
« Last Edit: May 13, 2006, 10:27:02 AM by patx » Logged
MacDennis
Xbox Hacker
*****
Posts: 614


View Profile
« Reply #13 on: May 13, 2006, 04:43:13 PM »

Now I have 2 files (Kconfig + makefile) in /usr/src/linux-headers-2.6.12-9-386/drivers/usb/storage but I need more infos from this point... where do I write this new entry ?!?

The answer was in your reply actually ..
I added the entry to the file 'unusual_devices.h'.
The data in the entry depends on your usb adapter. My entry:
UNUSUAL_DEV(0x152d, 0x23888, 0x0100, 0x0100,
"HL-DT-ST",
"BRIDGE",
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_INQUIRY),

That's it. I compiled the usb driver to a kernel module and I can now load and unload it with the rmmod and insmod commands.
Logged
probutus
Master Hacker
****
Posts: 394

$#!t happens


View Profile
« Reply #14 on: May 14, 2006, 10:00:13 AM »

Hi,

to avoid confusion I have to admit some things:

when you use the usb adapter the drive is not put automatically into mode b (we simply fake the inquiry response for the usb/scsi driver). So if you want to use your drive also in windows you have to execute "modeb" in the live cd commandline (do not forget to add the *mo packages already posted in the 3120Linux thread)

When using the ide-cd (via sata/pata driver or siimage) driver the drive is put into modeb automagically. I could not do this for the usb driver (yet) since mine recently thinks the 360 drive is a harddisk  Huh I am currently looking into this

EDIT:
The usb-storage driver I included in the live cd needs some additional parameters for the vendor and product id (since there are a lot of adapters out there with different ids) so please do the following to get the livecd with the usb dongle working:

-boot the livecd WITHOUT the usb adapter connected
-login as root
- enter "modprobe usb-storage fix_inq_vendor_id=0xYOUR_USB_DONGLE_VENDOR_ID fix_inq_product_id=0xYOUR_USB_DONGLE_PRODUCT_ID_HERE"
e.g:
modprobe usb-storage fix_inq_vendor_id=0x152d fix_inq_product_id=0x2338
- then connect the usb connector with the drive to usb
- the drive should be recognized by now...
- then enter "modeb" (this only works with the *mo package in the modules directory of the livecd)
« Last Edit: May 14, 2006, 10:21:22 AM by probutus » Logged
sindri1980
Member
**
Posts: 14


View Profile
« Reply #15 on: May 14, 2006, 10:26:44 AM »

That really clarifies everything a lot more. Anyway, you are all the time talking about "mo packages", but I only found one in the thread: 360_dvd_base.mo
Are there more?
Thanks!
Logged
probutus
Master Hacker
****
Posts: 394

$#!t happens


View Profile
« Reply #16 on: May 14, 2006, 10:31:03 AM »

sorry for the typo... there is only one package containing SeventhSons tools (along with modeb and the mn10300 binutils package)
Logged
patx
Hacker
***
Posts: 68


View Profile
« Reply #17 on: May 14, 2006, 10:53:15 AM »

Now I have 2 files (Kconfig + makefile) in /usr/src/linux-headers-2.6.12-9-386/drivers/usb/storage but I need more infos from this point... where do I write this new entry ?!?

The answer was in your reply actually ..
I added the entry to the file 'unusual_devices.h'.
The data in the entry depends on your usb adapter. My entry:
UNUSUAL_DEV(0x152d, 0x23888, 0x0100, 0x0100,
"HL-DT-ST",
"BRIDGE",
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_INQUIRY),

That's it. I compiled the usb driver to a kernel module and I can now load and unload it with the rmmod and insmod commands.

Thankx, downloading the sources wasn't enought, after compiling  the kernel I now have a folder named linux in /usr/src/ and a file unsual_devs.h in /usr/src/linux/drivers/usb/storage...

I added the new entry as on this capture :



Does it look good ?!?! I am kind of a noob with compling kernels & modules... can someone point me a "how to" compile & install the driver to a  kernel module ?!
« Last Edit: May 14, 2006, 10:57:55 AM by patx » Logged
probutus
Master Hacker
****
Posts: 394

$#!t happens


View Profile
« Reply #18 on: May 14, 2006, 11:05:04 AM »

The edit looks good;

please do the following in the console (as root)

cd /usr/src/linux
make modules

afterwards, you can pick the modified usb-storage in /usr/src/linux/drivers/usb/storage/usb-storage.ko
this module needs to be copied to /lib/modules/YOUR_KERNEL_VERSION/kernel/drivers/usb/storage/
please  backup the original usb-storage.ko to usb-storage.ko.bak  (just if something goes wrong)

please do not forget to check your usb-dongles' product and vendor id to match the entry (in this case 0x152d and 0x2338) This can be done by plugging in the dongle and doing a "lsusb"
Logged
patx
Hacker
***
Posts: 68


View Profile
« Reply #19 on: May 14, 2006, 06:42:56 PM »

thankx mcdennis & probutus it works !!!
Logged
Pages: 1 2 3 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM