9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] "Can't read from nvram: /env/nvrof file does not exist"
Date: Fri, 18 Apr 2003 11:22:52 -0400	[thread overview]
Message-ID: <04f0925af0b32468a50a00587fbe8d80@plan9.bell-labs.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0304180808020.19033-100000@maxroach.lanl.gov>

> 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
> <some partition info>
>
> 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



  reply	other threads:[~2003-04-18 15:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-17 23:18 ron minnich
2003-04-17 23:24 ` Russ Cox
2003-04-18  3:10   ` Dan Cross
2003-04-18  3:13     ` Russ Cox
2003-04-18 14:12     ` ron minnich
2003-04-18 15:22       ` Russ Cox [this message]
2003-04-18  3:24   ` Russ Cox
2003-04-18  6:13     ` Dan Cross
2003-04-18 14:17       ` ron minnich
2003-04-18 18:33         ` Dan Cross
2003-04-18 18:37           ` rsc
2003-04-18 18:38             ` ron minnich
2003-04-18 18:39             ` Dan Cross
2003-04-18 19:30             ` ron minnich
2003-04-18 19:43               ` Russ Cox
2003-04-18 19:51                 ` ron minnich
2003-04-18 19:56                   ` rsc
2003-04-18 14:13     ` ron minnich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04f0925af0b32468a50a00587fbe8d80@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).