MultiDrive – free backup, clone & wipe disk utility from Atola Technology

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: reading data with MHDD scripts
PostPosted: February 28th, 2009, 16:35 
Offline

Joined: August 12th, 2008, 13:11
Posts: 3235
Location: USA
Alright, so I can read the first 100 sectors of a drive with this script which was included with mhdd 4.5.

Code:
regs = 00 100 00 00 00 $e0 $20
waitnbsy
checkerr
checkdrq
sectorsto = lba0-99.bin


How would I go about modifying this script to read an arbitrary amount of data to a file? Would I have to read 256 sectors from start position 0, then read 256 from start position 256, and so on?

_________________
You don't have to backup all of your files, just the ones you want to keep.


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: February 28th, 2009, 16:52 
Offline

Joined: August 12th, 2008, 13:11
Posts: 3235
Location: USA
Let me amend that by saying... I know it is possible that way, but is there a better way? Also, how can I get it to append the file instead of making a new one every time?

_________________
You don't have to backup all of your files, just the ones you want to keep.


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 20th, 2009, 15:29 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
Any chance of a follow up about writing data with MHDD scripts
Bth to normal sectors and especially to selected SA blocks

eg block 42 as per the opposite of the following read script

; rm modul id 42
reset
waitnbsy
regs = $57 $44 $43 $00 $00 $a0 $8a
waitnbsy
regs = $00 $02 $00 $00 $0F $E0 $21
waitnbsy
checkdrq
sectorsto = 42.bin
; End.


Thanks


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 20th, 2009, 16:29 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
ok, yes I appreciate that
and wasnt expecting to get any complete list
just some hints

But would be interested in how to script whdd to write normal sectors

eg the opposite of the read first 100 sectors script mentioned at the top of this topic, and reprinted here

regs = 00 100 00 00 00 $e0 $20
waitnbsy
checkerr
checkdrq
sectorsto = lba0-99.bin

obviously need to specify the data file first (how?)
then do some regs command that specifies the loaction and the write

maybe sectorsfrom = xxx.bin

And yes, I know it would be easier to use a normal disk editor for the normal sectors


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 20th, 2009, 17:32 
Offline
User avatar

Joined: May 6th, 2009, 5:28
Posts: 116
Location: Somewhere near UK
Hi Spildit,

I think you overglorify some DR companies, they often just buy vendor commands.
Except for a few recent drives you could, with time and trust get just about all
the commands needed to produce your own DR bundle.

Maybe BlackST will pm you some nice code :lol: for free I would hope.


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 20th, 2009, 18:47 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
ok
I wasnt asking for the special write commands to SA areas [yet :-) and know they specify to particular drives and models]
I was just asking if mhdd has a way of writing normal sectors
to do the opposite of the normal read

eg the opposite of the read first 100 sectors script mentioned at the top of this topic, and reprinted here

regs = 00 100 00 00 00 $e0 $20
waitnbsy
checkerr
checkdrq
sectorsto = lba0-99.bin


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 20th, 2009, 19:08 
Offline

Joined: August 12th, 2008, 13:11
Posts: 3235
Location: USA
The script I posted isn't anything secret... its just a standard ATA command.

_________________
You don't have to backup all of your files, just the ones you want to keep.


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 20th, 2009, 19:29 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
$20 is ATA read sectors (pio mode)

the equivalent write sectors is $30

$e0 is STANDBY IMMEDIATE


So we just need to know if mhdd has a way to fill its internal buffer first with specified data
(something like sectorsfrom ==xxx.bin)
then presumably

regs = 00 100 00 00 00 $e0 $30
waitnbsy
checkerr
checkdrq


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 21st, 2009, 4:45 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
Looks like mhdd does have a SECTORSFROM command

so I'll try it out (probably tomorrow)


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 21st, 2009, 8:42 
Offline
User avatar

Joined: May 6th, 2009, 5:28
Posts: 116
Location: Somewhere near UK
www.elektroda.pl/rtvforum/topic1180059.html


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 26th, 2009, 14:32 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
Just to confirm you can write (to normal sectors)(the first 100 sectors here) with

regs = 00 100 00 00 00 $e0 $30
waitnbsy
checkerr
checkdrq
sectorsfrom = lba0-99.bin

The sectorsfrom has to be *after* the checkdrq

It uses sector numbering starting from 0 (ie LBA)

If want to write 2 sectors at LBA 1, the regs command is
regs = 00 02 01 00 00 $e0 $30

Not sure what the first 00 is, maybe some lead-in meaning normal cmds not special ones
But when I put the 01 there initially as a test it 'ignored' it and still worked


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 26th, 2009, 15:21 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
regs fields for normal read/write
1st - 00 ? (to be determined)
2nd - size in sectors (use 00 for 256 sectors)
3rd - LBA (lowest byte, 0- 255 decimal)
4th - LBA second lowest byte
5th - LBA third lowest bytes
6th - $E0 standby immediate
7th - $20 read, $30 write

can only do 24bit LBA addressing ie max 16million sectors = 8GB

Looks like there is also a regs48 command, which presumably can do 48 bit LBA's


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 26th, 2009, 16:14 
Offline

Joined: August 12th, 2008, 13:11
Posts: 3235
Location: USA
PDFs outlining the whole of standard ATA command use are freely available out there on the 'net.

_________________
You don't have to backup all of your files, just the ones you want to keep.


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 27th, 2009, 12:37 
Offline

Joined: May 16th, 2009, 9:32
Posts: 325
Location: UNited Kingdom
Indeed, the ATA command spec and codes is available on the Web
But few new vistors to this site know how to apply them the MHDD scripts, until now

The seven bytes of the regs are as follows
(and their names are derived from the orgininal CHS terminology)
F (or FR) Features
SC Sector Count (0=256 sectors)
SN (or LL) Sector Number (or LBA low byte)
CL (or LM) Cylinder Low
CH (or LH) Cylinder High
DH Device/Head
CMD

(nb some terminology writes them in the opposite order, with CMD first)

I was wrong about the DH one ($E0 in my examples)
It contains the bit specifying LBA mode, and also contains the highest LBA bits 27:24
for the full 28 bit LBA addressing = 128GB aka '137GigaBytes'


Top
 Profile  
 
 Post subject: Re: reading data with MHDD scripts
PostPosted: May 29th, 2009, 17:55 
Offline
User avatar

Joined: January 23rd, 2008, 10:36
Posts: 31
Location: Poland,Częstochowa
http://yura.projektas.lt/KALB/pol/info/SA.html
http://yura.projektas.lt/files/wd/hddlsct/index.html
http://yura.projektas.lt/files/wd/mhdd/index.html
http://yura.projektas.lt/files/wd/mhdd/wd_royl_rom.html
http://yura.projektas.lt/lit/WD64.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group