English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 01 June 2017, 20:12   #41
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
It is always 81000005 guru = memory list corrupted. Not going to debug those.
Toni Wilen is online now  
AdSense AdSense  
Old 01 June 2017, 23:07   #42
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
Some ideas, I'll look into this.

I booted a Workbench 3.1 disk with HDDisk in the Expansion drawer.

Doing a non-quick Format, it did the main part but then sat at Initializing disk... for a long time. Eventually it said Format Failure: not a valid DOS disk

Doing a Format QUICK seemed to work. At least it exits with no error. And I could then CD to DH0:, edit and save a text file. But I very quickly got a "Boot has a checksum error on disk block 924" requester. Format QUICK and saving a text file (to the OFS partition) caused only single-sector WRITE commands to be issued.

Just before the error requester was this 8-sector READ:
ST-506 CMD 0022C400 08.00.04.20.08.00 22.e6.28
SCSIEMU HD 0: 08.00.04.20.08.00.00.00.00.00.00.00 CMDLEN=6 DATA=0000000006AB5840
-> DATAOUT=4096 ST=0 SENSELEN=0 REPLYLEN=0


My guess is, there's some problem with the sense data that causes the hddisk.device caching to break. [The cache is why hddisk issues an 8-sector READ even though the filesystem would (probably) only have requested one sector.]
mark_k is offline  
Old 18 June 2017, 20:53   #43
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
I set up an HDF for testing A-Max with ST-506 drive. It doesn't work properly. Booting the Mac with no floppy disk you see the A-Max disk-with-question-mark icon. Inserting a bootable Mac floppy disk doesn't boot.

Starting Mac emulation with a bootable Mac disk already in DF0:, it boots from that disk. But when the desktop appears (and there should be a volume whatever is unreadable etc. dialog), emulation hangs at the first HD access.

Problem looks like it could be related to the Change Command Block command, as it ends up being at $FC0000...

Log output:
ST-506 CMD 00214400 0f.00.00.00.00.00 27.37.54
ST-506 Change Command Block 00.01.fe.00
...
ST-506 CMD 01FC0000 11.11.4e.f9.00.f8 00.02.4a


Config and HDF:
Code:
https://www.media!fire.com/?7gc6a18pgcew532
https://www.media!fire.com/?bhscssbb871t8b8
Boot HDF, double-click "A-Max QTX" icon. Click Start A-Max II then OK.

Edit to add: By the way, the A2090 Z80 CHANGE COMMAND BLOCK code seems to have a bug (maybe harmless) where it transfers 4 words (i.e. 8 bytes) instead of 2 words via DMA when receiving the new DMA address.

Last edited by mark_k; 18 June 2017 at 21:23.
mark_k is offline  
Old 18 June 2017, 21:25   #44
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
Quote:
Originally Posted by mark_k View Post
Problem looks like it could be related to the Change Command Block command, as it ends up being at $FC0000...
Fixed.

Missed some shifting and return status of Change Command Block must be written to new CB address, not old. (Amax driver polls new CB address + 12 to detect command complete state)
Toni Wilen is online now  
Old 18 June 2017, 22:18   #45
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
Thanks. I successfully installed and booted Mac System 7.1.

By the way, the A2090A ROM seems to require that "More compatible" be checked in CPU settings, otherwise the machine keeps rebooting at startup.

Last edited by mark_k; 18 June 2017 at 22:34.
mark_k is offline  
Old 19 June 2017, 09:01   #46
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
Quote:
Originally Posted by mark_k View Post
Thanks. I successfully installed and booted Mac System 7.1.
Great

Quote:
By the way, the A2090A ROM seems to require that "More compatible" be checked in CPU settings, otherwise the machine keeps rebooting at startup.
It probably lacks "direct" access support.

btw, does Z80 really accept all 24 bits (minus lowest) of Change Command Block new address? Boot ROM init code loads initial command block address by writing 2 bytes to hardware register (write byte to base+$50, do handshake, write next byte, do handshake), first bits 23-16 and then bits 15-8. It does not write 3rd byte so I assumed it is hardwired to zero. (address = xxxx00)

Or perhaps it is just initial load (hardware?) restriction and change command block accepts full 23 bits? Low 9 bits are zero when Amix does the CCB (twice!) so perhaps it really needs to be zero.
Toni Wilen is online now  
Old 19 June 2017, 11:02   #47
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
The hddisk code takes the Amiga address, shifts it right 9 bits, then writes the resulting two bytes. So there's no third byte to write. [Edit: I see what you mean... I suppose you could try writing three bytes on real hardware, but probably that way is limited to writing two address bytes, otherwise there wouldn't be any need for the Change Command Block command?]

