boot from jffs

Justin Wojdacki justin.wojdacki at analog.com
Wed Jun 19 13:02:16 EDT 2002


"Áº²¨" wrote:
> 
> Hi,everybody
> I would like to use mkfs.jffs to create a flash image I can burn into flash.
> 
> but the question is I don't know how to boot from this image.
> 
> the kernel of our system is 2.4.18 and the platform is ppc 8xx_io
> series(ppc823)
> 
> How to setup jffs/mtd as the root filesystem/dev for our system?
> 
> Thanks,
> 
>    -- nielsen
> 

Is your kernel in the filesystem? If it is, then your bootloader needs
to be able to load the kernel into memory from the filesystem. It's
not that hard to do. Easiest thing to do is the following:

1. Hardcode path to kernel. Let's use "/boot/vmlinuz" in this example.
2. Find the jffs2_raw_dirent for the "/boot" directory and record it's
inode number
3. Find the jffs2_raw_dirent for "vmlinuz" that has parent inode ==
"/boot"'s inode and record it's inode number
4. Process all the jffs2_raw_inode's that have the same above's inode
number
5. Jump to kernel entry point

Also, how are you partitioning your flash? You'll probably want to
setup an MTD map for the flash (drivers/mtd/maps), and as part of the
init function, you use MKDEV() to specify the root paritition. 

-- 
-------------------------------------------------
Justin Wojdacki        
justin.wojdacki at analog.com         (408) 350-5032
Communications Processors Group -- Analog Devices




More information about the linux-mtd mailing list