From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <04f0925af0b32468a50a00587fbe8d80@plan9.bell-labs.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] "Can't read from nvram: /env/nvrof file does not exist" From: "Russ Cox" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 18 Apr 2003 11:22:52 -0400 Topicbox-Message-UUID: 929baeea-eacb-11e9-9e20-41e7f4b1d025 > If I do this in plan 9 fdisk: > fdisk /dev/sdx0/data > p 1 0 490 > w > q > > once I exit, no partition is there. I assume you actually typed a p1 0 490 w q If you type `p' before writing and quitting, you will notice that the newly created partition has type `EMPTY'. You have to set the partition type with the `t' command, which, I am surprised to say, is undocumented. Sorry. (Type '?' at a fdisk prompt and it will tell you about `t'.) > If I do this: > cat > /dev/sdx0/ctl > > > the partition is there *until reboot*, then it goes away That's because you edited the kernel's in-memory partition table. > Once I fdisk the CF in linux, and use the disk in plan 9, I can: > prep -banw /dev/sdx0/plan9 > the plan9 partitions are there -- until reboot. If, after reboot, you run disk/prep -p /dev/sdx0/plan9 >/dev/sdx0/ctl does that recreate the partitions properly? This is in the standard termrc: for(disk in /dev/sd??) { if(test -f $disk/data && test -f $disk/ctl) disk/fdisk -p $disk/data >$disk/ctl >[2]/dev/null for(part in $disk/plan9*) if(test -f $part) disk/prep -p $part >$disk/ctl >[2]/dev/null } When you need the partitions earlier in the boot process, it is 9load's job to pass that information to the kernel. Sounds like this isn't happening, presumably because 9load can't see your compact flash disk. I think you should try to fix 9load to recognize your CF disk and then you'll be happier all around. If you diff /sys/src/boot/pc/sdata.c /sys/src/9/pc/sdata.c this sticks out as one of the only significant pieces of code that is missing from the 9load version: > > /* > * Beware the CompactFlash Association feature set. > * Now, why this value in Iconfig just walks all over the bit > * definitions used in the other parts of the ATA/ATAPI standards > * is a mystery and a sign of true stupidity on someone's part. > * Anyway, the standard says if this value is 0x848A then it's > * CompactFlash and it's NOT a packet device. > */ > iconfig = drive->info[Iconfig]; > if(iconfig != 0x848A && (iconfig & 0xC000) == 0x8000){ > if(iconfig & 0x01) (The other big difference is there is no DMA support in the 9load version, but that's okay.) Russ