Subject: Re: TIImageTool 1.4

From: "Michael Zapf" <[email-masked]>
Date: Mon, 04 Feb 2013 12:39:59 -0000

Hi Tim,
  
> I have EZ135 drives in my Geneve system and one in my PC.  Will 
> TIImageTool let me access a Geneve-formatted platter in the PC to 
> copy files between images and physical disk?  

you can attach any SCSI device to your PC if you have a SCSI adapter there. 

Within Linux, such devices are available as device files called /dev/sda, /dev/sdb, /dev/sdc, etc. for each single device.

Within Windows, each device gets its drive letter, although the drive may not be opened.

In TIImageTool there is a feature called "Open device". You can type in the device name (like /dev/sdc or E:), and it will open the image.

One problem, though: In Windows I had no success so far with opening the device as read/write, just read-only. The program has to open a device path like "\\.\E:" (automatically created from the input), but when I try to open that as read/write I get a FileNotFoundException, while as read-only, everything's fine. I'll have to check whether this has changed in the meantime; maybe it was a bug in Java. 

Under Linux, all is fine; I can read and write on /dev/sdc as required.

> Secondly, will TIImageTool access raw image dumps?  

Yes (sector dump).

> I periodically dump my work platter to the PC, fix the VIB info to 
> make it compatible with the HFDC, 

TIImageTool -> "Convert to HFDC"

> and then convert the image to CHD for use with MESS. 

TIImageTool -> "Import raw"

> The reverse is also true; I often convert the CHD to a raw image, 

TIImageTool -> "Extract raw"
TIImageTool -> "Convert to SCSI"

> then copy back to a physical platter for use with my real hardware.

You may be able to set the output file in "Extract raw" to the attached SCSI device, but this was not planned this way. I think this is a possible feature for 1.5 (copy from/to device) if I find out more about this issue with writing.

Michael

---

From: "Tursi" <[email-masked]>
Date: Mon, 4 Feb 2013 04:55:30 -0800

>One problem, though: In Windows I had no success so far with opening the 
>device as read/write, just read-only. The program has
>to open a device path like "\\.\E:" (automatically created from the input), 
>but when I try to open that as read/write I get a
>FileNotFoundException, while as read-only, everything's fine. I'll have to 
>check whether this has changed in the meantime; maybe
>it was a bug in Java.

The CreateFile documentation notes the restrictions: 
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx

"You can use the CreateFile function to open a physical disk drive or a 
volume, which returns a direct access storage device (DASD) handle that can 
be used with the DeviceIoControl function. This enables you to access the 
disk or volume directly, for example such disk metadata as the partition 
table. However, this type of access also exposes the disk drive or volume to 
potential data loss, because an incorrect write to a disk using this 
mechanism could make its contents inaccessible to the operating system. To 
ensure data integrity, be sure to become familiar with DeviceIoControl and 
how other APIs behave differently with a direct access handle as opposed to 
a file system handle.

The following requirements must be met for such a call to succeed:
•The caller must have administrative privileges. For more information, see 
Running with Special Privileges.
•The dwCreationDisposition parameter must have the OPEN_EXISTINGflag.
•When opening a volume or floppy disk, the dwShareMode parameter must have 
the FILE_SHARE_WRITE flag."

Also, this other page documents in more detail the restrictions on writing 
directly to a volume as of Vista. http://support.microsoft.com/kb/942448

In short: you can't write directly to a mounted volume because of the risk 
of corruption if something else writes at the same time. You have to unmount 
or gain exclusive access. They describe how to use CreateFile (which I 
haven't tried tonight), but I don't know how much of that you get in Java.

Starting point, anyway.

---

From: "Michael Zapf" <[email-masked]>
Date: Mon, 04 Feb 2013 19:56:20 -0000

Thanks, tursi,

I also did some research today and found another suggestion in that direction. The volume must be deleted in the drive management, then put the drive offline and online, then it should be possible to use \\.\PhysicalDriveX to read and write. Did not work for me, however.

Do we have software which allows the user to write to a CF card or to a SCSI device under Windows Vista or 7? (Windows XP does not count, you won't be able to keep that forever.) If so, how does it open the raw device?

Although I would be the last one to discourage you from installing Linux (or simply run a small live system from a CD for that purpose which would not affect your hard disk installation), I would prefer a clean solution for all operating systems.

Michael

---

From: tursi <[email-masked]>
Date: Mon, 4 Feb 2013 12:09:09 -0800 (PST)

> Do we have software which allows the user to write to a CF card or to a 
> SCSI device under Windows Vista or 7? (Windows XP does not count, you 
> won't be able to keep that forever.) If so, how does it open the raw 
> device?

Fred's TI99Dir is able to do sector writes to a compact flash card. Of 
course, Windows hasn't mounted it since it doesn't have a file system in 
that case.

I didn't pay enough attention to see what you were trying to write to. Now 
that I know, if you don't have any success by tonight, I'll give it a 
quick try to see if I can make it work. My work would be under Windows 7 
and C++, though.

---

From: [email-masked]
Date: Mon, 4 Feb 2013 21:23:10 +0000 (UTC)

If I am not mistaken I have taken many Linux chunks of code and put them in OS X. 
Many times I just use the cheat sheet that the OS X geeks put out to use Linux apps. 
So OS X can do the same thing that Linux does. 
I have both and they both see the drives, SCSI or otherwise. 

Rich 
----- Original Message -----
From: "Michael Zapf" <[email-masked]> 
To: [email-masked] 
Sent: Monday, February 4, 2013 11:56:20 AM 
Subject: [TI994A] Re: TIImageTool 1.4 

Thanks, tursi, 

Michael

---

From: "Michael Zapf" <[email-masked]>
Date: Mon, 04 Feb 2013 21:37:18 -0000

Hi Rich,

> I have both and they both see the drives, SCSI or otherwise. 

yes, you're certainly right. I don't know enough details of OSX to dare to say whether there are differences between it and other Unixes. AFAIK it is based on some BSD or so. So if you can access that by /dev/sdX as well, add that to my text above. :-)

Michael

---

From: [email-masked]
Date: Mon, 4 Feb 2013 22:14:35 +0000 (UTC)

Well if you look at the history of Unix you find that Linux is a cut down version of Unix. 
OS X is a Mach 5 variant that has other Unix versions mixed in. 

This is why you can take stuff from Linux and run it in Unix but very little can be moved from Unix to Linux. 
The cost of cutting down Unix into Linux to fit in a PC cost performance and backward compatibility. 

Trouble is Unix now fits in a PC with no issues so Linux though more popular is still crippled vs Unix. 

Rich 

----- Original Message -----
From: "Michael Zapf" <[email-masked]> 
To: [email-masked] 
Sent: Monday, February 4, 2013 1:37:18 PM 
Subject: [TI994A] Re: TIImageTool 1.4 

Hi Rich, 

Michael