Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ames!ucbcad!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Making a custom Filing System Message-ID: <8705210808.AA12542@cory.Berkeley.EDU> Date: Thu, 21-May-87 04:08:54 EDT Article-I.D.: cory.8705210808.AA12542 Posted: Thu May 21 04:08:54 1987 Date-Received: Sat, 23-May-87 10:07:21 EDT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 51 Chuck McManis writes: >Scott you presuppose a disk controller. The current Amiga software cannot >detect a corrupt sector. Paula reads in the bits and the blitter decodes >them, then the driver pulls out the sector you want. No automatic CRC >checking is done like on other systems. Also note that on a PC or ST >the sector consists of a start of sector byte, track, and sector number, >start of data, 512 bytes of data, and two bytes of CRC. so they are really >512+2+2+2 (518) bytes long. Yes it would be possible to make sectors on >the Amiga with a Data Area 512 bytes long but that would needlessly >complicate calculating where in the track buffer to read the data from. >(sector * 536) anyone? The Checksum in the sector provides the same >function as the CRC in everyone elses sectors. Sorry, Scott is correct. Although Paula may have no idea what it is decoding, the trackdisk.device certainly does. A sector on the Amiga's floppy is MFM-formatted as follows (taken from RKM II): two bytes of 00 data (MFM = AAAA each) two bytes of A1 (sync bytes.. MFM encoded A1 without clock pulse) one byte of format-byte (Amiga 1.0 format = FF) one byte of track number one byte of sector number one byte of sectors until end of write 16 bytes OS recovery (the label area) 4 bytes of header checksum 4 bytes of data area checksum 512 bytes of data total: 544 bytes (before MFM encoding) per sector, or about 935K raw data. I'm neglecting to tell you all how all of this is MFM encoded as it is beyond the current conversation. So you see, an Amiga sector contains just as much information as normal disk sector formats. The big difference is that there is no spacing between sectors, and only a small spacing allowing for write DMA overlap. Note that the sector is fully labeled with track and sector number, and completely checksummed. The DOS checksum IN the data has nothing to do with the sector format and is a DOS thingy. It *does* provide a nice double-check on data integrity though. The 'sectors until end of write' is used for optimization. You see, when the Amiga DMA's a track in, it doesn't really care where in the track it starts DMAing (thus, there is no lag time waiting for some specific sector to come around). This field allows the driver to pick out just where it actually starting writing when it write the track out previously. This is needed because there *is* a certain amount of overlap when writing out sectors and it's nice to know where the garbage is expected to be. The disk controller can be given a word to search for before starting DMA, so you at least get the track on a sector boundry. -Matt