Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jan 2002 00:02:07 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Kevin Day <toasty@temphost.dragondata.com>
Cc:        <hardware@FreeBSD.ORG>
Subject:   Re: New disk driver can't label?
Message-ID:  <20020117232652.K1448-100000@gamplex.bde.org>
In-Reply-To: <200201161842.g0GIglg00413@temphost.dragondata.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 16 Jan 2002, Kevin Day wrote:

> I just wrote a disk driver for a new disk controller we'll be releasing to
> manufacturing soon. Using the md and ad drivers for an example, I've got it
> MOSTLY working.
>
> This works:
>
> su-2.04# dd if=/dev/zero of=/dev/fabd2 bs=512 count=100
> 100+0 records in
> 100+0 records out
> 51200 bytes transferred in 0.081392 secs (629055 bytes/sec)
> fabd2: invalid primary partition table: no magic

This is normal.  You have the debug.bootverbose set.

> su-2.04# disklabel -r -w fabd2 auto
> fabd2s1: type 0xa5, start 63, end = 150136559, size 150136497 : OK

More output due to bootverbose.  There seems to be an unstated fdisk
operation before this.  Otherwise there would be no s1 slice.

> su-2.04# newfs /dev/fabd2c
> fabd2: invalid primary partition table: no magic

This is not consistent with the above.  You must have had the magic to get
the slice and to not get the "no magic" message.

> ...
> This doesn't, but it works fine on an ad driver:
> ...
> su-2.04# disklabel -r -w fabd2s1 auto
> disklabel: ioctl DIOCGDINFO: Invalid argument
> disklabel: auto: unknown disk type
> fabd2s1: type 0xa5, start 63, end = 150136559, size 150136497 : OK
> /kernel: fabd2: cannot find label (no disk label)
> /kernel: fabd2s1: cannot find label (no disk label)
> /kernel: fabd2: cannot find label (no disk label)
> /kernel: fabd2s1: cannot find label (no disk label)
>
> disklabel and vinum both want to call DIOCGDINFO on fabd2s1, which always
> returns EINVAL, but I can't figure out why my driver appears any differently
> than ad or md. I have to admit I'm really not an expert on the diskslice
> code, so I'm sort of lost. Does anyone have any ideas, or places to point me
> to figure out what I'm doing wrong?

The error messages are mostly the result of earlier operations failing.
disklabel.  DIOCGDVIRGIN on /dev/fabds1 failed for some reason.  I can't
see how it could fail in the diskslice code, since it is just as easy
to reach as DIOCGDINFO in the diskslice code and DICOGDINFO was apparently
reached since it failed correctly (EINVAL for it just means that the
previous steps failed to create the label).  Maybe the diskslice ioctl
is not actually being reached and another DIOCGDINFO is supplying the
EINVAL.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hardware" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020117232652.K1448-100000>