Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!axion!gapos!davep From: davep@gapos.bt.co.uk (Dave Parkinson) Newsgroups: comp.os.minix Subject: SCSI drives & ST01 interface Keywords: SCSI ST01 AT Message-ID: <1990Nov26.163451.21348@gapos.bt.co.uk> Date: 26 Nov 90 16:34:51 GMT Sender: usenet@gapos.bt.co.uk (Usenet login) Organization: British Telecom Applied Systems. Lines: 74 I have recently bought MINIX 1.5 and installed it on my AT (& also discovered the net). As I'm new to the net I've missed any preceeding traffic on SCSI drivers but herewith my experiences. In installing MINIX I've had to clear a reasonable amount of space on my hard disk to make room for it. (Now 25M DOS, 15M Minix). As always I want more space! I have an accumulation of bits & pieces acquired over the years, including some early winchester drives & SASI/SCSI controllers. ( How about a full-height 5.25" winchester with a capacity of 5M - yes five!). Anyway I decided to press into service some of these Winchesters with an Adaptec ACB-4000 Winchester Disk Controller (circa March 1984). To interface to this I purchased the Seagate ST01-B SCSI Host adapter (cheap). Then the fun started... Initially I wrote a simple test driver that ran OK under Dos - this I then ported to MINIX. After spending a while debugging things and recompiling the kernel many times I've decided the ST01 (or ST02) driver belongs in MSDOS, not MINIX.... The salient points of the ST01 interface are: * The interface is memory mapped. (requires a GDT entry similar to the video interface). * The card does not support DMA. (the Seagate DOS driver uses REP MOVSB). (I don't know how successful it would be trying to use memory-memory DMA. The DMA controllers are only 16-bit - there is a latch that holds the high address bits. [This is why you can't DMA transfer across a physical 64k boundary]. Because of this you could only transfer within the same physical 64k segment, not directly between the ST01 and the source/destination buffer). * The SCSI REQ/ACK handshake is handled by the ST01 which uses I/O Channel ready to delay the 8x8x processor. (But this times-out after 13.2us should the processor attempt a read/write too far in advance of the SCSI REQ signal being asserted). * The only interrupt condition the card supports is interrupt on select. (ie if something out there on the SCSI BUS asserts select, the ST01 will interrupt so you can check & see if it's you they're after). With SCSI: * Whilst the Host initiates a SCSI activity/transfer, all the transfers across the SCSI bus are under the control of the TARGET, not the HOST. (It is the target that controls all the lines other than ACK. The target sets the speed of the transfer, and the time of the transfer). The conventional disk drivers set up the command, initialise the DMA channel to look after the data transfer, and then suspend themselves and await the interrupt on completion - a reasonably efficient process in a multi-tasking environment. With the ST01 you cannot do this. DMA is out, and the process has to run all the time - even while the drive is seeking to the requested track. (My Adaptec controller does not support a 'disconnect & please signal me when you've completed the command' mode of operation. Other drives/ controllers might). Another problem is that if the task is interrupted during a transfer, then the Target can time-out and abort the transfer that is progress. (Having asserted REQ, the Target expects an ACK from the host within a certain time-period - 250ms in the case of the Adaptec). Thus interrupts have to be disabled during the entire transfer operation. I reached the stage where fdisk ran Ok, but I had problems with readall. Initially the machine 'locked' at the start or after reading a few sectors. (This point I don't fully understand as my driver was not disabling interrupts at the time - so surely the F1/F2 keys should have produced screen displays?). Adding lock() and unlock() commands either side of my scsi_op() call improved matters (see previous para). Readall would run for maybe 20 seconds before the machine locked-up. (I'm using the standard PH distribution with only a small mod to the keyboard drivers so they suppot a UK keyboard). For now I've decided to get my extra DOS disk space from the ST01 + external SCSI drives, and MINIX will use the more efficient embedded AT drive..... Anyone else got any better ideas?