English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 16 January 2013, 21:05   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
SCSI CD-ROM drive emulation

After trying to install various versions of NetBSD, it occurred to me that being able to emulate a SCSI CD-ROM drive would be quite helpful. Then rather than having to create an FFS partition and copy the installation sets to it, I could instead point WinUAE to the appropriate ISO image. The OS installer would read the files from there.

I'd only need emulation of single-session 2048 bytes/sector discs, no audio tracks or other sector types. Currently I can add an ISO image as a hardfile connected to the emulated A2091/A3000 SCSI controller, set block size to 2048 and make it read-only. But then it appears as a hard disk (device type 0) to the Amiga. The CD-ROM detection code in NetBSD, Linux etc. probably only works with CD-ROM drives (type 5).

It might be enough to simply add an option to make the emulated drive report itself as type 5. Or would support need to be added for e.g. returning fake TOC data etc.?
mark_k is offline  
Old 17 January 2013, 15:20   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
I am going to do it correctly soon, using internal CD mount system which already has CD SCSI emulator, used by uaescsi.device.

Mounting CD image using HD SCSI emulation won't work if program uses any CD-only commands or assumes CD-like inquiry results etc..
Toni Wilen is offline  
Old 17 January 2013, 18:26   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
winuae.zip updated with scsi cd support.

Add something like following in config file:

uaehf1=cd,ro,:,0,0,0,0,0,,scsi1

(only important values are "cd" and "scsix", others are there just for config file compatibility)

Now normal WinUAE CD GUI can be used to select image or real CD.

No GUI harddrives panel support (probably not safe to edit via GUI and saving config is not supported either. EDIT: saving seems to work but you need to manually remove matching hardfile2 line).

Most likely does not work if program uses or expects scsi connect/disconnections while another device is processing previous command.

Also whole emulation stops while command is executing (for example using real CD and it is spinning up), command processing will be moved to separate thread in future.

EDIT: ATAPI CD is also coming soon.

Last edited by Toni Wilen; 17 January 2013 at 21:18.
Toni Wilen is offline  
Old 18 January 2013, 15:22   #4
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
That's great, I've currently got NetBSD 6.0.1 installing from CD-ROM. There were a couple of error messages relating to command opcode 0x43 (READ TOC/PMA/ATIP) but those were non-fatal to the installer.

Update: the installer seemed to complete with no problems. There was this line in the log just before I quit WinUAE; no idea whether or not it's CD-ROM related:
BUG unit 0 close: opencnt=0!
Attached Thumbnails
Click image for larger version

Name:	NetBSD_install_A3000_CD-ROM_2013-01-18.png
Views:	367
Size:	15.3 KB
ID:	33922  

Last edited by mark_k; 18 January 2013 at 18:29.
mark_k is offline  
Old 18 January 2013, 20:49   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
What is the exact CD image you used? 0x43 error is confusing because basic read toc is emulated and I don't see how it can cause this error.
Toni Wilen is offline  
Old 18 January 2013, 20:53   #6
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
ftp://ftp.netbsd.org/pub/NetBSD/iso/....0.1-amiga.iso

Update: I've attached the config file I used in case that helps.
Attached Files
File Type: uae NetBSD_install_A3000_CDROM.uae (13.2 KB, 126 views)

Last edited by mark_k; 18 January 2013 at 23:10.
mark_k is offline  
Old 19 January 2013, 12:25   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
Sorry, installation is too boring, I am not going to bother with preparing the HDF for installation. Please create one, thanks
Toni Wilen is offline  
Old 19 January 2013, 14:04   #8
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
I already did! Get the HDF from this posting. When the installer asks for installation medium (CD/disk/FTP etc.) select CD-ROM.
mark_k is offline  
Old 19 January 2013, 17:14   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
You didn't say it was real installation image

READ TOC fixed (returned error if allocated buffer was too small, it should simply truncate data in this situation)

Some kind of CD selection GUI added, quite minimal.. ATAPI does not yet work.

