PhatHack

The Hacking Hoedown => PhatBox Hacking => Topic started by: RobM on June 16, 2005, 10:37:54 PM

Title: Idea: Adding second hard disk
Post by: RobM on June 16, 2005, 10:37:54 PM
If it's possible to have two disks on the one IDE bus (i.e. if the PhatBox IDE controller supports master/slave)...

1) Mount the PB 20GB from the DMS internally and put our bigger HD in the DMS cart
2) Hack one of the players (and sign it with plsign)
3) Kill phatd/51d
4) umount /dos/Data
5) Mount our drive on /dos/Data
6) Restart phatd

Any ideas on feasability?
Title: Re: Idea: Adding second hard disk
Post by: judb on June 17, 2005, 01:00:21 AM
We've been discussing this.  What we don't know at this point is if its possible to hook up the second drive from the standpoint of the IDE interface (much less the cable required) and if the box can power both drives is the other question.

As for the feasability, I think with things set up the way they are we could do that very simply.  The hard part will be building a script that signs the files / creates playlists on the second drive that works cross platform.  PMM wont work like that so we'll hvae to hack something together.

I am not really focusing on this method however because it would require hacking the case of the phatbox and getting a new cable and or power connector worked out and I think it would be a very involved modification for people to do.. lets work on other methods first.  
Title: Re: Idea: Adding second hard disk
Post by: bushing on June 17, 2005, 02:20:17 AM
I hadn't thought of that before.  It's actually not a bad idea!

The interface should support it just fine -- it's a plain vanilla IDE interface.  You wouldn't even have to kill / restart phatd/51d -- you could just use a hack script to mount the second drive as a subdirectory of /dos/data (ie /dos/data/drive2).

As far as getting PMM to handle it, I believe that there is a poorly-documented WinXP capability to use unix-like mount points...

-b
Title: Re: Idea: Adding second hard disk
Post by: judb on June 17, 2005, 02:59:25 AM
While you are correct about the mount point functions in windows since 2000, thats for NTFS formatted volumes only if I recall correctly so the DMS would not work like that to the best of my knowledge.

I am really starting to think I post too much on here because people dont seem to read my posts.  I suggested this very same thing as a possible solution and listed off my issues with it in another thread a LONG time ago (well in the scheme of this forum a long time ago.. hehe) :(

Edit: yep NTFS not FAT32 .. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/volume_mount_points.asp
Title: Re: Idea: Adding second hard disk
Post by: bushing on June 17, 2005, 05:05:36 PM
Quote
I am really starting to think I post too much on here because people dont seem to read my posts.  I suggested this very same thing as a possible solution and listed off my issues with it in another thread a LONG time ago (well in the scheme of this forum a long time ago.. hehe) :(

You know, I looked and can't find your old post... :(


But yeah, you're right -- that would only work with NTFS.  So ... you could certainly do it if you had software that could cope (IE phat4x), and maybe you could coax PMM into handling it (make an empty NTFS partition somewhere, mount both drives into it, and convince PMM that your NTFS partition is really your phatbox...)  -- but that's a royal pain!

-b
Title: Re: Idea: Adding second hard disk
Post by: judb on June 17, 2005, 06:11:09 PM
http://forum.phathack.com/cgi-bin/yabb/YaBB.cgi?board=dmshack;action=display;num=1118041688;start=4#4

:)

You have to search for stuff by changing the default search window lenght to greater than 7 days almost all the time.  I think Paul should set the default to 30 days but for the DMS hacking forum serach it should be from the very beginning of the forum. :)
Title: Re: Idea: Adding second hard disk
Post by: para on June 17, 2005, 09:48:19 PM
QuoteThe hard part will be building a script that signs the files / creates playlists on the second drive that works cross platform.  PMM wont work like that so we'll hvae to hack something together.

Guess what Phat4X can be used for... By the end of the month Qt4 for Windows will be released as freeware! It's easy to add a feature for another mountpoint :) Apart from that PN does support ext3 as PHTDTA filesystem with a custom kernel which implies the usage of symlinks from your PHTDTA to the new mountpoint.

Para
Title: Re: Idea: Adding second hard disk
Post by: bushing on June 18, 2005, 02:37:54 AM
Quotehttp://forum.phathack.com/cgi-bin/yabb/YaBB.cgi?board=dmshack;action=display;num=1118041688;start=4#4

:)

You have to search for stuff by changing the default search window lenght to greater than 7 days almost all the time.  I think Paul should set the default to 30 days but for the DMS hacking forum serach it should be from the very beginning of the forum. :)

