Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!usc!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!ast From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: Re: more on dosread problem Keywords: dosread, disk drives Message-ID: <3837@math.cs.vu.nl> Date: 26 Oct 89 19:18:12 GMT References: <1679@cod.NOSC.MIL> Reply-To: ast@cs.vu.nl (Andy Tanenbaum) Organization: VU Informatica, Amsterdam Lines: 51 In article <1679@cod.NOSC.MIL> hall@cod.NOSC.MIL (Robert R. Hall) writes: >The conclusion of this is, that for dosread works or not depends >on whether or not you disk drive has an even or odd number of sector >per track. Close, but not quite. The issue is whether a partition starts at an odd or even sector, which is often correlated with the number of sectors per track, but is not the same. The next piece of message is actually aimed at Bruce Evans, but I think it is important enough to discuss it publicly. I think the current STUPID_WINI_ADJUST is a real pain and would like to get rid of it. Making the driver do the adjustment automatically is easy, but would mess up reading DOS partitions, where you can't tolerate the adjustment. How about the following solution. We add a new command to fdisk to mark a partition as MINIX. Before using mkfs on a partition made with either the DOS or MINIX fdisk, you would have to run fdisk and issue the command to write some O/S code saying this is MINIX. Once we had required that, the driver could do the STUPID_WINI_ADJUST on MINIX partitions only. I think this solves the problem in a way that users can understand. Before running MINIX on the hard disk, you have to run fdisk (from the floppy system) and mark the MINIX partitions as such. After that, everything is automatic, with even or odd partitions, even or odd heads etc. Code is needed in two places. 1. In at_wini.c when reading the partition table to check for a MINIX partition, and also the #ifdef STUPID_WINI_ADJUST becomes if (stupid_wini_adjust) where stupid_wini_adjust depends on whether the partition being accessed is MINIX or not and starts odd/even or not. All of this information is present in the partition table and can be read in during the initial access. 2. Fdisk, to write MINIX code into the partition table. A nice side effect is that fdisk can now list partitions as MINIX in the display. What do people think of this idea? I would really like to get away from having binaries that are compiled without STUPID_WINI_ADJUST and don't work on some disks and vice versa. Andy Tanenbaum (ast@cs.vu.nl)