Change Command Block does definitely allow the command block address to be set to any (even) address.

I haven't tested Amix with ST-506 drive yet. Does it only support access as a data drive (i.e. non-bootable)?

Code:
TaskCode
	MOVEA.L	(4,SP),A6	;Get pointer to $8DA1-bytes struct
	MOVEA.L	(_OurBoardAddr-Mem8DA1,A6),A1
	BTST	#7,($30,A1)	;High bit of er_Reserved0c ???
	BNE.W	lbC0023E2

	BSET	#1,(lbB00B676-Mem8DA1,A6)	;Set flag to indicate hardware type???
	BRA.B	lbC002412	;And skip the address-setting ???

lbC0023E2
	MOVE.L	(Mem8DA1-Mem8DA1,A6),D0	;Point to (512-byte-aligned) command block
	MOVEQ	#9,D1
	LSR.L	D1,D0	;Shift it right by 9 bits
	MOVEQ	#1,D1	;To write two bytes of address data
.Do2ndByte
	MOVE.B	D0,($50,A1)	;Write low byte
	MOVE.B	#$E0,($42,A1)	;HCBP=1, MRESET=1, SSEL=1, int.enable=0

lbC0023F6
	BTST	#7,($42,A1)	;Check HCBP bit
	BEQ.B	lbC0023F6

	MOVE.B	#$60,($42,A1)	;HCBP=0, MRESET=1, SSEL=1, int.enable=0
lbC002404
	BTST	#7,($42,A1)	;Check HCBP bit
	BNE.B	lbC002404

	LSR.L	#8,D0	;To write upper byte on 2nd (final) loop iteration
	DBRA	D1,.Do2ndByte

lbC002412	BSR.W	lbC001C1A

Z80 code:
Code:
CHANGE_COMMAND_BLOCK_routine?:          ; DATA XREF: ReceiveCmdBlockCallOpcodeRoutine+60o
        ld      c, 4            ; Transfer 4 words (8 bytes) [BUG??? CHANGE COMMAND BLOCK data is only 4 bytes???]
        call    SetDMAAddrReadCWordsTo_unk_2287 ; Sets DMA address to that in CommandBlock, reads C words via DMA, to address unk_2287
        ld      hl, unk_2288
        ld      d, (hl)         ; Get High order DMA Byte
        inc     hl
        ld      e, (hl)         ; Get Mid Order DMA Byte
        srl     d
        rr      e
        ld      (CommandBlockDMAAddress), de ; Amiga address shifted right 1 bit
        inc     hl
        ld      a, (hl)         ; Get Low Order DMA Byte
        rr      a
        ld      (CommandBlockDMAAddressLowByte), a ; (Low byte of) Amiga address shifted right 1 bit
        jp      SetErrorCodeTo0_Jump_word_23A1
This code calls the appropriate command routine:
Code:
; Receive 12 bytes from command block via DMA. Shift the DMA address bytes right one bit.
; Call the appropriate opcode routine.
; Return error code $20 if invalid opcode.

ReceiveCmdBlockCallOpcodeRoutine:       ; CODE XREF: sub_1007+15j
        ld      c, 6            ; To read (the first) 12 bytes of command block
        ld      de, CommandBlock ; Destination pointer
        ld      hl, (CommandBlockDMAAddress) ; Amiga address shifted right 1 bit
        ld      a, (CommandBlockDMAAddressLowByte) ; (Low byte of) Amiga address shifted right 1 bit
        ld      b, a
        call    SetDMAAddrToHLBReadCWordsToDE ; DE: Destination address
                                        ; HLB: DMA address
                                        ; C: Number of words to transfer
        ld      hl,  CommandBlock+6 ; Point to DMA address bytes in command block
        srl     (hl)            ; Shift DMA address bytes right 1 bit
        inc     hl
        rr      (hl)
        inc     hl
        rr      (hl)
        ld      a, (CommandBlock) ; Get command opcode
        ld      hl, ValidSCSIOpcodesTable
        ld      bc, 10h         ; Number of opcodes in table
        cpir
        jp      nz, InvalidCmdOpcode
        ld      a, 0Fh
        sub     c
        add     a, a
        ld      e, a
        ld      d, 0
        ld      hl, OpcodeRoutinesTable
        add     hl, de
        ld      e, (hl)
        inc     hl
        ld      d, (hl)
        ex      de, hl
        jp      (hl)

