Adding devices at runtime

Jörn Engel joern at wohnheim.fh-wedel.de
Thu Oct 31 22:30:07 EST 2002


On Thu, 31 October 2002 21:06:51 -0500, Pavel Roskin wrote:
> If I understand correctly, the MTD driver allows to define two devices in
> predefined memory areas - one using the CFI driver (CONFIG_MTD_PHYSMAP),
> the other using the MTDRAM driver (CONFIG_MTD_MTDRAM).
> 
> What if I want more MTD devices in the known memory areas?  Can I register
> them at runtime, when the kernel is loaded?  Is it possible to do it
> without using modules?  Can I do it without changing the kernel (I mean 
> something like "echo 200000 20000 2 >/proc/mtd").
> 
> I realize that the question is very basic, but my search for "add" and
> "register" in the HOWTO from CVS didn't bring any positive results.
> 
> Can it be that I want something wrong?  I simply want to boot from one
> flash device and be able to access (and possibly rewrite) that device and
> another device.  Both are supported by the JEDEC driver
> (CONFIG_MTD_JEDECPROBE), but they use different (not adjacent) memory
> areas.  (Of course I hacked drivers/mtd/maps/physmap.c to probe
> "jedec_probe", but I know that it's already done right in MTD CVS.)
> 
> Right now I have to use the MTDRAM driver on the boot device, so the I
> cannot rewrite it (I haven't tried, but I don't expect it to work).  I can
> only rewrite the other chip.

Could you be a little more verbose on what your problem is? What kind
of mtd devices do you have, what do you want to do with them, why
register one of them at runtime,...

Something really high level would be nice, too. "I want to run linux
on a d-box and write some data to a cf-card once a day.", something
like that.

It is possible to register devices at runtime. But I don't know of any
driver that gives you an interface to do so without insmod'ing it. A
question of some 50 lines of code to add that functionality.

Jörn

-- 
If System.PrivateProfileString("",
"HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") <>
"" Then  CommandBars("Macro").Controls("Security...").Enabled = False
-- from the Melissa-source




More information about the linux-mtd mailing list