public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* cramfs and mtd
@ 2001-04-19  9:21 Bjorn Wesen
  2001-04-19 11:33 ` David Woodhouse
  0 siblings, 1 reply; 39+ messages in thread
From: Bjorn Wesen @ 2001-04-19  9:21 UTC (permalink / raw)
  To: mtd

When using cramfs directly on a ROM chip like below.. can we make
cramfs/inode.c talk to mtd to find a chip maybe instead of using direct
pointers like I do in my small patch below ? That is, would it mess up
inode.c to the degree that it would not be accepted in the mainline kernel
? :) Or is there a better way to do this ?

(Yes of course - JFFS2 - but except that, then :)

/BW

--- inode.c     2001/04/02 12:48:08     1.1.1.3
+++ inode.c     2001/04/04 14:57:00     1.9
@@ -22,6 +22,8 @@

 #include "cramfs.h"

+#define CRAMFS_AS_IMAGE 
+ 
 static struct super_operations cramfs_ops;
 static struct inode_operations cramfs_dir_inode_operations;
 static struct file_operations cramfs_directory_operations;
@@ -97,6 +99,29 @@
  * Returns a pointer to a buffer containing at least LEN bytes of
  * filesystem starting at byte offset OFFSET into the filesystem.
  */
+ 
+#ifdef CRAMFS_AS_IMAGE
+
+/* Normally, cramfs_read reads from offset and len bytes on a block
device.
+ * But if we have an attached image piggybacked on the end of the kernel
+ * (a la krom/romfs) we can use this trivial routine.
+ */
+
+extern unsigned char *romfs_start;  /* set in head.S during boot */
+extern unsigned int romfs_length;   /* dito */
+  
+/*
+ * Returns a pointer to a buffer containing at least LEN bytes of
+ * filesystem starting at byte offset OFFSET into the filesystem.
+ */
+static inline void *cramfs_read(struct super_block *sb, unsigned int
offset, unsigned int len)
+{
+       return romfs_start + offset;
+}
+
+#else /* CRAMFS_AS_IMAGE */
+
 static void *cramfs_read(struct super_block *sb, unsigned int offset,
unsigned int len)
 {
        struct buffer_head * bh_array[BLKS_PER_BUF];
@@ -146,6 +171,7 @@
        return read_buffers[buffer] + offset;
 }

+#endif

 static struct super_block * cramfs_read_super(struct super_block *sb,
void *data, int silent)
 {





To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 39+ messages in thread
[parent not found: <3AE43929.3695C91D@daniel.com>]
* RE: JFFS2 as root FS
@ 2001-04-18 20:33 Williams, Kevin M.
  0 siblings, 0 replies; 39+ messages in thread
From: Williams, Kevin M. @ 2001-04-18 20:33 UTC (permalink / raw)
  To: 'mtd@infradead.org'

Vipin wrote:
>Well, the kernel may not be able to understand the 
>"mtdblock1" device by name unless you patched the 
>init/main.c file to list a conversion table from 
>mtdblockxx to a *device number*.

Can you please tell me where I can find more information on doing this?  I
have downloaded and grepped the mailing list archives, and looked in the
patches, but only the 2.2.x patches seem to have any changes to main.c
included and those changes do not do what you are describing here.  Reading
mailinglist archives shows I may also need to modify filesystems.c.

Is there a patch file for anything after the official 2.4.0 kernel
available?

I am using a mainline 2.4.3-pre3 kernel and simply copied from the latest
ftp snapshot into my kernel's /fs, /include, and /kernel directories.  It
worked (at least the CFI_probe part did), and if I mknod I can create
entries in my /dev directory and erase them ok (maybe mknod is the wrong
thing to do, I don't know, but erase really does work now!), but mount is
still not working (it returns "bad area!!" and says something like I may
have "wrong device # or fstype not supported").  

I tried enabling CONFIG_MTD_CHAR and CONFIG_MTD_BLOCK but that did not make
anything come up in my /dev directory.

I think I have not completely updated my kernel...

Thank you.

Kevin
 



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 39+ messages in thread
* Re: A pair of stupid questions, I hope
@ 2001-04-18  8:02 David Woodhouse
  2001-04-18 16:41 ` JFFS2 as root FS Joakim Tjernlund
  0 siblings, 1 reply; 39+ messages in thread
From: David Woodhouse @ 2001-04-18  8:02 UTC (permalink / raw)
  To: ian.nelson; +Cc: mtd@infradead.org


ian.nelson@echostar.com said:
>  I'll ask the guys who need it.  I suspect the proposal would be an
> ISLOCKED ioctl that takes a region as an argument and returns a 0 or
> 1.   I'm a flash novice though, is this something that should go in to
> one of those region structures? 

I was thinking of the internal API - what method do we add to the struct 
mtd_info, and how generic can we make it? Aren't there other similar 
per-block data which we may want to query on some chips?

--
dwmw2




To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2001-04-24 12:23 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-19  9:21 cramfs and mtd Bjorn Wesen
2001-04-19 11:33 ` David Woodhouse
2001-04-19 13:44   ` mkfs.jffs2 again Joakim Tjernlund
2001-04-19 13:52     ` David Woodhouse
2001-04-19 13:56       ` Joakim Tjernlund
2001-04-19 20:06       ` JFFS2 as root FS Joakim Tjernlund
2001-04-20 16:26         ` David Woodhouse
2001-04-21  8:07           ` Joakim Tjernlund
2001-04-21 11:22             ` David Woodhouse
2001-04-21 20:22               ` Joakim Tjernlund
2001-04-23  1:52                 ` David Schleef
2001-04-23  6:15                   ` Joakim Tjernlund
2001-04-23  9:28                   ` Joakim Tjernlund
2001-04-23  9:31                     ` David Woodhouse
2001-04-23 11:00                       ` David Schleef
2001-04-23 11:04                         ` David Woodhouse
2001-04-24  1:56                           ` David Schleef
2001-04-21 12:08             ` David Woodhouse
2001-04-21 20:14               ` Joakim Tjernlund
2001-04-21 22:18                 ` David Woodhouse
     [not found] <3AE43929.3695C91D@daniel.com>
2001-04-24 12:22 ` Joakim Tjernlund
  -- strict thread matches above, loose matches on Subject: below --
2001-04-18 20:33 Williams, Kevin M.
2001-04-18  8:02 A pair of stupid questions, I hope David Woodhouse
2001-04-18 16:41 ` JFFS2 as root FS Joakim Tjernlund
2001-04-18 16:50   ` David Woodhouse
2001-04-18 17:00     ` Joakim Tjernlund
2001-04-18 17:05       ` David Woodhouse
2001-04-18 18:58         ` Joakim Tjernlund
2001-04-18 17:11   ` Vipin Malik
2001-04-18 19:24     ` Joakim Tjernlund
2001-04-18 20:19       ` Vipin Malik
2001-04-18 22:00         ` Joakim Tjernlund
2001-04-19  8:28           ` Florian Schirmer / TayTron
2001-04-19 10:26         ` Joakim Tjernlund
2001-04-19 13:02           ` Florian Schirmer / TayTron
2001-04-19 12:45             ` Joakim Tjernlund
2001-04-19 13:02               ` David Woodhouse
2001-04-19 14:55                 ` Nicolas Pitre
2001-04-19 16:44           ` Vipin Malik
2001-04-19 19:59             ` Joakim Tjernlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox