In case anyone could be interested: I found a workaround. As far as I understand the disk structure of an internal ramdisk, I would regard the workaround as to be senseless, but it works:
OpenBSD 3.9: Problem: Using disklabel on /dev/rd0c causes a kernel panic. Workaround: Use fdisk on rd0, create a new partition of type A6. Do not use fdisk -i, because it will use startcylinder and head "1", while you must use start cylinder and head "0" (zero). Use fdisk -e instead. Once you have done that, try to disklabel your ramdisk the way you want. When using newfs, this may still not work. Look at the error message, you may probably have to modify blocksizes in disklabels xpert mode. So look at newfs output and apply its requirements to disklabel. It's crap but we love it. T. > Hi! > > Using the ramdisk kernel feature results in a kernel problem when I use > the disklabel command on the ramdisk. > > This is what I do : > Use 3.9 (tried sys.tgz from mirror as well as updated sources from cvs) > in /usr/src/sys/arch/i386/conf > > cp GENERIC Test > echo pseudo-device rd 1 # ramdisk>>Test > config Test > cd ../compile/Test > make clean && make depend && make > cp bsd /bsd.1 > reboot > > At the boot prompt I give "boot bsd.1" to boot the newly created kernel. > I log in as root and enter > "rdconfig /dev/rd0c 4500 &" > rdconfig does not return, so this seems to work OK. I now have to > disklabel that partition: > > disklabel -E rd0 > > which makes the kernel go into debug mode. Always. Message is: > > Kernel: integer divide fault trap, code=0 > Stopped at rdstrategy +0x49; divl 0x28(%ecx),%eax > > I do not need a miniroot environment or such, I just need a RAMDISK, so > I did not add the RAMDISK_HOOKS or the MINIROOTSIZE. > > Am I doing something wrong or is that a bug somewhere? I had this > working with 3.5 the way I did it now, but maybe I need to add something > else to the kernel config? > > Regards, > T.