Xref: utzoo unix-pc.general:2056 comp.sys.att:5214 Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!agate!bionet!csd4.milw.wisc.edu!uxc!deimos!rutgers!att!genesis!andys From: andys@genesis.ATT.COM (a.b.sherman) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: Looks like a bug in the 7300 disk driver Summary: Whole blocks or block boundaries? Message-ID: <517@genesis.ATT.COM> Date: 12 Jan 89 22:06:31 GMT References: <813@ttrde.UUCP> <1360@mtunb.ATT.COM> <513@genesis.ATT.COM> <5660@cbmvax.UUCP> Reply-To: andys@shlepper.ATT.COM (a.b.sherman) Organization: AT&T Bell Laboratories, West Long Branch, N.J. Lines: 34 In article <5660@cbmvax.UUCP> ditto@cbmvax.UUCP (Michael "Ford" Ditto) writes: >In article <513@genesis.ATT.COM> andys@shlepper.ATT.COM (a.b.sherman) writes: >>It is *NOT* a feature it's a bug. See below. >[ ... ] >>Why a CHARACTER device must program its DMA device in BLOCK >>multiples escapes me. Regardless of the block size, you can always >>tell a DMA controller to transfer X bytes or X words. > >Well, there's your problem: It's not a CHARACTER device. The /dev/r* >devices are RAW device interfaces; that's what the 'r' stands for. When >you access any raw device, you have to do it in accordance with that >particular device's physical requirements. In the case of the Unix PC's >hard disk interface (and those of most other computers), partial block >transfers are not possible. The so-called "block" device can be used >for more "structured" access (like 4 bytes at a time, etc.). > >According to the "Unix Implementation" paper by Ken Thompson, the term >"character I/O" is "a complete misnomer". Most of this is true. However, I disagree with the assertion that most computers' disk controllers require you to DMA in sector multiples. I believe that most or all disk controllers will require that you begin your I/O *on a sector boundary*, because you can only seek to a sector. However, the transfer length is generally given as a word count, not a sector count. If you give a word count of 2 on a 16-bit controller, you will get 4 bytes. I *have* seen the restriction that the transfer must be a multiple of the word size, because you DMA words, not bytes, on most busses. -- andy sherman / at&t bell laboratories (medical diagnostic systems) room 2e-108 / 185 monmouth pkwy / west long branch, nj 07764-1394 (201) 870-7018 / andys@shlepper.ATT.COM ...The views and opinions are my own. Who else would want them?