Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

disklabel vs. dos partition (reading an sdcard in NetBSD/sparc)



Hello,

Having succeeded in reading data blocks from a micro-sd card in NetBSD
using my SBusFPGA [1] project, I'm now trying to write a basic disk
driver for it (read-only at first).

I was trying to show the partition on the micro-sd with fdisk, and
have managed to not crash the kernel anymore, but fdisk (and
disklabel) always fail with 'device not configured' (ENXIO).

 After a while, I realised this could be normal: the micro-sd has a
DOS-style partition scheme, I'm not 100% NetBSD/sparc will understand
that...

I tracked the ENXIO comes to dk_open(), where it "Fail if we can't
find the partition." (that's the comment above the block that returns
ENXIO). It seems previously, the call to dk_getdisklabel() did not
return an error, because readdisklabel() did not return an error
either, but did not partitions - readdisklabel() simply falls through
all tests and return NULL (no error) at the end, so I only get the
'default' partition table in dk_open() (on /sparc that would be 3
partitions, first two empty and FS_UNUSED hence  the failure, third is
full disk).

Do I need to somehow create a micro-sd card with a Sun or NetBSD
disklabel for my test? (I don't have a NetBSD box with micro-sd, only
big Linux/x86-64...) Is there some way I can add a NetBSD disklabel to
the existing MBR partition scheme?

Thanks in advance & cordially,

Romain

[1] <https://github.com/rdolbeau/SBusFPGA>

-- 
Romain Dolbeau


Home | Main Index | Thread Index | Old Index