Looks like a bug in the 7300 disk driver

Peter Fales pfales at ttrde.UUCP
Tue Jan 10 01:49:55 AEST 1989


I have discovered what appears to be a bug in the hard disk device driver
for the unix-pc.  To demonstrate the bug, open the device "/dev/rfp000",
using open(2) and read four bytes (one int) using read(2).  The
read will actually return 512 bytes!  However, if "/dev/fp000" is used,
the correct value of 4 is returned.

I am using version 3.51 of the operating system.  If anyone wants to try
out the following program on another version of the operating system
I would be interested in their results:

---------------------------------- cut here -----------------------------

#include <stdio.h>
#include <fcntl.h>

int	disk;

main(argc, argv)
char *argv[];
{
	int 	i,x[1024];
	
	disk=open("/dev/rfp000",O_RDONLY);
	if ( disk == -1 ) {
		fprintf(stderr,"Unable to open device /dev/rfp000\n");
		exit(2);
	}

	printf("File is %d\n",disk);
	i=read(disk,x,sizeof(int));
	printf("Read returned %d\n",i);
	printf("First four ints are %x, %x, %x, %x\n",x[0],x[1],x[2],x[3]);
}
-- 
Peter Fales			AT&T, Room 2F-217
				200 Park Plaza
UUCP:	...att!ttrde!pfales	Naperville, IL 60566
Domain: pfales at ttrde.att.com	work:	(312) 416-5357		



More information about the Comp.sys.att mailing list