Another curious thing... command block byte 9 is used for something, not sure what:
Code:
SignalCommandComplete?:                 ; CODE XREF: sub_1A1+7j
        ld      a, 9Fh          ; "Reset IREQ-  This state will force IREQ- line to high impedance. It is set low by the host."
        out     (37h), a

        ld      a, 0BFh         ; "Command complete signal to host"
        out     (37h), a

        ld      a, (CommandBlock+9) ; Reserved???
        out     (27h), a

        ld      a, 0
        out     (84h), a
        ld      (LastValueWrittenToPort84h), a ; Value written to port $84 is put here?

        jp      sub_AD

Last edited by mark_k; 19 June 2017 at 11:15.
mark_k is offline  
Old 19 June 2017, 15:44   #48
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
I'm now trying to get an emulated SCSI drive prepped.

Prep seems to hang after you enter y to proceed. From the log output, it issues a FORMAT UNIT ($04) command, probably WinUAE isn't responding in the way Prep expects.

Log output:
SCSIEMU HD 0: 04.00.00.00.01.00.00.00.00.00.00.00 CMDLEN=6 DATA=0FE12230
-> DATAOUT=0 ST=0 SENSELEN=0 REPLYLEN=0
mark_k is offline  
Old 19 June 2017, 16:25   #49
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
Which install disk and drive size/model?

FORMAT UNIT shouldn't return anything. (or request anything unless byte 1 is non-zero)
Toni Wilen is online now  
Old 19 June 2017, 17:08   #50
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
Config and ADF:
Code:
https://www.media!fire.com/?ndpo6fvymznwvb1
https://www.media!fire.com/?atz44w6tgjq0b0z
I modified A2090A-RodimeRO3055.dms for a same-size SCSI drive:
- Added HDDisk to Expansion drawer (you mentioned a missing relocation affecting the ROM SCSI format/prep code?)
- Changed unit numbers in MountList.HD from 1 to 3 (for SCSI ID 0), RES0: to RES2:.

HDF C/H/S geometry 872/6/17.

Boot floppy disk. Open Shell. Do
Mount RES2: FROM MountList.HD
Prep RES2:

Enter 0 for drive type, 6 heads, 872 tracks, 17 sec/track. You can leave all other options at default, just press return until the Do you wish to proceed prompt.
mark_k is offline  
Old 19 June 2017, 20:46   #51
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
It looks like driver detects TD_FORMAT and does some extra stuff in SCSI mode.

It executes MODE SELECT and expects it to take 12 bytes of data. If it does not (for example if it is not supported), driver ignores the error but forgots to reset the WD chip transfer counter and executes FORMAT UNIT with 12 bytes of data, this causes driver to become confused when WD chip returns unexpected phase status. (Expected data in but got status phase)

Command: 15.01.00.00.0C.00 Data: 00 00 00 08 00 00 00 00 00 00 02 00

I am not yet sure how to fix this. It probably is not good idea to just swallow all MODE SELECT commands..
Toni Wilen is online now  
Old 21 June 2017, 13:31   #52
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
As a workaround, here's a patched HDDisk (for SYS:Expansion) which skips the MODE SELECT.
Code:
http://www.media!fire.com/file/a21342l1aosusca/HDDisk_NoModeSelForCmd06.lha
mark_k is offline  
Old 21 June 2017, 14:51   #53
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
Something about the A2090 SCSI timing (or emulated drive timing?) might benefit from tweaking.

I set up an HDF for testing A-Max. With cycle-exact enabled the HDF boots to WB as it should. However when cycle-exact is not enabled, the A2090 ROM code only issues two SCSI commands:
A2090/A2091/A590 WD33C93 in use
SCSIEMU HD 0: 00.00.00.00.00.00.00.00.00.00.00.00 CMDLEN=6 DATA=0E35E588
-> DATAOUT=0 ST=0 SENSELEN=0 REPLYLEN=0
SCSIEMU HD 0: 1B.00.00.00.01.00.00.00.00.00.00.00 CMDLEN=6 DATA=0E35E588
-> DATAOUT=0 ST=0 SENSELEN=0 REPLYLEN=0


