[comp.os.minix] 1.5.0 Bugs/Questions

bunnell@wizard.asel.udel.edu (Tim Bunnell) (01/03/90)

(This is a repost; the first one didn't seem to reach the net)

Here are some more comments on installing/using v1.5.0 and a patch to
at_wini.c that relates to extended DOS partitions.

Hardware
	Gateway 2000 16Mhz '286 with 40 meg ST-251, 1:1 interleave controller
	(brand X i think), 1.2 Meg floppy, 1.44 meg floppy, VGA, 2 serial ports
	and 1 parallel pt. (1 Meg memory)

Libraries & Kernel

+	Aside from a few problems that others have mentioned (4 missing lib
	routines, the empty proto.h files, some compiler warnings (due to
	handling of void?) the library and kernel installed smoothly.  What
	a joy to have the library order posted!

+	The suppiled kernel makefile includes symbol information. Can I make
	any use of this on my 286 system?  For the present, I've removed the
	symbol info to recover several K of memory.

+	Something about the new etc/termcap causes the old version of elle to
	scroll the screen in an odd way.  I have not figured out what it is.
	One line of termcap was not correctly continued with "\".

+	I have had some odd problems that may be timing-related. Sometimes dosread
	fails to read the directory of a valid 1.44 meg drive, other times it
	works!  Once a MINIX file system on a 1.44 meg drive was blown away.
	That might be due to operator error, but I'm not convinced. doswrite
	failed to write a file on my hard disk ('address error' was the message
	via perror). I added a printf near the write to get info about when it
	was failing, but that caused it to work correctly.

+	In two programs (animals and update) that set an alarm timer, I see the
	shell print "Alarm clock" (or the like).  Update simply goes away after
	the alarm message is printed!  Is there a problem with signal? Will this
	behavior clear up when I recompile the shell (still using 1.4 binary)?

Commands

+	Patch dies on ls.c and more.c.  Could the new versions be posted for
	these?

+	Is there a new version of the termcap command?

+	The old kermit no longer sets baud rate correctly.  asld chokes on the
	newly posted kermit with an "out of memory" error.  Could an updated
	kermit binary be posted?

+	the new readclock doesn't work on my system.

+	The new dosread did not work with an extended dos partition on my
	hard drive until the at_wini patch below was installed.

+	tar always extracts all files from a tar file even when only a single
	file is requested.

at_wini

The new dosread which correctly handles /dev/dosC alias /dev/hd1 fails
to read /dev/dosD (linked to /dev/hd2).  This is due to the way DOS
handles extended DOS partitioning.  On my system anyway, the 2nd
partition is a DOS extended partition and it has its own partition
table!  The only thing this table does is define the rest of partition
2 as "virtual" partition 1 (and only) of what DOS thinks is drive D:.
Unfortunately, dosread expects /dev/dosD to look like a valid DOS file
system, sans partition table.  So, when dosread reads the boot area of
/dev/dosD it gets the secondary partition table instead of the boot
area and being unable to digest the info, burps.

I've tried to make the minor device handling for DOS extended
partitions consistent with the way at_wini handles DOS on /dev/hd1 by
having the wini task adjust its internal partition table when a DOS
extended partition is detected.  This saves a lot of coding in dosread
without too much loss of generality in the kernel.  (there was already
one kludge in there for OLD_MINIX partitions anyway :-).  While I was
at it, I changed one comment that was misleading and moved one #define.
The patches below must be applied to the 1.5.0 at_wini.c and to
/usr/include/minix/partition.h (define DOS_EXT there).  Then rebuild
the kernel.

For heavens sake, test the read and dir functions thoroughly on your
system before trying a write!  Note that I've been having lots of other
problems with dosread as well though they seem totally unrelated to the
partition thing.

Despite any glitches, I'm really impressed with this new version. Well done!

Tim Bunnell
<bunnell@henry.asel.udel.edu>
--------------------------------cut here------------------------------------
echo x - at_wini.c.cdif
sed '/^X/s///' > at_wini.c.cdif << '/'
X*** at_wini.c	Sat Dec 30 10:53:24 1989
X--- wini.c	Mon Jan  1 16:31:34 1990
X***************
X*** 50,58 ****
X  /* Miscellaneous. */
X  #define MAX_ERRORS         4	/* how often to try rd/wt before quitting */
X  #define MAX_DRIVES         2	/* this driver supports 2 drives (hd0 - hd9)*/
X! #define NR_DEVICES      (MAX_DRIVES * DEV_PER_DRIVE)
X! #define MAX_WIN_RETRY  10000	/* max # times to try to output to WIN */
X! #define DEV_PER_DRIVE   (1 + NR_PARTITIONS)	/* whole drive & each partn */
X  
X  /* Variables. */
X  PRIVATE struct wini {		/* main drive struct, one entry per drive */
X--- 50,58 ----
X  /* Miscellaneous. */
X  #define MAX_ERRORS         4	/* how often to try rd/wt before quitting */
X  #define MAX_DRIVES         2	/* this driver supports 2 drives (hd0 - hd9)*/
X! #define MAX_WIN_RETRY  10000	/* max # times to try to output to WIN */
X! #define DEV_PER_DRIVE   (1 + NR_PARTITIONS)	/* whole drive & each partn */
X! #define NR_DEVICES      (MAX_DRIVES * DEV_PER_DRIVE)
X  
X  /* Variables. */
X  PRIVATE struct wini {		/* main drive struct, one entry per drive */
X***************
X*** 66,72 ****
X    int wn_maxsec;		/* maximum number of sectors per track */
X    int wn_ctlbyte;		/* control byte (steprate) */
X    int wn_precomp;		/* write precompensation cylinder / 4 */
X!   long wn_low;			/* lowest cylinder of partition */
X    long wn_size;			/* size of partition in blocks */
X    int wn_count;			/* byte count */
X    vir_bytes wn_address;		/* user virtual address */
X--- 66,72 ----
X    int wn_maxsec;		/* maximum number of sectors per track */
X    int wn_ctlbyte;		/* control byte (steprate) */
X    int wn_precomp;		/* write precompensation cylinder / 4 */
X!   long wn_low;			/* absolute start sector of partition */
X    long wn_size;			/* size of partition in blocks */
X    int wn_count;			/* byte count */
X    vir_bytes wn_address;		/* user virtual address */
X***************
X*** 544,549 ****
X--- 544,559 ----
X  		++wn->wn_low;
X  		--wn->wn_size;
X  	}
X+ 	/* DOS Extended partitions seem to have a secondary partition table
X+ 	 * stored on side 0 of the 1st cylinder.  This adjusts wn_low and
X+ 	 * wn_size to skip the secondary partition area by, respectively,
X+ 	 * incrementing and decrementing by the number of sectors per side
X+ 	 * per cylinder.
X+ 	 */
X+ 	if (pe->sysind == DOS_EXT) {
X+ 		wn->wn_low += wn->wn_maxsec;
X+ 		wn->wn_size -= wn->wn_maxsec;
X+ 	}
X    }
X    sort(&wini[base_dev + 1]);
X  }
/
echo x - partition.cdif
sed '/^X/s///' > partition.cdif << '/'
X*** partition..bak	Sat Dec 30 13:37:42 1989
X--- partition.h	Mon Jan  1 15:36:36 1990
X***************
X*** 17,22 ****
X--- 17,23 ----
X  #define	PART_TABLE_OFF	0x1BE	/* offset of partition table in boot sector */
X  
X  /* Partition types. */
X+ #define DOS_EXT		0x05
X  #define MINIX_PART	0x81
X  #define NO_PART		0x00
X  #define OLD_MINIX_PART	0x80	/* created before 1.4b, driver must round */
/