You know ... I read that thread, and your post, when you posted it.  I blame lack of sleep due to too much time in front of the disassembler... :/

To atone for my sin of poor reading comprehension, I've posted something in the Etiquette thread.

-b
Title: Re: Idea: Adding second hard disk
Post by: judb on June 18, 2005, 03:58:54 AM
Quote

You know ... I read that thread, and your post, when you posted it.  I blame lack of sleep due to too much time in front of the disassembler... :/

To atone for my sin of poor reading comprehension, I've posted something in the Etiquette thread.

-b


Bad bushing, no biscuit! ;) its no big deal, I just felt it would be easiear to point to the thread where I discussed (largely with myself) the issues I saw with that idea.
Title: Re: Idea: Adding second hard disk
Post by: A543 on June 19, 2005, 06:53:25 AM
As far as PMM goes, couldn't one just set up the smaller drive as PHTSYS and the bigger drive as PHTDTA and have them both mounted under XP at the same time? PMM just looks for the volume label I think.
Title: Re: Idea: Adding second hard disk
Post by: judb on June 19, 2005, 07:04:06 AM
You cannot dismount the /dos partition and the playlists that are signed by PMM point to /dos/data for the files to be played back.  I am not sure if we could dismount /dos/data and point it to /dev/hdb1 or something for the new drive.  

What I see as a potential solution is that we mount a /dos/data2 (or something better for a name) using a script to replace the wma player or something.  We change the startup sound to be a file of the type of the replaced player so it mounts on startup the new disk.

Then we would only need to make sure that the databases / playlists that are on the /dos/data filesystem point to /dos/data2 for the files on that drive.

PMM wont work like that for us.
Title: Re: Idea: Adding second hard disk
Post by: sbingner on June 19, 2005, 07:13:31 AM
QuoteYou cannot dismount the /dos partition and the playlists that are signed by PMM point to /dos/data for the files to be played back.  I am not sure if we could dismount /dos/data and point it to /dev/hdb1 or something for the new drive.  

What I see as a potential solution is that we mount a /dos/data2 (or something better for a name) using a script to replace the wma player or something.  We change the startup sound to be a file of the type of the replaced player so it mounts on startup the new disk.

Then we would only need to make sure that the databases / playlists that are on the /dos/data filesystem point to /dos/data2 for the files on that drive.

PMM wont work like that for us.

could always just mount the second drive OVER /dos/data or mount it as say /dos/data/drive2 and have your playlists configured to include files in a subdir called "drive2"
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 19, 2005, 08:09:59 PM
The cable I got for doing this was faulty, I got it from myCableShop.com, unfortuately, they're pretty unresposive sooo, I'm gonna "build" me a cable o do just that (with the difference of) I'll be mounting a regular 3.5 drive as secondary rather than a 2.5 and pulling 12V from the battery.  

With what spin found out about the signing of files, I'll be putting ALL my files onto a separate hard drive which will only be limited by bios as to how big it can be EVERYTHING on the 10gb drive will be overlayed by a separate mount into /dos/data THEN, I should be off and running, UNFORTUNATELY the 44pin ide (female) connectors are difficlt to find.

It's also down to available time as well (not much this end)

Basically, I'll actually be building 2 cables, 1 for loading the 3.5 drive (using a spare caddy I have) and the 2nd being a 2.5 AND 3.5 connector.

Time being available, I might be able to test this sometime in the next 6 months or so
Title: Re: Idea: Adding second hard disk
Post by: sbingner on June 19, 2005, 10:13:15 PM
if you can't find a connector, try http://www.mouser.com they have most everything
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 22, 2005, 02:42:21 AM
Just ordered the cable, crimpers (yeah I hear you say... crimpers, thats what pliers are for, yeah right!) and connectors from cablesonline.com.... I'll advise everyone when they arive
Title: Re: Idea: Adding second hard disk
Post by: sbingner on June 22, 2005, 03:16:47 AM
Quote3) Kill phatd/51d

When I killed those it did Bad Things(TM) -- ended up having to reflash, not sure why yet but be careful ;)

Of course it could have just been coincidence...
Title: Re: Idea: Adding second hard disk
Post by: judb on June 22, 2005, 03:48:03 AM
51d communicates with the 8052 controller and I could see how killing it might cause the state of that device to be wonky to the point of needing a reflash to reset it.  I would strongly avoid touching that if we can help it.

