English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 27 January 2017, 20:50   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,482
WinUAE refuses to access optical memory (type 7) devices

I have a Belkin F5U115 USB-SCSI adaptor connected to my PC running Windows 10 1607 x86-64. (I got Windows to recognise it by manually specifying the driver to install, yay!)

Connected to the adaptor is an HP 9100mx MO drive. I have a 2.6GB MO disk (Amiga FFS-formatted) in the drive. Drive can be accessed as normal from Windows, e.g. right-click then Eject works, and I could use WinImage to create an image file of the disk's contents.

However WinUAE refuses to work with any type 7 device, reporting this on clicking Add Hard Drive...:
opening device '\\?\usbstor#optical&ven_hp&prod_c1113m&rev_1.19#7&12db4270&1#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
not a direct access device, ignored (type=7)
...
opening device '\\.\J:'
not a direct access device, ignored (type=7)
mark_k is offline  
AdSense AdSense  
Old 27 January 2017, 20:59   #2
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,482
In hardfile_win32.cpp there is:
Code:
if (devDesc->DeviceType != INQ_DASD && devDesc->DeviceType != INQ_ROMD && devDesc->DeviceType != INQ_OPTD) {
    write_log (_T("not a direct access device, ignored (type=%d)\n"), devDesc->DeviceType);
    return -2;
}
In blkdev.h:
Code:
#define	INQ_DASD	0x00		/* Direct-access device (disk) */
#define	INQ_SEQD	0x01		/* Sequential-access device (tape) */
#define	INQ_PRTD	0x02 		/* Printer device */
#define	INQ_PROCD	0x03 		/* Processor device */
#define	INQ_OPTD	0x04		/* Write once device (optical disk) */
#define	INQ_WORM	0x04		/* Write once device (optical disk) */
#define	INQ_ROMD	0x05		/* CD-ROM device */
#define	INQ_SCAN	0x06		/* Scanner device */
#define	INQ_OMEM	0x07		/* Optical Memory device */
So if you could check for INQ_OMEM too that should fix the problem:
Code:
if (devDesc->DeviceType != INQ_DASD && devDesc->DeviceType != INQ_ROMD && devDesc->DeviceType != INQ_OPTD && devDesc->DeviceType != INQ_OMEM)) {
    write_log (_T("not a direct access device, ignored (type=%d)\n"), devDesc->DeviceType);
    return -2;
}
mark_k is offline  
Old 27 January 2017, 21:24   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,561
Changed.
Toni Wilen is offline  
Old 27 January 2017, 21:57   #4
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,482
Thanks, drive is now detected, but twice. What follows probably isn't specific to the type-7-drive issue.

With a disk in the drive, WinUAE's drive scan reports:
opening device '\\?\usbstor#optical&ven_hp&prod_c1113m&rev_1.19#7&12db4270&2#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'HP C1113M 1.19 332058 '
IOCTL_DISK_GET_LENGTH_INFO returned size: 1303563264 (0x4db2cc00)
BPS=1024 Cyls=79 TPC=255 SPT=63 MediaType=11
device size 1303563264 (0x4db2cc00) bytes
1 MBR partitions found
0: num: 1 type: 04 offset: 0 size: 1303563264, type not 0x76 or 0x30
non-empty MBR partition table detected, doing RDB check anyway
hd accepted, not empty and not mounted in Windows
...
opening device '\\.\J:'
device id string: 'HP C1113M 1.19 332058 '
IOCTL_DISK_GET_LENGTH_INFO returned size: 1303563264 (0x4db2cc00)
BPS=1024 Cyls=79 TPC=255 SPT=63 MediaType=11
device size 1303563264 (0x4db2cc00) bytes
1 MBR partitions found
0: num: 1 type: 04 offset: 0 size: 1303563264, type not 0x76 or 0x30
non-empty MBR partition table detected, doing RDB check anyway
hd accepted, not empty and not mounted in Windows


And there are two entries in the drive list, see attached pic.


Also, is the "1 MBR partitions found" message produced by WinUAE, or is that (faked) info given by Windows? You can tell it's fake because the supposed MBR partition covers the entire disk.


Finally, is there any way to tell WinUAE to re-scan drives? If you click Add Hard Drive... with no disk in the drive, it appears in the list as [NO MEDIA]. After inserting a disk you have to (it seems) quit and run WinUAE again in order to have it recognise the disk in the drive.
Attached Thumbnails
Click image for larger version

Name:	DriveDetectedTwice2.png
Views:	28
Size:	15.3 KB
ID:	51836  

Last edited by mark_k; 27 January 2017 at 22:03.
mark_k is offline  
Old 28 January 2017, 15:58   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,561
Quote:
Originally Posted by mark_k View Post
And there are two entries in the drive list, see attached pic.
Duplicates should have been removed but I am not sure what happens without full HD detection log lines.

Quote:
Also, is the "1 MBR partitions found" message produced by WinUAE, or is that (faked) info given by Windows? You can tell it's fake because the supposed MBR partition covers the entire disk.
Yes, it is what Windows returns. Thats why WinUAE will always check for RDB even if Windows says it has MBR.

