Path: utzoo!attcan!uunet!husc6!mit-eddie!killer!chasm From: chasm@killer.DALLAS.TX.US (Charles Marslett) Newsgroups: comp.os.minix Subject: Re: Initialization in floppy.c (IBM/AT Minix 1.3d) Summary: Initialization of floppy drives 2 and 3 Message-ID: <6527@killer.DALLAS.TX.US> Date: 22 Dec 88 13:49:39 GMT References: <5994@louie.udel.EDU> <1831@ast.cs.vu.nl> Organization: The Unix(R) Connection, Dallas, Texas Lines: 62 In article <1831@ast.cs.vu.nl>, ast@cs.vu.nl (Andy Tanenbaum) writes: > In article <5994@louie.udel.EDU> jnall%FSU.BITNET@cunyvm.cuny.edu (John Nall 904-644-5241) writes: > >Within the last few weeks (or perhaps months) someone posted a message > >which stated, essentially, that the floppy disk driver was not being > >initialized properly I think that was me -- I was unable to read or write to fd2 or fd3 on my Heathkit Z150 until I copied a chunk of code from the IBM AT BIOS into the floppy initialization code. > I don't quite understand how this could happen. The boot block uses the > BIOS to read in the operating system. Having read in 100K + of data, the > BIOS has used the floppy disk controller over and over, and it certainly > is initialized to something. If you use a 360K diskette for booting and > 1.2M after that, it should still work because floppy.c detects the error > and tries other densities. Could someone please explain the problem more > clearly? My comment had nothing to do with the "normal" drives that the BIOS is aware of -- it had to do with a configuration where a MSDOS driver would have been required to access the additional drives anyway (I assume an AT would have not required the additional code, since it came from an AT BIOS in the first case). This is what my reset code looks like: ============================ from floppy.c in kernel =================== PRIVATE reset() { /* Issue a reset to the controller. This is done after any catastrophe, * like the controller refusing to respond. */ int i, r, old_state; register struct floppy *fp; /* Disable interrupts and strobe reset bit low. */ need_reset = FALSE; old_state = lock(); motor_status = 0; motor_goal = 0; port_out(DOR, 0); /* strobe reset bit low */ port_out(DOR, ENABLE_INT); /* strobe it high again */ restore(old_state); /* interrupts allowed again */ receive(HARDWARE, &mess); /* collect the RESET interrupt */ /* Interrupt from the reset has been received. Clear each drive. */ for (i=0; i Andy Tanenbaum (ast@cs.vu.nl) Charles Marslett (chasm@killer.dallas.tx.us)