(edit, thats because the power to the box isnt killed until you disconnect the phatbox from the headunit I am pretty sure.)
Title: Re: Idea: Adding second hard disk
Post by: sbingner on June 22, 2005, 04:35:49 AM
I tried pulling the power from the wall, but I suspect that the little capasitor/power cleaner (?) on the back of it may have still been supplying enough power for it not to reset?  I don't know but I'm not going to try again ;)
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 24, 2005, 01:16:29 PM
Crimper, cable and connectors arrived today, assuming the honeydo list isn't too big this weekend, I might just be able to make a cable up and do first tests with spin's mods to load in a second hard drive

Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 26, 2005, 05:19:03 AM
GOT IT!!!!!

It's still only playimg 57 "tracks" rather than the 580+ on the 2nd drive BUT it'splayin stuff that I don't recall eing on the oiginal DMS
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 26, 2005, 10:50:19 PM
..... NO GO, IT'S NOT MOUNTING hdb  .....
Title: Re: Idea: Adding second hard disk
Post by: sbingner on June 27, 2005, 06:28:32 AM
I went to compusa, bought three of these: http://www.compusa.com/products/product_info.asp?ref=froogle&pfp=froogle&product_code=294956&cm_ven=froogle&cm_cat=&cm_pla=&cm_ite=feed  made the system think the dms was always connected by shorting pins 44 and 20, rolled over the cable by sticking pins in the end of the cable that normally connects to the thing with the DMS and the adaptor and melding them... otherwise I had pin 1=2 and 2=1

hda: PhatNoise DMS 10GB, ATA DISK drive
hdb: IBM-DJSA-220, ATA DISK drive
ide0 at 0xfe100000-0xfe100007,0xfe10000e on irq 6
hda: 19640880 sectors (10056 MB), CHS=19485/16/63
hdb: 39070080 sectors (20004 MB) w/1874KiB Cache, CHS=38760/16/63
Partition check:
 hda: hda1 hda2 < hda5 hda6 >
 hdb: hdb1 hdb2 < hdb5 >

I then created the dev nodes for hdb, hdb1 and hdb5.  I then mounted /dev/hdb5 over /dos/Data and killed 51d and phatd... when they restarted they were happily playing the music off the second drive

I'll put up more info when I get pics or something
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 27, 2005, 01:26:49 PM
How do you create the "dev nodes" for hdb... I think that's where I was failling
Title: Re: Idea: Adding second hard disk
Post by: sbingner on June 27, 2005, 06:46:56 PM
mknod /dev/hdb b 3 64
mknod /dev/hdb1 b 3 65
mknod /dev/hdb5 b 3 69


brw-rw----  1 root disk 3, 64 Feb 23  2004 /dev/hdb
brw-rw----  1 root disk 3, 65 Feb 23  2004 /dev/hdb1
brw-rw----  1 root disk 3, 69 Feb 23  2004 /dev/hdb5
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on June 29, 2005, 12:20:04 AM
Much appreciated!... So, the next question is how do I help in the re-creation of the phatbox code?

... other than that, now all I have to do is load up the secondary hard drive and go for it.

Thanks
Andy
Title: Re: Idea: Adding second hard disk
Post by: ryanmc on July 06, 2005, 09:19:28 PM
QuoteI went to compusa, bought three of these: http://www.compusa.com/products/product_info.asp?ref=froogle&pfp=froogle&product_code=294956&cm_ven=froogle&cm_cat=&cm_pla=&cm_ite=feed  made the system think the dms was always connected by shorting pins 44 and 20, rolled over the cable by sticking pins in the end of the cable that normally connects to the thing with the DMS and the adaptor and melding them... otherwise I had pin 1=2 and 2=1


hda: PhatNoise DMS 10GB, ATA DISK drive
hdb: IBM-DJSA-220, ATA DISK drive
ide0 at 0xfe100000-0xfe100007,0xfe10000e on irq 6
hda: 19640880 sectors (10056 MB), CHS=19485/16/63
hdb: 39070080 sectors (20004 MB) w/1874KiB Cache, CHS=38760/16/63
Partition check:
hda: hda1 hda2 < hda5 hda6 >
hdb: hdb1 hdb2 < hdb5 >


I then created the dev nodes for hdb, hdb1 and hdb5.  I then mounted /dev/hdb5 over /dos/Data and killed 51d and phatd... when they restarted they were happily playing the music off the second drive