But after re-testing, the HDF does correctly boot most of the time without cycle-exact. When I set emulation speed to fastest possible however, the ROM always only issues the above two commands.

Config and HDF (with A-Max and Mac System 7.1 installed):
Code:
https://www.media!fire.com/?kjg5v135jk5uaxc
https://www.media!fire.com/?7mkbx0qev27j2q8
By the way, are you interested in supporting the A2090 partition spec? Then you could boot A2090 HD images using uaehf instead of the flaky old A2090. [You'd need to change the device name to hddisk.device in order for the user's existing mount files to work without modification though. Otherwise just mounting the first OFS partition would be better than nothing.]
mark_k is offline  
Old 21 June 2017, 16:50   #54
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
Quote:
MODE SELECT
Is now "implemented". Because some Seagate drive spec says saved pages don't need to be implemented and "The drive only verifies Mode Select Data that is defined as changeable by the drive", I can accept basic pages and ignore the contents

I think anyone who calls MODE SELECT should first use MODE SENSE to check if page is supported, then call MODE SELECT, then MODE SENSE again to check if parameter did change to even detect if parameter is changeable.

Quote:
Originally Posted by mark_k View Post
Something about the A2090 SCSI timing (or emulated drive timing?) might benefit from tweaking.
It looks like it wants CSR_SEL_XFER_DONE and CSR_DISC statuses back to back without too big delay between. I added the delay originally because something else broke without it but it is possible it was side-effect of some other problem that is already fixed..

(Note that this is not tested in A-Max, I noticed random hangs during normal formatting and above change seemed to fix it)

Quote:
By the way, are you interested in supporting the A2090 partition spec? Then you could boot A2090 HD images using uaehf instead of the flaky old A2090. [You'd need to change the device name to hddisk.device in order for the user's existing mount files to work without modification though. Otherwise just mounting the first OFS partition would be better than nothing.]
Maybe. But only if it is as simple as filling struct DosEnvec with correct data.
Device name change won't happen.
Toni Wilen is online now  
Old 21 June 2017, 20:22   #55
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
OK, here's some info on the "BABE" sector. Some notes first:

- Prep writes a DosEnvec structure which only has 11 longwords (plus TableSize field). That means there are no values for BufMemType, MaxTransfer, Mask, BootPri, DosType, ...
So you can't safely auto-mount/boot from an FFS partition (especially on a system with 32-bit RAM). However, if you modify the DosEnvec to add relevant fields (BufMemType 24BITDMA etc. etc.) then it should work fine (not tested by me).

- Prep always sets the PreAlloc field to the number of sectors per track! (Some later FFS versions no longer support PreAlloc, I think???)

- The HDDisk driver searches for the "BABE" info in sectors 0, 1, ..., 60. So co-existence with an RDB partitioning info would be possible.

- HDDisk uses hard-coded DOS name for the partition, DHx: where x is (unit number)-1. So for ST-506 drive 0, it would use DH0:, for SCSI ID 2 it would use DH4:. Multiple boards could mean the partition gets mounted as DI0: etc.

- I'll post info about the format of the bad block list later. You should show a warning if there is a non-empty bad block list; since uaehf doesn't handle bad block remapping some files could be corrupted. (Prep always puts the bad block list sectors at LBA 1 and LBA 2.)

Code:
Offset	Description
$00.W	$BABE
$02.W	Probably unused, Prep always puts $0000 there.
$04.L	LBA of bad block map, or zero if no bad block map. (Always set to 1 by Prep?)
$08.L	Number of cylinders? E.g. 612 for Miniscribe 3425/8425, 615 for Seagate ST225
$0C.L	Precompensation cylinder
$10.L	Reduced write current cylinder
$14.L	Cylinder number to park heads at after three seconds of inactivity (or 0 to not park)
$18.W	Number of sectors per track
$1A.W	Number of heads

