[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loadable file systems



Hi!

I recently noticed the following lines in filesys.c, at the very end
of load_filesys():

#if 0
/* here, we invalidate all old drives EXCEPT for ones we're already using (at
 * this point, only the bios devices should be open)
 * this gives newly loaded file systems a chance to replace the
 * default tosfs.c
 */
	for (i = 0; i < NUM_DRIVES; i++) {
		if (d_lock(1, i) == 0)	/* lock if possible */
			d_lock(0, i);	/* and then unlock */
	}
#endif

Doesn't the removal of this code mean that a (hypothetical) loadable
TOS filesystem driver can't replace the builtin TOSFS on drives that
have already been accessed?
(Until the next media change, of course - which can be quite a long
time for non-removable media... :-))

I *suppose* this code was disabled because it causes unnecessary
(and time-consuming) floppy accesses during the boot process; or
was there another reason?

Anyway - the following version appears to fix both problems:

#if 1
/* here, we invalidate all old drives EXCEPT for ones we're already using (at
 * this point, only the bios devices should be open)
 * this gives newly loaded file systems a chance to replace the
 * default tosfs.c
 */
	for (i = 0; i < NUM_DRIVES; i++) {
		/* Only touch drives that were previously accessed...
		 * (in order to prevent those pesky floppy accesses
		 *  during bootup)
		 * Note: no need to use aliasdrv[] here because mint.cnf
		 * hasn't been processed yet...
		 */
		if (drives[i] != 0 && d_lock(1, i) == 0)	/* lock if possible */
			d_lock(0, i);	/* and then unlock */
	}
#endif

Martin

-- 
 Martin Koehling // NEW email address: mk@anuurn.ruhr.de