I'll put up more info when I get pics or something
Very nice. would you be willing to make a how to..
or supply me with enough info to make this mod work and i could make a how to.... or was this method just a test and not a good way of using the pn for one reason or another ?
Title: Re: Idea: Adding second hard disk
Post by: sbingner on July 07, 2005, 12:59:21 AM
Quote
Very nice. would you be willing to make a how to..
or supply me with enough info to make this mod work and i could make a how to.... or was this method just a test and not a good way of using the pn for one reason or another ?


All you need to do is make a 3-ended 44-pin IDE cable... AndyMan knows the parts that would be required.  Once you have that, set the second laptop drive to slave and connect them both up.... one has to be in th DMS cradle so the little button is depressed
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on July 07, 2005, 01:23:00 AM
REMEMBER:  The *new* DMS (secondary) has to contain the idx files etc...

The only thing I'm *unsure* of, is how to KILL and restart 51d and phatd automatically so that this can be a seamless "fix"

Any ideas?
Title: Re: Idea: Adding second hard disk
Post by: AndyMan on July 07, 2005, 01:27:04 AM
Tell u what, those 2mm Jumpers are expensive little suckers...  especially when you only need 1 of them <Aargh>
Title: Re: Idea: Adding second hard disk
Post by: sbingner on July 07, 2005, 02:38:57 AM
QuoteREMEMBER:  The *new* DMS (secondary) has to contain the idx files etc...

The only thing I'm *unsure* of, is how to KILL and restart 51d and phatd automatically so that this can be a seamless "fix"

Any ideas?

I could probably write a replacement 51d that would take care of that... it could mount the drive, and overwrite the mountpoints.  The only possible problem would be if it takes too long and the 8051 decides to kill it before the second drive mounts
Title: Re: Idea: Adding second hard disk
Post by: judb on July 07, 2005, 03:00:29 AM
you forget that it checks the sigs during the boot loader portion for the 51d file.  so we cant replace it.

Changing the start up sound to flac or something and having a script that does the mounting etc would be a good way i think.
Title: Re: Idea: Adding second hard disk
Post by: bushing on July 07, 2005, 04:50:31 AM
Quoteyou forget that it checks the sigs during the boot loader portion for the 51d file.  so we cant replace it.

Changing the start up sound to flac or something and having a script that does the mounting etc would be a good way i think.


You'd think so, but, it doesn't.  (Oops.) The bootloader only checks:  hard disk id sector, linux, ramdisk, rc.sh, and phatd.

http://wiki.phathack.com/Bootloader_FAQ

51d doesn't get checked until phatd runs; everything from then on seems to use the same bad code that gets fooled by plsign.

I think the easiest way to prepackage a "hack" (at least, in the sense of getting a terminal on the serial port or whatever) is to put out a shell script called 51d, and have it run a hack.sh and then run the real 51d.  Sign it, then anyone can download those two files, rename 51d to 51d.real or something, and then copy them to the drive and be off (without having to lose a filetype or whatever).
-b
Title: Re: Idea: Adding second hard disk
Post by: judb on July 07, 2005, 02:49:59 PM
well as long as 51d will work as another name then we should be okay.  if we have to copy 51d back and remove the shell script we also have to find a way to put it back on shutdown.

we could change the shutdown scripts in the ramdisk using our hacked 51d script perhaps... so that files get moved back and forth on boot and shutdown.
Title: Re: Idea: Adding second hard disk
Post by: sbingner on July 07, 2005, 07:17:08 PM
Quotewell as long as 51d will work as another name then we should be okay.  if we have to copy 51d back and remove the shell script we also have to find a way to put it back on shutdown.

we could change the shutdown scripts in the ramdisk using our hacked 51d script perhaps... so that files get moved back and forth on boot and shutdown.

51d can't be a shell script, it calls via exec() from phatd.  I've replaced it with a compiled program that just exec'd strace 51d-real and it works fine
Title: Re: Idea: Adding second hard disk
Post by: ryanmc on July 07, 2005, 07:42:21 PM
What about shorting pins 44 and 20 will people need to do this ? sbingner initially from what i read you used a 3.5 ?I think id like to go that route because of the prices of them .
Title: Re: Idea: Adding second hard disk
Post by: sbingner on July 07, 2005, 08:48:32 PM
QuoteWhat about shorting pins 44 and 20 will people need to do this ? sbingner initially from what i read you used a 3.5 ?I think id like to go that route because of the prices of them .

you only need to short them if you don't have the DMS cradle connected... depressing the button does that.  I actually used only laptop drives, but I used a 40-pin IDE cable so I couldnt connect the DMS cradle and had to short them