Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2002 12:42:47 -0600 (CST)
From:      Kevin Day <toasty@temphost.dragondata.com>
To:        hardware@freebsd.org
Subject:   New disk driver can't label?
Message-ID:  <200201161842.g0GIglg00413@temphost.dragondata.com>

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

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
su-2.04# disklabel -r -w fabd2 auto
fabd2s1: type 0xa5, start 63, end = 150136559, size 150136497 : OK
su-2.04# newfs /dev/fabd2c
fabd2: invalid primary partition table: no magic
Warning: 2320 sector(s) in last cylinder unallocated
/dev/fabd2c:    150136560 sectors in 36655 cylinders of 1 tracks, 4096 sectors
        73308.9MB in 2291 cyl groups (16 c/g, 32.00MB/g, 7936 i/g)
super-block backups (for fsck -b #) at:


This doesn't, but it works fine on an ad driver:

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.092964 secs (550751 bytes/sec)
fabd2: invalid primary partition table: no magic
su-2.04# fdisk -I fabd2
******* Working on device /dev/fabd2 *******
fdisk: invalid fdisk partition table found
su-2.04# fdisk fabd2
******* Working on device /dev/fabd2 *******
parameters extracted from in-core disklabel are:
cylinders=148945 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=148945 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 63, size 150136497 (73308 Meg), flag 80 (active)
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 464/ sector 63/ head 15
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
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)
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?

Thanks,

Kevin

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?200201161842.g0GIglg00413>