All of lore.kernel.org
 help / color / mirror / Atom feed
* Mounting JFFS2, Bootloader
@ 2002-07-11 12:28 Daniel Belz
  2002-07-11 17:08 ` Justin Wojdacki
  2002-07-12 15:43 ` Marius Groeger
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Belz @ 2002-07-11 12:28 UTC (permalink / raw)
  To: MTD

Hi,

I have a proprietary board with the MPC860 processor.
For this board, I have a ROM Startup code that lives in a
256k Atmel flash chip (is my BIOS). This code initialize
the needed features, read a "boot sector" from a compact
flash (just for check some integrity) and read a linux
kernel and a ramdisk from previous defined locations.
This works fine, but I like to change this schema to
support the JFFS2 file system.
For this, I like to mantain my ROM startup code, modifying
just the process that load the kernel and ramdisk. The process
must load a bootloader (something like lilo) that allow
read a configuration file from the JFFS partition, choose a kernel to
boot from a list or boot from network.
I'm studing various codes from different bootloaders, and i think
that this isn't very complex. The most complex task is support the
JFFS2. 
To do this, i like to solve some doubts:
1 - How i do to mount the JFFS2 without before load the kernel?
2 - I need mount the JFFS2 to read files from them, or I can read files
from the partition without mount them?
3 - When I mount the partition: on startup of the BL or just when I need 
to read something?
4 - Which are the steps to mount the FS? Which functions are needed call
to do this? 
5 - Which files I need to include in the software?
6 - Someone have a sample code that explain these process?

I like to known some opinions and hints to do this!

PS.: I don't like to use the PPCBoot!!!

Tanks

-- 
------------------------------------------------- 
 Daniel Belz           danielb@cyclades.com.br
 Cyclades Brasil       R&D 
 Sao Paulo - Brazil    +55 (11) 5033-3393
---------------------------------------

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

* Re: Mounting JFFS2, Bootloader
  2002-07-11 12:28 Mounting JFFS2, Bootloader Daniel Belz
@ 2002-07-11 17:08 ` Justin Wojdacki
  2002-07-11 17:42   ` Daniel Belz
  2002-07-12 15:43 ` Marius Groeger
  1 sibling, 1 reply; 7+ messages in thread
From: Justin Wojdacki @ 2002-07-11 17:08 UTC (permalink / raw)
  To: Daniel Belz; +Cc: MTD

Having recently done the same kind of thing (on a different board), I
think I can help. 

Exactly what you need depends a bit on how you want to handle this. If
you are happy with a bootstrap that can only handle one kernel, then
it's really easy: You hardcode the path/filename of the kernel into
the bootloader, and then walk the filesystem looking for this file. If
you want more flexibility than that, you may instead need to look for
a configuration file and then process the configuration file. 

JFFS2 has a really easy to work with on-device layout, so it shouldn't
take much effort to locate the files you're interested in. 

The files you'll need to work with are in fs/jffs2 and include/linux. 

Figure out exactly what capabilities you want first though. That'll
make it much easier to plan out. And remember, if it's being done in
the bootloader, you're not in the kernel, so you may have to
reimplement some things. 

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

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

* Re: Mounting JFFS2, Bootloader
  2002-07-11 17:08 ` Justin Wojdacki
@ 2002-07-11 17:42   ` Daniel Belz
  2002-07-11 18:49     ` Justin Wojdacki
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Belz @ 2002-07-11 17:42 UTC (permalink / raw)
  To: justin.wojdacki; +Cc: MTD

Hi,

Justin Wojdacki wrote:
> 
> Having recently done the same kind of thing (on a different board), I
> think I can help.
...
> If you want more flexibility than that, you may instead need to look for
> a configuration file and then process the configuration file.
>

Yes, i need something like this, as an application to be loaded instead
of the
kernel. Simple, to allow load for more than one option from flash or
from network
(simple tftp). I don't need write on the flash (CF) at this time. 
 
> JFFS2 has a really easy to work with on-device layout, so it shouldn't
> take much effort to locate the files you're interested in.
> 
> The files you'll need to work with are in fs/jffs2 and include/linux.
> 
> Figure out exactly what capabilities you want first though. That'll
> make it much easier to plan out. And remember, if it's being done in
> the bootloader, you're not in the kernel, so you may have to
> reimplement some things.

Ok, but which is the "entry point" of the JFFS, that is, i need to call
the
functions to mount, or i can treat like a mounted file system, and just
read
the needed files? 
And, I can read from a CompactFlash card, if i'm using (after boot) the
MTD 
emulation? The CF is mapped as a hd device.

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

-- 
------------------------------------------------- 
 Daniel Belz           danielb@cyclades.com.br
 Cyclades Brasil       R&D 
 Sao Paulo - Brazil    +55 (11) 5033-3393
-------------------------------------------------

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

* Re: Mounting JFFS2, Bootloader
  2002-07-11 17:50   ` Daniel Belz
@ 2002-07-11 17:45     ` Russ Dill
  0 siblings, 0 replies; 7+ messages in thread
From: Russ Dill @ 2002-07-11 17:45 UTC (permalink / raw)
  To: Daniel Belz; +Cc: Marius Groeger, MTD

