9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] nvram
Date: Tue, 28 Jul 2009 14:37:54 -0400	[thread overview]
Message-ID: <7b4b5f4e3a1df214c975d7cd2d6dc38f@quanstro.net> (raw)
In-Reply-To: <ed05e2587e339f5d4eea7b54ce93419f@quanstro.net>

> i guess i need to update this man page.  i didn't recall the
> search algorithm was documented.  thanks for pointing that out.

sorry for the obtuse reference.  now that i've made it on the list,
i'll just explain myself.  i made a local change to how
nvram is found because i kept needing to update the search to
add new drives.  sata has made it more difficult to just enumerate
the possibilities.  a vanilla machine can have 2 ahci controllers
and up to 32 drives per controller.  devsd supports up to 16 drives
per controller, which covers existing hardware.  that becomes annoying
to enumerate.  my test machine has 1 ahci, 2 ide, 1 mv50xx, 2 marvell orion
and 1 loopback controller. since the current approach requires 2 entries per
drive, i changed to this algorithm:

1.  read #S/sdctl.  gather a list of device ids.  example /dev/sdC, /dev/sdE.
2.  for each device, probe drives 0-f.  example /dev/sdE[0-f].  both
a partition named "nvram" and 9fat/plan9.nvr are probed.

note:
a.  probes on other devices are unchanged.
b.  i modified sd so that each sd device produces exactly 1 line in #S/sdctl.
the parallel scsi drivers had previously been missing.

bugs:
a.  non-sd disks like usb still can't be used with this scheme.
b.  probe order depends on the order of sd devices in your kernel
config.

one could argue that you should just plug your nvram drive into a
low-numbered port, but i kept running situations where i couldn't
use the ports i wanted due to chassis constraints.  ahci also provides
a mechanism for disabling ports, so it's anyone's guess what ports
are actually available.

this change as worked well on my personal system and at coraid
for the past 6 months.  it just works.  even on hitherto unknown
controllers like the orion.

- erik



  reply	other threads:[~2009-07-28 18:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 17:58 Lyndon Nerenberg
2009-07-28 18:08 ` erik quanstrom
2009-07-28 18:37   ` erik quanstrom [this message]
2009-07-29 13:43     ` Dan Cross
2009-07-29 13:48       ` erik quanstrom
2009-07-30 16:05         ` sqweek
2009-07-30 16:08           ` erik quanstrom
2009-07-30 16:22             ` sqweek
2009-07-30 17:58               ` erik quanstrom
2009-07-30 18:12           ` Steve Simon
2009-07-30 18:45             ` erik quanstrom
2009-07-28 21:59   ` Adriano Verardo
2009-07-28 18:09 ` ron minnich
2009-07-28 19:24   ` erik quanstrom
2009-07-28 22:38     ` ron minnich
  -- strict thread matches above, loose matches on Subject: below --
2005-05-12 14:48 Sergey Reva
2005-05-12 15:10 ` Ronald G. Minnich
2005-05-12 16:47   ` Skip Tavakkolian
2005-05-12 23:52     ` Dan Cross
2005-04-03 12:50 Sergey Reva
2005-04-03 13:39 ` Russ Cox
2005-04-03 14:44   ` Sergey Reva
2005-04-03 15:07     ` Russ Cox
2005-04-04 10:03       ` C H Forsyth
2005-04-03 16:47     ` Sergey Reva
2003-08-26 21:17 [9fans] NVRAM Kenji Arisawa
2003-08-26 22:22 ` zfolkerts
2003-08-26 22:37   ` Kenji Arisawa
2003-08-26 22:49 ` ron minnich
2003-08-26 23:06   ` Kenji Arisawa
2000-09-06 23:21 [9fans] nvram Russ Cox
2000-09-06 23:33 ` Boyd Roberts
2000-09-06 23:00 jmk
2000-09-06 23:05 ` Boyd Roberts
2000-09-06 13:24 [9fans] Re: Kernighan interview (w/ Plan 9 mention) forsyth
2000-09-06 22:47 ` [9fans] nvram Boyd Roberts
2000-09-06 22:52   ` Boyd Roberts

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=7b4b5f4e3a1df214c975d7cd2d6dc38f@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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).