btw, is this image also supposed to work in IDE emulation mode? It reads totally different HDF blocks (0,1,2,3,32 and then block numbers around 1000) after "root file system type: ffs" appears, also it fails to find init. Same image in SCSI emulation mode works (0,1,2,3,32 and then block numbers 4200000-something)
Toni Wilen is offline  
Old 19 January 2013, 17:58   #10
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
With an emulated A4000/030 using the NetBSD_install_A4000.uae attached here it doesn't seem to find the root device by itself. You can enter wd0b then press return three times, then select a keymap and the installer continues. With an emulated A4000/040 however (config attached below), it hangs after printing
init: trying /sbin/init

Maybe some 68040 MMU bug is responsible for the difference?

If you want to proceed with the installation without an emulated CD drive, you can download a ~162MB archive of an HDF with the NetBSD installation files on an FFS partition. See this posting for that.
Attached Files
File Type: uae NetBSD_install_A4000_040.uae (14.2 KB, 110 views)
mark_k is offline  
Old 19 January 2013, 19:10   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
Ok, root is different (wd0a vs wd0b) but it never asks for root device. It just keeps asking for path to init.

(I noticed this 040 issue days ago, this is another useless test case, it does not hang, it just runs some long piece of code forever, probably because it got bad parameters)
Toni Wilen is offline  
Old 19 January 2013, 21:25   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
ATAPI CD implemented. Only tested with idefix, it seems to send and receive correct looking ATAPI packets..
Toni Wilen is offline  
Old 20 January 2013, 15:53   #13
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
I couldn't get the NetBSD installer to see the CD-ROM drive with emulated A4000/030, IDE HD and CD drives. I think it is supposed to work with ATAPI CD-ROM connected to A4000 IDE connector. Config attached.

Edit: Never mind, I did get it to detect the CD drive when connected to IDE0 (with HD connected to A2091). I'll do some more testing.

Update: With the CD drive on IDE0 (and HD on A2091 SCSI) the NetBSD installer does detect the CD drive and I can select it, but the installer reports
mount_cd9660: /dev/cd0a on /mnt2: Invalid argument
Cannot mount CD-ROM drive. Aborting.

In the WinUAE log output there are a number of
ATAPI packet command
lines, and also a couple of
CDEMU: unsupported scsi command 0x35

Use the attached NetBSD_install_A4000_A2091_IDE_CD.uae config to test. Note that at least with the Kickstart 3.1 ROM, there's a long wait at a black screen while Kickstart waits for a not-connected IDE HD.
Attached Files
File Type: zip NetBSD_install_A4000_IDE_CD.uae.zip (2.9 KB, 104 views)
File Type: zip NetBSD_install_A4000_A2091_IDE_CD.uae.zip (2.9 KB, 102 views)

Last edited by mark_k; 20 January 2013 at 16:16.
mark_k is offline  
Old 20 January 2013, 17:21   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
I still get same init path error. Difficult to do any tests with IDE HD and CD.

EDIT: 0x35 is syncronize cache, it shouldn't cause any problems.
Attached Thumbnails
Click image for larger version

Name:	netbsdinitpath.png
Views:	234
Size:	22.4 KB
ID:	33949  
Toni Wilen is offline  
Old 20 January 2013, 17:26   #15
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
Did you replace the NetSBD HDF with a fresh copy (i.e. unpack it again from the archive I uploaded)? Because it seems that if you abort the installer part-way through, it can leave the HDF in a state where it doesn't boot properly next time. That may be why you're seeing the error message. It's best to start off with a fresh HDF each time.

For me, booting with the NetBSD_install_A4000_A2091_IDE_CD.uae config it goes straight to the keymap selection prompt.

I just tried again and this time it did properly mount the CD and installation began. But there was an error after extracting a few files.
Attached Thumbnails
Click image for larger version

Name:	NetBSD_install_A4000_A2091_IDE_CD.png
Views:	256
Size:	15.5 KB
ID:	33954   Click image for larger version

Name:	NetBSD_install_A4000_A2091_IDE_CD_2.png
Views:	227
Size:	14.5 KB
ID:	33956   Click image for larger version

Name:	NetBSD_install_A4000_A2091_IDE_CD_3.png
Views:	235
Size:	9.2 KB
ID:	33957  

Last edited by mark_k; 20 January 2013 at 17:41.
mark_k is offline  
Old 20 January 2013, 18:49   #16
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
Using the latest winuae.zip (2013-01-20 17:09) I loaded the NetBSD_install_A4000_A2091_IDE_CD config. On booting it seems to hang at a black screen. (Either that or the initial delay while Kickstart waits for IDE drives is much longer than normal.)