Quote:
Finally, is there any way to tell WinUAE to re-scan drives? If you click Add Hard Drive... with no disk in the drive, it appears in the list as [NO MEDIA]. After inserting a disk you have to (it seems) quit and run WinUAE again in order to have it recognise the disk in the drive.
Boring and easy answer: GUI is not designed for removable drives
Toni Wilen is offline  
Old 28 January 2017, 19:28   #6
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,482
Full drive detection log:
Code:
opening device '\\?\usbstor#disk&ven_generic-&prod_ms#ms-pro#hg&rev_1.00#20060413092100000&3#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'Generic- MS/MS-Pro/HG     1.00 20060413092100003'
opening device '\\?\usbstor#disk&ven_generic-&prod_sm#xd-picture&rev_1.00#20060413092100000&1#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'Generic- SM/xD-Picture    1.00 20060413092100001'
opening device '\\?\usbstor#disk&ven_generic-&prod_sd#mmc#ms#mspro&rev_1.00#20060413092100000&4#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'Generic- SD/MMC/MS/MSPRO  1.00 20060413092100004'
opening device '\\?\usbstor#disk&ven_generic-&prod_sd#mmc&rev_1.00#20060413092100000&2#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'Generic- SD/MMC           1.00 20060413092100002'
opening device '\\?\usbstor#disk&ven_generic-&prod_compact_flash&rev_1.00#20060413092100000&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'Generic- Compact Flash    1.00 20060413092100000'
opening device '\\?\scsi#disk&ven_ata&prod_mb1000gceek#5&249b8d46&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'ATA      MB1000GCEEK      HPG1 WCAW37735289        '
opening device '\\?\usbstor#optical&ven_hp&prod_c1113m&rev_1.19#7&12db4270&2#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'
device id string: 'HP       C1113M           1.19 332058    '
IOCTL_DISK_GET_LENGTH_INFO returned size: 1303563264 (0x4db2cc00)
BPS=1024 Cyls=79 TPC=255 SPT=63 MediaType=11
device size 1303563264 (0x4db2cc00) bytes
1 MBR partitions found
0: num: 1 type: 04 offset: 0 size: 1303563264, type not 0x76 or 0x30
non-empty MBR partition table detected, doing RDB check anyway
hd accepted, not empty and not mounted in Windows
opening device '\\.\C:'
device id string: 'ATA      MB1000GCEEK      HPG1 WCAW37735289        '
drive letter not removable, ignored
opening device '\\.\D:'
device id string: 'hp CDDVDW SH-216BB HE30'
opening device '\\.\E:'
device id string: 'Generic- Compact Flash    1.00 20060413092100000'
duplicate device, ignored
opening device '\\.\F:'
device id string: 'Generic- SM/xD-Picture    1.00 20060413092100001'
duplicate device, ignored
opening device '\\.\G:'
device id string: 'Generic- SD/MMC           1.00 20060413092100002'
duplicate device, ignored
opening device '\\.\H:'
device id string: 'Generic- MS/MS-Pro/HG     1.00 20060413092100003'
duplicate device, ignored
opening device '\\.\I:'
device id string: 'Generic- SD/MMC/MS/MSPRO  1.00 20060413092100004'
duplicate device, ignored
opening device '\\.\J:'
device id string: 'HP       C1113M           1.19 332058    '
IOCTL_DISK_GET_LENGTH_INFO returned size: 1303563264 (0x4db2cc00)
BPS=1024 Cyls=79 TPC=255 SPT=63 MediaType=11
device size 1303563264 (0x4db2cc00) bytes
1 MBR partitions found
0: num: 1 type: 04 offset: 0 size: 1303563264, type not 0x76 or 0x30
non-empty MBR partition table detected, doing RDB check anyway
hd accepted, not empty and not mounted in Windows
Drive scan result: 9 drives detected
Is there a Windows API to return (in this example) "\\?\usbstor#optical&ven_hp&prod_c1113m&rev_1.19#7&12db4270&2#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}" when given a drive name "J:"? That should allow you to reliably ignore duplicates.


Another couple of small issues when creating an HDF, see the pic:
- Text in the progress window uses a different font (bitmap, not antialiased) to the rest of the GUI.
- The other WinUAE windows stop responding. They may become blank because they are not refreshed until HDF creation finishes.
Attached Thumbnails
Click image for larger version

Name:	DriveImaging2CroppedArrows.png
Views:	17
Size:	52.7 KB
ID:	51842  
mark_k is offline  
Old 28 January 2017, 20:51   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,482
I'm obviously making some mistake here, since WinUAE did detect the duplicate card reader entries in the log above. But in hardfile_win32.cpp (line 1288, parts removed for clarity), you do:
Code:
// Strip all trailing : characters from udi->device_name
while (_tcslen(udi->device_name) > 0 && udi->device_name[_tcslen(udi->device_name) - 1] == ':')
    udi->device_name[_tcslen(udi->device_name) - 1] = 0;

// Replace all : characters with _ in udi->device_name
for (int i = 0; i < _tcslen(udi->device_name); i++) {
    if (udi->device_name[i] == ':')
        udi->device_name[i] = '_';
}

// Copy udi->device_name string to orgname, prepended with a : character
_stprintf (orgname, _T(":%s"), udi->device_name);

// Compare each device_name string with that string. How can they ever
// match, since orgname begins with : but the device_name string won't???
for (i = 0; i < hdf_getnumharddrives (); i++) {
    if (!_tcscmp (uae_drives[i].device_name, orgname)) {
        write_log (_T("duplicate device, ignored\n"));
        return -2;
    }
}
mark_k is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
What type of memory for a Supradrive LLK36 support.Hardware 4 21 October 2010 20:20
Break on Memory Access? Khyron support.WinUAE 3 21 August 2010 00:10
access emulated memory ara support.WinUAE 6 03 April 2010 13:05
What memory type can you use on Blizzard IV? blade2565 support.Hardware 5 11 June 2006 03:27
WinUAE refuses to start..... Reppyboyo support.WinUAE 2 04 February 2003 12:44

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:48.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.14175 seconds with 12 queries