Path: utzoo!attcan!uunet!mcvax!hp4nl!philmds!nlgvax!johan From: johan@nlgvax.UUCP (Johan Stevenson) Newsgroups: comp.os.minix Subject: Re: MINIX ST: Bug in stwini.c ??? Keywords: Harddisk driver ACSI bus stwini.c Message-ID: <198@nlgvax.UUCP> Date: 18 Jan 89 19:46:46 GMT References: <805@faui10.informatik.uni-erlangen.de> Reply-To: johan@nlgvax.UUCP (Johan Stevenson) Organization: Philips Research Geldrop Lines: 24 In article <805@faui10.informatik.uni-erlangen.de> dkhusema@faui49.uucp (Dirk Husemann) writes: > > Hi! > > Just out of curiosity I examined the MINIX ST winchester device driver >on friday night. There's one place in it which I've trouble understanding why >it was done the way it's done ... > >... Although I admit I haven't tested it with more than one drive ever, I still believe the code to be correct. The comment in the file stwini.c explains the reason, although rather terse. The current driver supports up to 8 controllers, each having up to 2 drives, each with 8 partitions (4 real partitions, 4 fake). A minor device number contains the following bit fields: 0 C C C D P P P where C=controller, D=drive_on_controller, P=partition_on_drive. A variable 'drive' contains the following bit fields: 0 0 0 0 C C C D In cmdhead() one needs to specify the controller, so (drive>>1). In cmdtail() one needs to specify the drive_on_controller, so (drive&1). -- Johan W. Stevenson johan@pcg.philips.nl Philips Research