Then I changed the CD drive from IDE0 to SCSI2 by double-clicking its entry in the Hard drives list to open the CD Settings window, changing to SCSI 2 and clicked Add CD Drive. Then click Reset. On booting the NetBSD installer detects the SCSI CD drive but thinks it's empty, printing:
Code:
cd0(atzsc0:0:2:0):  Check Condition on CDB: 0x00 00 00 00 00 00
    SENSE KEY:  Not Ready
     ASC/ASCQ:  Medium Not Present
With the same winuae.exe, loading the NetBSD_install_A4000_IDE_CD config and booting, WinUAE crashes at the point when NetBSD checks for drives (I think). The attached pic is the last text printed before WinUAE crashes. Wine reports:
wine: Unhandled page fault on read access to 0x359edd6c at address 0x82af07 (thread 0009), starting debugger...
Unhandled exception: page fault on read access to 0x359edd6c in 32-bit code (0x0082af07).
Attached Thumbnails
Click image for larger version

Name:	NetBSD_install_A4000_A2091_IDE_CD_crash.png
Views:	208
Size:	10.9 KB
ID:	33961  
mark_k is offline  
Old 20 January 2013, 20:32   #17
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
Don't try to change device types on the fly, it won't work. It isn't even supposed to work.

winuae.zip updated, ATAPI signature/reset should now work better, at least netbsd detects both HD and CD now.

I get same extraction error, it may be caused by MMU emulation bug. (I remember similar exctraction errors when testing debian long long time ago). SCSI vs IDE can have different memory layout and SCSI is DMA, IDE isn't which can explain the difference.

Unpacking the image fixed the init problem, interestingly same "ide-broken" image booted fine when using SCSI. Does it have different files for different hardware?
Toni Wilen is offline  
Old 20 January 2013, 21:04   #18
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
Quote:
Originally Posted by Toni Wilen View Post
Unpacking the image fixed the init problem, interestingly same "ide-broken" image booted fine when using SCSI. Does it have different files for different hardware?
Your guess is as good as mine! You can mount the miniroot.fs file in Linux and browse the files by doing this:
mount -o noatime,ro,loop,ufstype=44bsd -t ufs miniroot.fs /media/test

With the latest winuae.exe I still get the "Cannot mount CD-ROM drive. Aborting." message some of the time. Other times it does mount okay.

If the install sets are on the HDF (in an Amiga FFS partition), the installer does work then. So the extraction error is not specifically IDE-related. Could it be due to successive read-IDE1, write-IDE0 accesses messing up somehow, when trying to install from IDE CD? (When the installer tries to mount the FFS partition it also initially says it cannot mount it. But it actually did and you can continue with installation by specifying the path /mnt2. I think I mentioned that in the NetBSD thread.)

Last edited by mark_k; 20 January 2013 at 21:10.
mark_k is offline  
Old 20 January 2013, 21:14   #19
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,792
I left part of IDE debugging enabled in latest version, could you check if there are interesting differences?
Toni Wilen is offline  
Old 20 January 2013, 21:52   #20
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,191
I got logs for booting the NetBSD installer and starting installation from files on the HD (exiting WinUAE after a couple of screens-worth of files extracted), and installing from CD (exiting WinUAE shortly after the first extraction error message appeared).

Nothing really stood out for me, as you said this might be a symptom of an MMU-related bug. But the logs are attached if you want to look at them.
Attached Files
File Type: 7z NetBSD_logs.tar.7z (151.0 KB, 81 views)
mark_k is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
CyberstormPPC SCSI issue with CD-Rom Drive nobodyii support.Hardware 23 08 October 2014 14:47
For Sale: Cyberstorm Mk2 060 + 128MB RAM + SCSI II Module + 18GB SCSI Drive Zetr0 MarketPlace 9 27 June 2012 22:41
Can I use a wide scsi drive on a narrow scsi bus? gulliver support.Hardware 4 17 September 2010 04:50
SCSI CD ROM Drive Washac support.Hardware 2 18 February 2010 19:19
Wanted - External SCSI CD ROM Drive fitzsteve MarketPlace 0 01 December 2009 11:50

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 16:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.13693 seconds with 14 queries