Starting at offset $1C is a DosEnvec structure:
$1C.L	$1C+00	de_TableSize (11 put there by Prep)
$20.L	$1C+04	de_SizeBlock (in longwords, $80 for 512 bytes)
$24.L	$1C+08	de_SecOrg	"not used; must be 0"
$28.L	$1C+0C	de_Surfaces	Number of heads (high word always 0). Prep allows minimum 1, maximum 32
$2C.L	$1C+10	de_SectorPerBlock	Prep sets to 1
$30.L	$1C+14	de_BlocksPerTrack	Number of sectors per track (high word always 0)
$34.L	$1C+18	de_Reserved	Prep sets to 2
$38.L	$1C+1C	de_PreAlloc	"DOS reserved blocks at end of partition" Prep sets this to the number of sectors per track!
$3C.L	$1C+20	de_Interleave	What does Prep set this to???
$40.L	$1C+24	de_LowCyl	Prep always(?) sets to 2
$44.L	$1C+28	de_HighCyl	Last cylinder used by first partition. Minimum 2, maximum (number of cylinders)-1
$48.L	$1C+2C	de_NumBuffers	Number of AmigaDOS sector buffers. Minimum 1, maximum 10000 (allowed by Prep program)

$4C.L	$1C+30	0

Last edited by mark_k; 01 July 2017 at 15:35.
mark_k is offline  
Old 22 June 2017, 20:25   #56
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
Quote:
Originally Posted by Toni Wilen View Post
Is now "implemented". Because some Seagate drive spec says saved pages don't need to be implemented and "The drive only verifies Mode Select Data that is defined as changeable by the drive", I can accept basic pages and ignore the contents

I think anyone who calls MODE SELECT should first use MODE SENSE to check if page is supported, then call MODE SELECT, then MODE SENSE again to check if parameter did change to even detect if parameter is changeable.
The data sent by hddisk doesn't actually include any mode page data, just a mode parameter header and block descriptor. The block descriptor specifies the sector size which the drive should use when executing the following FORMAT UNIT command. Quote from a Seagate product manual (for a much later drive than those available when the A2090 was new):
"The FORMAT UNIT command (see table 33) requests that the device server format the medium into application client accessible logical blocks as specified in the number of blocks and block length values received in the last mode parameter block descriptor (see 4.3.4) in a MODE SELECT command (see 3.11 and 3.12)."

Perhaps the hddisk behaviour was intended to work/tested with contemporary Seagate drives?

Last edited by mark_k; 22 June 2017 at 20:31.
mark_k is offline  
Old 22 June 2017, 20:38   #57
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,865
By the way, hddisk "emulates" command $06 (FORMAT TRACK) for SCSI drives which is what causes FORMAT UNIT to be issued. [I'm not certain whether it actually writes anything for non-zero LBA though.]

If LBA in command block is zero it issues FORMAT UNIT. The is-LBA-zero check is wrong; it only checks that command block bytes 2 and 3 are zero. So if LBA is a multiple of 65536 it will very kindly issue FORMAT UNIT, as well as when LBA is actually zero...
mark_k is offline  
Old 22 June 2017, 21:00   #58
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
Quote:
Originally Posted by mark_k View Post
The data sent by hddisk doesn't actually include any mode page data, just a mode parameter header and block descriptor.
I meant in generic case. I can't just reject any mode select that includes mode pages. Because spec (at least seagate) says that fields that can't be modified are not validated = I can accept mode pages without bad side-effects

If some other controller sends mode select with pages. without breaking it.
Toni Wilen is online now  
Old 28 June 2017, 10:56   #59
sigma63
Registered User

 
Join Date: Oct 2014
Location: Berlin
Posts: 83
Hello Mark and Toni,

are you aware of the Combitec Autoboot-Karte http://amiga.resource.cx/search.pl?p...&base=dec&pid=
for the Commodore A2090(A)? There where some different versions of the Boot-ROMs, which i ripped many years ago .
Should i make some tests and/or should i upload the ROMs (if i find them)?
sigma63 is offline  
Old 28 June 2017, 11:22   #60
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,887
Uploading any previously unknown roms is always a priority!

It may not work directly in current A2090 emulation if the adapter maps the rom differently than A2090a ROM. (Not sure what that PAL chip does, does it also generate autoconfig data?)
Toni Wilen is online now  
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
Guide to setting up A2090a with SCSI2SD RobTurbo support.Hardware 33 03 February 2017 20:17
D3D point/bilinear setting trouble Ami_GFX support.WinUAE 4 10 December 2014 20:23
Trouble Setting up Transcend 4GB IDE Flash Disk mfletcher support.Hardware 15 07 January 2014 11:22
For Sale: A2090a SCSI HD and ST 506 Controller (Zorro2) Zetr0 MarketPlace 5 02 September 2009 10:43
Trouble setting up SCSI CD RW with CSMK3 CU_AMiGA support.Hardware 3 05 August 2008 16:51

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 18:43.


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