MTD partitioning rewrite
Moin!
I have currently started to do a rewrite of the MTD partitioning and the project might even grow into a complete rewrite of the central MTD code. We will see, how much is needed...
The work will break some current code and should _not_ be included in the cvs for a while. I will maintain my own codebase for a while and feed the changes to David when they mature.
Here are some quick pointers at my design goals:
- An MTD device will be the equivalent of a hard drive. There will be several, named mtda, mtdb, mtdc,...
- Each MTD device can be partitioned into mtda0 (whole device), mtda1, mtda2,...
- The ro-devices don't seem to be necessary. If noone has strong objections, I will just discard those.
- The partitioning should stay out of the mapping drivers as much as possible. The mapping driver only supplies a pointer to the partition table parser. When the device is registered, the partitioning will automatically be read.
- The physmap driver, being the most general one, should be copied/changed to map several devices.
- Big goal: When given a new piece of hardware, I only want to change the kernel configuration, compile, flash and be done with it. Any piece of hardware that needs source code tweaks is a proof that we are not done yet.
If anyone has questions, comments, code sniplets, ideas, anything, you can contact me privately on through the list. I will only try to do the best, _I_ can do and hope, David approves it.
Jörn
Signature · 2 lines
Often, the most striking and innovative solutions come from realizing that your concept of the problem was wrong.
Quoted 2 lines
Here are some quick pointers at my design goals:
[...]
I forgot one:
- Devices may be assigned numbers. Device 0 will become mtda if that one is still free or the first one that is free. Device 1 will become mtdb,...
Jörn
Signature · 2 lines
Open your arms to change, but don't let go of your values.
Moin!
Quoted 3 lines
I have currently started to do a rewrite of the MTD partitioning and the project might even grow into a complete rewrite of the central MTD code. We will see, how much is needed...
The most central work appears to be finished. This is still unusable for any practical purpose, but maybe I am lucky and find another developer who has a look at the code and can show me some bug, give a helpful hint or the like.
So if any of you want to try something really new and really broken, download the tarball from
http://wh.fh-wedel.de/~joern/software/kernel/mtd-0.0.2.tar.gz
To install it, simply unpack it into a linux source tree, recompile and - pray.
I will try to provide new versions nearly daily and might have a running one sometime next week.
Jörn
Signature · 2 lines
Open your arms to change, but don't let go of your values.
Hi!
Quoted 2 lines
To install it, simply unpack it into a linux source tree, recompile and - pray.
http://wh.fh-wedel.de/~joern/software/kernel/mtd-0.0.4.tar.gz
New version, less FIXME's less TODO's. It is now running on my hardware with the rw block driver. Next will be a new physmap driver, then char, then block_ro.
Here is some output, if anyone is interested.
root:~ > ls -l /dev/root
lr-xr-xr-x 1 root root 12 Jan 1 00:00 /dev/root ->
mtdblock/0/2
root:~ > ls -l /dev/mtdblock/
total 0
drwxr-xr-x 1 root root 0 Jan 1 00:00 0
root:~ > ls -l /dev/mtdblock/0/
total 0
brw-rw-rw- 1 root root 31, 0 Jan 1 00:00 0 brw-rw-rw- 1 root root 31, 1 Jan 1 00:00 1 brw-rw-rw- 1 root root 31, 2 Jan 1 00:00 2 brw-rw-rw- 1 root root 31, 3 Jan 1 00:00 3 brw-rw-rw- 1 root root 31, 4 Jan 1 00:00 4 brw-rw-rw- 1 root root 31, 5 Jan 1 00:00 5
Jörn
Signature · 2 lines
A defeated army first battles and then seeks victory. Sun Tzu
Hi!
Quoted 4 lines
New version, less FIXME's less TODO's. It is now running on my hardware with the rw block driver. Next will be a new physmap driver,
then char, thenblock_ro.
http://wh.fh-wedel.de/~joern/software/kernel/mtd-0.0.6.tar.gz
Two people have downloaded the last version, but noone told me that I forgot to include mtdblock.c. Well...
Now the char driver and the procfs file are working, too. The physmap driver *might* be working with multiple devices, it *is* working with only one. Since this might be a problem with either my code or my hardware, this is postponed for a while.
I haven't done any tests without devfs support, yet. That should work, but I haven't even proven it correct.
Jörn
Signature · 3 lines
Beware of bugs in the above code; I have only proved it correct, but not tried it. -- Donald Knuth