On Thu, 2002-07-11 at 10:50, Daniel Belz wrote:
> Hi,
> Marius Groeger wrote:
> > 
> > On Thu, 11 Jul 2002, Daniel Belz wrote:
> > 
> > > PS.: I don't like to use the PPCBoot!!!
> > 
> > May I ask why? It sure would save you a lot of work... Anyway, if you don't
> > want to use PPCboot, you can always rip out and use it's JFFS support
> > routines.
> 
> I need somthing more simple, and I like to use the existent code for
> board init.
> I think to use the JFFS2 support from PPCB, but i can't separate the
> JFFS2 code
> from the boards support. And have the kernel parameters...

a number of bootloaders (including blob) already do this, assuming you
are using GPL, just grab that code, if you aren't using GPL? too bad

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

* Re: Mounting JFFS2, Bootloader
  2002-07-12 15:43 ` Marius Groeger
@ 2002-07-11 17:50   ` Daniel Belz
  2002-07-11 17:45     ` Russ Dill
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Belz @ 2002-07-11 17:50 UTC (permalink / raw)
  To: Marius Groeger; +Cc: MTD

Hi,
Marius Groeger wrote:
> 
> On Thu, 11 Jul 2002, Daniel Belz wrote:
> 
> > PS.: I don't like to use the PPCBoot!!!
> 
> May I ask why? It sure would save you a lot of work... Anyway, if you don't
> want to use PPCboot, you can always rip out and use it's JFFS support
> routines.

I need somthing more simple, and I like to use the existent code for
board init.
I think to use the JFFS2 support from PPCB, but i can't separate the
JFFS2 code
from the boards support. And have the kernel parameters...


> 
> Regards,
> Marius
> 
> -----------------------------------------------------------------------------
> Marius Groeger           SYSGO Real-Time Solutions GmbH     mgroeger@sysgo.de
> Software Engineering     Embedded and Real-Time Software    www.sysgo.de
> Voice: +49-6136-9948-0   Am Pfaffenstein 14                 www.osek.de
> FAX:   +49-6136-9948-10  55270 Klein-Winternheim, Germany   www.elinos.com


Tanks


-- 
------------------------------------------------- 
 Daniel Belz           danielb@cyclades.com.br
 Cyclades Brasil       R&D 
 Sao Paulo - Brazil    +55 (11) 5033-3393
-------------------------------------------------

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

* Re: Mounting JFFS2, Bootloader
  2002-07-11 17:42   ` Daniel Belz
@ 2002-07-11 18:49     ` Justin Wojdacki
  0 siblings, 0 replies; 7+ messages in thread
From: Justin Wojdacki @ 2002-07-11 18:49 UTC (permalink / raw)
  To: Daniel Belz; +Cc: MTD

Daniel Belz wrote:
> 
> > JFFS2 has a really easy to work with on-device layout, so it shouldn't
> > take much effort to locate the files you're interested in.
> >
> > The files you'll need to work with are in fs/jffs2 and include/linux.
> >
> > Figure out exactly what capabilities you want first though. That'll
> > make it much easier to plan out. And remember, if it's being done in
> > the bootloader, you're not in the kernel, so you may have to
> > reimplement some things.
> 
> Ok, but which is the "entry point" of the JFFS, that is, i need to
> call the functions to mount, or i can treat like a mounted file
> system, and just read the needed files? And, I can read from a
> CompactFlash card, if i'm using (after boot) the MTD emulation? The
> CF is mapped as a hd device.
> 

The "entry point" of the JFFS is defined by the map you create for the
flash device. Take a look at drivers/mtd/maps to get an idea of what's
going on. Basically you'll lay out the flash, telling the kernel what
parts it can and can't touch. You'll assign one or more parts of that
map to be JFFS2 partitions, one of which is the root partition. Then,
in your bootstrap, you'll walk through flash, starting at the base of
that root paritition until you've found and loaded all the data for
the kernel. I do that stage in a few passes, but it's not hard to do. 

I can't help you on the compact flash side though. I'm not familiar
with that technology. If the bootloader has to do any modification of
the CF card/interface, then it should reset it to the base state the
kernel is expecting, before booting the kernel. 

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

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

* Re: Mounting JFFS2, Bootloader
  2002-07-11 12:28 Mounting JFFS2, Bootloader Daniel Belz
  2002-07-11 17:08 ` Justin Wojdacki
@ 2002-07-12 15:43 ` Marius Groeger
  2002-07-11 17:50   ` Daniel Belz
  1 sibling, 1 reply; 7+ messages in thread
From: Marius Groeger @ 2002-07-12 15:43 UTC (permalink / raw)
  To: Daniel Belz; +Cc: MTD

On Thu, 11 Jul 2002, Daniel Belz wrote:

> PS.: I don't like to use the PPCBoot!!!

May I ask why? It sure would save you a lot of work... Anyway, if you don't
want to use PPCboot, you can always rip out and use it's JFFS support
routines.

Regards,
Marius

-----------------------------------------------------------------------------
Marius Groeger           SYSGO Real-Time Solutions GmbH     mgroeger@sysgo.de
Software Engineering     Embedded and Real-Time Software    www.sysgo.de
Voice: +49-6136-9948-0   Am Pfaffenstein 14                 www.osek.de
FAX:   +49-6136-9948-10  55270 Klein-Winternheim, Germany   www.elinos.com

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

end of thread, other threads:[~2002-07-11 18:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-11 12:28 Mounting JFFS2, Bootloader Daniel Belz
2002-07-11 17:08 ` Justin Wojdacki
2002-07-11 17:42   ` Daniel Belz
2002-07-11 18:49     ` Justin Wojdacki
2002-07-12 15:43 ` Marius Groeger
2002-07-11 17:50   ` Daniel Belz
2002-07-11 17:45     ` Russ Dill

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.