Subject: disk ioctl's and checksums
To: None <amiga-dev@NetBSD.ORG>
From: None <henson@colossus.mathcs.rhodes.edu>
List: amiga-dev
Date: 06/28/1995 06:56:32
 I have two questions. Here is my situation: I can not use the floppy
drive because I can not write a disk label to a floppy, and therefore
can not newfs the floppy. The exact error is:

disklabel: ioctl DIOCSDINFO: Label magic number or checksum is wrong!
(disklabel or kernel is out of date?)

 First, how does the ioctl() mechanism work (briefly)? How does
disklabel's call of ioctl(... DIOCSDINFO ...) translate to the
function "setdisklabel" in fd.c?  The error code which produces
the error message I quoted above is the result of the 
ioctl call, and the error in EINVAL, invalid argument.

 Second, should the checksum of a disklabel always be 0? Some of
the functions in fd.c make the assumption that it should, but from
looking at the code, I think they should check the calculated checksum
against the checksum stored in the disklabel itself.


Thanks,
Mike Henson
henson@colossus.mathcs.rhodes.edu