public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] JFFS2 questions with eCos
@ 2005-09-15  7:46 Steven_cheng
  2005-09-15 14:59 ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-15  7:46 UTC (permalink / raw)
  To: ecos-discuss

Hi All,

    I use redboot as my bootloader, currently It works by using FIS.
But I hope it can manage my flash images with  JFFS2 to prevent
the image upgrade failed issue when power loss.
It will make device can not boot-up due to boot image damage.

    I have many questions about JFFS2 with eCos as following.I

Q1.   If I want to add the JFFS2 Package into my platform for RedBoot,
Which
packages does it need ??

Q2.    If I have integrate the JFFS2 package with my platform, how can I
verify
it ??

Q3.    Is there document which describes about JFFS2 with eCos ??

Q4.    If I want to replace FIS (Flash Image System )  with the JFFS2 in
RedBoot,
Is it doable ??


Thank you in advance !!

Steven Cheng


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-15  7:46 [ECOS] JFFS2 questions with eCos Steven_cheng
@ 2005-09-15 14:59 ` Andrew Lunn
  2005-09-20 11:55   ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-09-15 14:59 UTC (permalink / raw)
  To: Steven_cheng; +Cc: ecos-discuss

On Thu, Sep 15, 2005 at 02:46:37PM +0800, Steven_cheng wrote:
> Hi All,
> 
>     I use redboot as my bootloader, currently It works by using FIS.
> But I hope it can manage my flash images with  JFFS2 to prevent
> the image upgrade failed issue when power loss.
> It will make device can not boot-up due to boot image damage.
> 
>     I have many questions about JFFS2 with eCos as following.I
> 
> Q1.   If I want to add the JFFS2 Package into my platform for RedBoot,
> Which
> packages does it need ??

crc, zlib, fileio, linux_compat, jffs2.

> 
> Q2.    If I have integrate the JFFS2 package with my platform, how can I
> verify
> it ??

Create a filesystem on your host using 

mkfs -t jffs2 -o jffs2.img -r /tmp/foobar/root.

Put the resulting image into flash. If you have everything right you
should then be able to mount it and use ls to see the contents and
load -m file to load files into memory. Note that redboot cannot write
to a jffs2 filesystem. So you need some other mechanism to place files
into the filesystem.

> Q3.    Is there document which describes about JFFS2 with eCos ??

Nope. See the archive and the sources.
 
> Q4.    If I want to replace FIS (Flash Image System )  with the JFFS2 in
> RedBoot,
> Is it doable ??

You have two options.  

1) You keep FIS and use it to keep track of where the the JFFS2 image
is in flash. When you mount the filesystem you give the name of this
FIS image you want to mount.

2) You hard code the address and length of the filesystem into
Redboot. You then don't need FIS.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-15 14:59 ` Andrew Lunn
@ 2005-09-20 11:55   ` Steven_cheng
  2005-09-20 12:02     ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-20 11:55 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Dear Andrws,

    I use the mkfs.jffs2 to create a filesystem on my host, the command is

"$ ./mkfs.jffs2 -o jffs2.img -r jffs2_test/"

Then I put the image jffs2.img to my platform by load command. And save it
as
jffs2 as following in the flash:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot[RAM]      0x70000000  0x01040000  0x00040000  0x01040100
jffs2.img          0x70040000  0x70040000  0x00020000  0x02000000
RedBoot           0xFFF00000  0xFFF00000  0x00040000  0x00000000
FIS directory     0xFFF7F000  0xFFF7F000  0x00000C00  0x00000000
RedBoot config    0xFFF7FC00  0xFFF7FC00  0x00000400  0x00000000


> > Q4.    If I want to replace FIS (Flash Image System )  with the JFFS2 in
> > RedBoot,
> > Is it doable ??
>
> You have two options.
>
> 1) You keep FIS and use it to keep track of where the the JFFS2 image
> is in flash. When you mount the filesystem you give the name of this
> FIS image you want to mount.

How can I mount the jffs2.img ??
Like it ??

"RedBoot> mount -f jffs2.img -t jffs2"

>
> 2) You hard code the address and length of the filesystem into
> Redboot. You then don't need FIS.

Do you mean it  as following ??
"RedBoot> mount -f 0x70040000 -t jffs2"

Sorry, can you explain it in detail ??

Thank you in advance ~~


Steven Cheng



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 11:55   ` Steven_cheng
@ 2005-09-20 12:02     ` Andrew Lunn
  2005-09-20 12:05       ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-09-20 12:02 UTC (permalink / raw)
  To: Steven_cheng; +Cc: Andrew Lunn, ecos-discuss

On Tue, Sep 20, 2005 at 05:38:49PM +0800, Steven_cheng wrote:
> Dear Andrws,
> 
>     I use the mkfs.jffs2 to create a filesystem on my host, the command is
> 
> "$ ./mkfs.jffs2 -o jffs2.img -r jffs2_test/"
> 
> Then I put the image jffs2.img to my platform by load command. And save it
> as
> jffs2 as following in the flash:
> 
> RedBoot> fis list
> Name              FLASH addr  Mem addr    Length      Entry point
> RedBoot[RAM]      0x70000000  0x01040000  0x00040000  0x01040100
> jffs2.img          0x70040000  0x70040000  0x00020000  0x02000000
> RedBoot           0xFFF00000  0xFFF00000  0x00040000  0x00000000
> FIS directory     0xFFF7F000  0xFFF7F000  0x00000C00  0x00000000
> RedBoot config    0xFFF7FC00  0xFFF7FC00  0x00000400  0x00000000
> 
> 
> > > Q4.    If I want to replace FIS (Flash Image System )  with the JFFS2 in
> > > RedBoot,
> > > Is it doable ??
> >
> > You have two options.
> >
> > 1) You keep FIS and use it to keep track of where the the JFFS2 image
> > is in flash. When you mount the filesystem you give the name of this
> > FIS image you want to mount.
> 
> How can I mount the jffs2.img ??
> Like it ??
> 
> "RedBoot> mount -f jffs2.img -t jffs2"

Yes.
 
> >
> > 2) You hard code the address and length of the filesystem into
> > Redboot. You then don't need FIS.
> 
> Do you mean it  as following ??
> "RedBoot> mount -f 0x70040000 -t jffs2"

No. See CYGPKG_IO_FLASH_BLOCK_DEVICE_* and then use

mount -d /dev/flash1 -t jffs2

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 12:02     ` Andrew Lunn
@ 2005-09-20 12:05       ` Steven_cheng
  2005-09-20 12:21         ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-20 12:05 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Andrew,

    Thank  you for your help ~~
 
    If I have mounted the jffs2.img, then
what thing I can do with JFFS2 ??
Like display the files and directories of the img or ??

Does it have the command like "ls" or "dir" to display 
the content of the jffs2 imge ??

Thans in advance !!


Steven Cheng~~

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 12:05       ` Steven_cheng
@ 2005-09-20 12:21         ` Andrew Lunn
  2005-09-20 13:46           ` Steven_cheng
  2005-09-21  7:33           ` Steven_cheng
  0 siblings, 2 replies; 21+ messages in thread
From: Andrew Lunn @ 2005-09-20 12:21 UTC (permalink / raw)
  To: Steven_cheng; +Cc: Andrew Lunn, ecos-discuss

On Tue, Sep 20, 2005 at 07:41:17PM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>     Thank  you for your help ~~
>  
>     If I have mounted the jffs2.img, then
> what thing I can do with JFFS2 ??
> Like display the files and directories of the img or ??
> 
> Does it have the command like "ls" or "dir" to display 
> the content of the jffs2 imge ??

There is an ls command.

You can also load images into memory using the file method.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 12:21         ` Andrew Lunn
@ 2005-09-20 13:46           ` Steven_cheng
  2005-09-20 16:09             ` Andrew Lunn
  2005-09-21  7:33           ` Steven_cheng
  1 sibling, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-20 13:46 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Andrew Lunn, ecos-discuss

Hi Andrew,

    Sorry, I can not see the "ls" command. The commands
had been supported as following:
- Manage aliases kept in FLASH memory
   alias name [value]
- Manage machine caches
   cache [ON | OFF]
- Display/switch console channel
   channel [-1|<channel number>]
- Compute a 32bit checksum [POSIX algorithm] for a range of memory
   cksum -b <location> -l <length>
- Display (hex dump) a range of memory
   dump -b <location> [-l <length>] [-s] [-1|2|4]
- Execute a Linux image - with MMU off
   exec [-w timeout]
        [-c "kernel command line"] [<entry_point>]
- Manage FLASH images
   fis {cmds}
- Manage configuration kept in FLASH memory
   fconfig [-i] [-l] [-n] [-f] [-d] | [-d] nickname [value]
- Execute code at a location
   go [-w <timeout>] [-c] [-n] [entry]
- Help about help?
   help [<topic>]
- Display command history
   history
- Set/change IP addresses
    ip_address [-l <local_ip_address>[/<mask_len>]] [-h <server_address>]
- Load a file
   load [-r] [-v] [-d] [-h <host>] [-p <TCP port>][-m <varies>] [-c
<channel_num
ber>]
        [-b <base_address>] <file_name>
- Compare two blocks of memory
   mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
- Copy memory from one address to another
   mcopy -s <location> -d <location> -l <length> [-1|-2|-4]
- Fill a block of memory with a pattern
   mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
- Mount file system
   mount [-f <partition>] [-d <device>] -t fstype
- Network connectivity test
   ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>]
        [-i <IP_addr>] -h <IP_addr>
- Reset the system
   reset
- Unmount file system
   umount
- Display RedBoot version information
   version
- Display (hex dump) a range of memory
   x -b <location> [-l <length>] [-s] [-1|2|4]

Question :
     Which flag I need to check to support the "ls" command ??


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 13:46           ` Steven_cheng
@ 2005-09-20 16:09             ` Andrew Lunn
  2005-09-21  6:52               ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-09-20 16:09 UTC (permalink / raw)
  To: Steven_cheng; +Cc: Andrew Lunn, ecos-discuss

On Tue, Sep 20, 2005 at 08:18:17PM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>     Sorry, I can not see the "ls" command. 

You might need to enable CYGBLD_REDBOOT_FILEIO_WITH_LS.
The code is in packages/redboot/current/src/fs/fileio.c

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 16:09             ` Andrew Lunn
@ 2005-09-21  6:52               ` Steven_cheng
  2005-09-21  8:36                 ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-21  6:52 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Andrew,

        When I compile my platform with JFFS2 for RedBoot,
It takes a error message, it display as following :
/opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:144: parse error
before "int32_t"
/opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:146: warning:
function
declaration isn't a prototype
/opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:229: parse error
before "int32_t"
/opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:231: warning:
function declaration isn't a prototype

Then I found that if I add

#define int8_t cyg_int8
#define int16_t cyg_int16
#define int32_t cyg_int32

in compat\linux\current\include\linux\types.h. Then it will work.

Does I lack something for it ??

Thank you~~


Steven Cheng


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-20 12:21         ` Andrew Lunn
  2005-09-20 13:46           ` Steven_cheng
@ 2005-09-21  7:33           ` Steven_cheng
  2005-09-21  8:31             ` Andrew Lunn
  1 sibling, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-21  7:33 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Andrew Lunn, ecos-discuss

Hi Andrew,

> > Does it have the command like "ls" or "dir" to display 
> > the content of the jffs2 imge ??
> 
> There is an ls command.
> 
> You can also load images into memory using the file method.

I try to use the ls, load command, it works.
Are there other commands to support with JFFS2 filesystem, 
like write, copy, delete ??


Thank you.

Steven Chang

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-21  7:33           ` Steven_cheng
@ 2005-09-21  8:31             ` Andrew Lunn
  2005-09-29  9:47               ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-09-21  8:31 UTC (permalink / raw)
  To: Steven_cheng; +Cc: ecos-discuss

On Wed, Sep 21, 2005 at 01:47:39PM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
> > > Does it have the command like "ls" or "dir" to display 
> > > the content of the jffs2 imge ??
> > 
> > There is an ls command.
> > 
> > You can also load images into memory using the file method.
> 
> I try to use the ls, load command, it works.
> Are there other commands to support with JFFS2 filesystem, 
> like write, copy, delete ??

No.
        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-21  6:52               ` Steven_cheng
@ 2005-09-21  8:36                 ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2005-09-21  8:36 UTC (permalink / raw)
  To: Steven_cheng; +Cc: ecos-discuss

On Wed, Sep 21, 2005 at 11:33:55AM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>         When I compile my platform with JFFS2 for RedBoot,
> It takes a error message, it display as following :
> /opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:144: parse error
> before "int32_t"
> /opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:146: warning:
> function
> declaration isn't a prototype
> /opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:229: parse error
> before "int32_t"
> /opt/ecoscvs/ecos/packages/fs/jffs2/current/src/readinode.c:231: warning:
> function declaration isn't a prototype
> 
> Then I found that if I add
> 
> #define int8_t cyg_int8
> #define int16_t cyg_int16
> #define int32_t cyg_int32
> 
> in compat\linux\current\include\linux\types.h. Then it will work.
> 
> Does I lack something for it ??

They are already in that file. They have been since at least 22-Jan-03.

This suggests you have old eCos sources.

        Andrew

P.S.

Please get your mail server fixed. I get bounces from it every time i
mail you.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-21  8:31             ` Andrew Lunn
@ 2005-09-29  9:47               ` Steven_cheng
  2005-09-29 20:30                 ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-29  9:47 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Andrew,

        I find that there is the FSTAB_ENTRY as following if I turn on the
CYGOPT_FS_JFFS2_WRITE :

FSTAB_ENTRY(jffs2_fste, "jffs2", 0,
     CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
     jffs2_mount,
     jffs2_umount,
     jffs2_open,
     jffs2_ops_unlink,
     jffs2_ops_mkdir,
     jffs2_ops_rmdir,
     jffs2_ops_rename,
     jffs2_ops_link,
     jffs2_opendir,
     jffs2_chdir, jffs2_stat, jffs2_getinfo, jffs2_setinfo);

Question :
Q1 :There are the functions to write the  jffs2 filesystem,
but currently RedBoot does not support the commands.
So we can not write (create) a file/dir into the jffs2 image.
Is it correct ??

Q2 : It is the same with FAT filesystem as JFFS2 filesystem,
currentky it does not support the write command.
Is it correct ??

Q3: If I add the some commands likes open (create) by using above functions,
then I can create a file into jffs2 filesystem.
Is it correct ??


Thank you~~

Steven Cheng

----- Original Message ----- 
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Steven_cheng" <05071@alphanetworks.com>
Cc: <ecos-discuss@sources.redhat.com>
Sent: Wednesday, September 21, 2005 2:47 PM
Subject: Re: [ECOS] JFFS2 questions with eCos


> On Wed, Sep 21, 2005 at 01:47:39PM +0800, Steven_cheng wrote:
> > Hi Andrew,
> >
> > > > Does it have the command like "ls" or "dir" to display
> > > > the content of the jffs2 imge ??
> > >
> > > There is an ls command.
> > >
> > > You can also load images into memory using the file method.
> >
> > I try to use the ls, load command, it works.
> > Are there other commands to support with JFFS2 filesystem,
> > like write, copy, delete ??
>
> No.
>         Andrew
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-29  9:47               ` Steven_cheng
@ 2005-09-29 20:30                 ` Andrew Lunn
  2005-09-29 21:19                   ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-09-29 20:30 UTC (permalink / raw)
  To: Steven_cheng; +Cc: ecos-discuss

On Thu, Sep 29, 2005 at 11:59:40AM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>         I find that there is the FSTAB_ENTRY as following if I turn on the
> CYGOPT_FS_JFFS2_WRITE :
> 
> FSTAB_ENTRY(jffs2_fste, "jffs2", 0,
>      CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
>      jffs2_mount,
>      jffs2_umount,
>      jffs2_open,
>      jffs2_ops_unlink,
>      jffs2_ops_mkdir,
>      jffs2_ops_rmdir,
>      jffs2_ops_rename,
>      jffs2_ops_link,
>      jffs2_opendir,
>      jffs2_chdir, jffs2_stat, jffs2_getinfo, jffs2_setinfo);
> 
> Question :
> Q1 :There are the functions to write the  jffs2 filesystem,
> but currently RedBoot does not support the commands.

jffs2 is a writeable filesystem and RedBoot currently does not make
use of this functionallity. So far nobody has needed to be able to
write to a JFFS2 filesystem from redboot and so nobody has contributed
code to do so.

> So we can not write (create) a file/dir into the jffs2 image.
> Is it correct ??

There is no Redboot command to do it.
 
> Q2 : It is the same with FAT filesystem as JFFS2 filesystem,
> currentky it does not support the write command.
> Is it correct ??

Redboot does not know what type of filesystem it is using, it is just
a filesystem. If you add commands which write, they should work for
jffs2, FAT, RAMFS etc.....
 
> Q3: If I add the some commands likes open (create) by using above functions,
> then I can create a file into jffs2 filesystem.
> Is it correct ??

It should work. But since nobody has actually done this before you
never now if there are bugs to be found....

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-29 20:30                 ` Andrew Lunn
@ 2005-09-29 21:19                   ` Steven_cheng
  2005-09-29 21:31                     ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-09-29 21:19 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Andrew,

    When I create a directory with mkdir command, it retruns no space.
So I want to create a image with some empty space.

Q1 : Can I generate a JFFS2  filesystem image with empty space ??
for example,  data uses 1 MB and empty space 4MB image ??

Q2 : Can I generate a JFFS2  filesystem image with only empty space ??
for example,  only epmty root directory with 5MB image ??


Thank you~~

Steven Cheng


----- Original Message ----- 
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Steven_cheng" <05071@alphanetworks.com>
Cc: <ecos-discuss@sources.redhat.com>
Sent: Thursday, September 29, 2005 3:22 PM
Subject: Re: [ECOS] JFFS2 questions with eCos


> On Thu, Sep 29, 2005 at 11:59:40AM +0800, Steven_cheng wrote:
> > Hi Andrew,
> >
> >         I find that there is the FSTAB_ENTRY as following if I turn on
the
> > CYGOPT_FS_JFFS2_WRITE :
> >
> > FSTAB_ENTRY(jffs2_fste, "jffs2", 0,
> >      CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
> >      jffs2_mount,
> >      jffs2_umount,
> >      jffs2_open,
> >      jffs2_ops_unlink,
> >      jffs2_ops_mkdir,
> >      jffs2_ops_rmdir,
> >      jffs2_ops_rename,
> >      jffs2_ops_link,
> >      jffs2_opendir,
> >      jffs2_chdir, jffs2_stat, jffs2_getinfo, jffs2_setinfo);
> >
> > Question :
> > Q1 :There are the functions to write the  jffs2 filesystem,
> > but currently RedBoot does not support the commands.
>
> jffs2 is a writeable filesystem and RedBoot currently does not make
> use of this functionallity. So far nobody has needed to be able to
> write to a JFFS2 filesystem from redboot and so nobody has contributed
> code to do so.
>
> > So we can not write (create) a file/dir into the jffs2 image.
> > Is it correct ??
>
> There is no Redboot command to do it.
>
> > Q2 : It is the same with FAT filesystem as JFFS2 filesystem,
> > currentky it does not support the write command.
> > Is it correct ??
>
> Redboot does not know what type of filesystem it is using, it is just
> a filesystem. If you add commands which write, they should work for
> jffs2, FAT, RAMFS etc.....
>
> > Q3: If I add the some commands likes open (create) by using above
functions,
> > then I can create a file into jffs2 filesystem.
> > Is it correct ??
>
> It should work. But since nobody has actually done this before you
> never now if there are bugs to be found....
>
>         Andrew
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-29 21:19                   ` Steven_cheng
@ 2005-09-29 21:31                     ` Andrew Lunn
  2005-10-03  8:13                       ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-09-29 21:31 UTC (permalink / raw)
  To: Steven_cheng; +Cc: Andrew Lunn, ecos-discuss

On Thu, Sep 29, 2005 at 05:48:40PM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>     When I create a directory with mkdir command, it retruns no space.
> So I want to create a image with some empty space.
> 
> Q1 : Can I generate a JFFS2  filesystem image with empty space ??
> for example,  data uses 1 MB and empty space 4MB image ??

Sure. Use the -pad=4194304 option to mkfs.jffs2
 
> Q2 : Can I generate a JFFS2  filesystem image with only empty space ??
> for example,  only epmty root directory with 5MB image ??

Sure. Again use the pad option.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-09-29 21:31                     ` Andrew Lunn
@ 2005-10-03  8:13                       ` Steven_cheng
  2005-10-03  8:34                         ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-10-03  8:13 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Adnrew,

    Thank you for your reply!!
But I still have some questions about mkfs.jffs2.

Q1 :  Can you tell me what is the different betweem -e
and --eraseblock=size,
-p and --pad=size ??

Q2 : "ereaseblock=size" and "--pad=size" in the statements, the unit is
bytes or Kbytes ??

Q3 : "-e size" and "-p size" in the statements, the unit is bytes or Kbytes
??

I can't understand the meaning of the help as following:

  -p, --pad[=SIZE]        Pad output to SIZE bytes with 0xFF. If SIZE is
                          not specified, the output is padded to the end of
                          the final erase block.

  -e, --eraseblock=SIZE   Use erase block size SIZE (default: 64KiB)


Thank you very much~~

Steven Cheng

----- Original Message ----- 
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Steven_cheng" <05071@alphanetworks.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>; <ecos-discuss@sources.redhat.com>
Sent: Thursday, September 29, 2005 6:56 PM
Subject: Re: [ECOS] JFFS2 questions with eCos


> On Thu, Sep 29, 2005 at 05:48:40PM +0800, Steven_cheng wrote:
> > Hi Andrew,
> >
> >     When I create a directory with mkdir command, it retruns no space.
> > So I want to create a image with some empty space.
> >
> > Q1 : Can I generate a JFFS2  filesystem image with empty space ??
> > for example,  data uses 1 MB and empty space 4MB image ??
>
> Sure. Use the -pad=4194304 option to mkfs.jffs2
>
> > Q2 : Can I generate a JFFS2  filesystem image with only empty space ??
> > for example,  only epmty root directory with 5MB image ??
>
> Sure. Again use the pad option.
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-10-03  8:13                       ` Steven_cheng
@ 2005-10-03  8:34                         ` Andrew Lunn
  2005-10-03  9:33                           ` Steven_cheng
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2005-10-03  8:34 UTC (permalink / raw)
  To: Steven_cheng; +Cc: ecos-discuss

On Mon, Oct 03, 2005 at 04:15:19PM +0800, Steven_cheng wrote:
> Hi Adnrew,
> 
>     Thank you for your reply!!
> But I still have some questions about mkfs.jffs2.

There is a man page you know....

> 
> Q1 :  Can you tell me what is the different betweem -e
> and --eraseblock=size,

None. One is a short opt and one is a long opt. Standard GNU practice.

> -p and --pad=size ??

None, although there was/is a bug which i think means one does not
work. Check the actuall size of the image created.
 
> Q2 : "ereaseblock=size" and "--pad=size" in the statements, the unit is
> bytes or Kbytes ??

Why not read the man page and save us all waisted time...

       Options that take SIZE arguments can be  specified  as  either  decimal
       (e.g., 65536), octal (0200000), or hexidecimal (0x1000).

 
> I can't understand the meaning of the help as following:
> 
>   -p, --pad[=SIZE]        Pad output to SIZE bytes with 0xFF. If SIZE is
>                           not specified, the output is padded to the end of
>                           the final erase block.
> 
>   -e, --eraseblock=SIZE   Use erase block size SIZE (default: 64KiB)

What don't use understand?

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-10-03  8:34                         ` Andrew Lunn
@ 2005-10-03  9:33                           ` Steven_cheng
  2005-10-03  9:58                             ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Steven_cheng @ 2005-10-03  9:33 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Andrew,

    I'm sorry to disturb you, because I take some tests
with the mkfs.jffs2.

When I use the following commands, the size of the image are
different, it is tested in i386-linux and cygwin.

(1) ./mkfs.jffs2 -b -o myjffs2_1.img -r
jffs2_dir/ --pad=4194304 --eraseblock=131072
      [image size = 4,194,304 bytes ]

(2) ./mkfs.jffs2 -b -o myjffs2_2.img -r jffs2_dir/ --pad=4194304 -e 131072
      [image size = 4,194,304 bytes  ]

(3) ./mkfs.jffs2 -b -o myjffs2_3.img -r jffs2_dir/ --pad=4194304 -e=131072
      [ error !!
       i386linux: Increasing erase size to 8KiB minimum
       cygwin: mkfs.jffs2: Unrecognisable erase size]

(4) ./mkfs.jffs2 -b -o myjffs2_4.img -r jffs2_dir/ -p 4194304 -e 131072
      [image size = 393,216 bytes]

(5) ./mkfs.jffs2 -b -o myjffs2_5.img -r jffs2_dir/ -p=4194304 -e 131072
      [image size = 320,688 bytes]

So I am not sure which is the correct usage !!

Thank yor for your reply ~~

Steven Cheng

----- Original Message ----- 
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Steven_cheng" <05071@alphanetworks.com>
Cc: <ecos-discuss@sources.redhat.com>
Sent: Monday, October 03, 2005 4:34 PM
Subject: Re: [ECOS] JFFS2 questions with eCos


> On Mon, Oct 03, 2005 at 04:15:19PM +0800, Steven_cheng wrote:
> > Hi Adnrew,
> >
> >     Thank you for your reply!!
> > But I still have some questions about mkfs.jffs2.
>
> There is a man page you know....
>
> >
> > Q1 :  Can you tell me what is the different betweem -e
> > and --eraseblock=size,
>
> None. One is a short opt and one is a long opt. Standard GNU practice.
>
> > -p and --pad=size ??
>
> None, although there was/is a bug which i think means one does not
> work. Check the actuall size of the image created.
>
> > Q2 : "ereaseblock=size" and "--pad=size" in the statements, the unit is
> > bytes or Kbytes ??
>
> Why not read the man page and save us all waisted time...
>
>        Options that take SIZE arguments can be  specified  as  either
decimal
>        (e.g., 65536), octal (0200000), or hexidecimal (0x1000).
>
>
> > I can't understand the meaning of the help as following:
> >
> >   -p, --pad[=SIZE]        Pad output to SIZE bytes with 0xFF. If SIZE is
> >                           not specified, the output is padded to the end
of
> >                           the final erase block.
> >
> >   -e, --eraseblock=SIZE   Use erase block size SIZE (default: 64KiB)
>
> What don't use understand?
>
>         Andrew
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
  2005-10-03  9:33                           ` Steven_cheng
@ 2005-10-03  9:58                             ` Andrew Lunn
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Lunn @ 2005-10-03  9:58 UTC (permalink / raw)
  To: Steven_cheng; +Cc: ecos-discuss

On Mon, Oct 03, 2005 at 05:35:01PM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>     I'm sorry to disturb you, because I take some tests
> with the mkfs.jffs2.
> 
> When I use the following commands, the size of the image are
> different, it is tested in i386-linux and cygwin.
> 
> (1) ./mkfs.jffs2 -b -o myjffs2_1.img -r
> jffs2_dir/ --pad=4194304 --eraseblock=131072
>       [image size = 4,194,304 bytes ]
> 
> (2) ./mkfs.jffs2 -b -o myjffs2_2.img -r jffs2_dir/ --pad=4194304 -e 131072
>       [image size = 4,194,304 bytes  ]
> 
> (3) ./mkfs.jffs2 -b -o myjffs2_3.img -r jffs2_dir/ --pad=4194304 -e=131072
>       [ error !!
>        i386linux: Increasing erase size to 8KiB minimum
>        cygwin: mkfs.jffs2: Unrecognisable erase size]
> 
> (4) ./mkfs.jffs2 -b -o myjffs2_4.img -r jffs2_dir/ -p 4194304 -e 131072
>       [image size = 393,216 bytes]
> 
> (5) ./mkfs.jffs2 -b -o myjffs2_5.img -r jffs2_dir/ -p=4194304 -e 131072
>       [image size = 320,688 bytes]
> 
> So I am not sure which is the correct usage !!
> 

Which do you think? 

Why?

My answering you questions all the time is not going to help you in
the long term. You need to start thinking for yourself and answer your
own questions....

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] JFFS2 questions with eCos
@ 2005-09-21 13:39 Steven_cheng
  0 siblings, 0 replies; 21+ messages in thread
From: Steven_cheng @ 2005-09-21 13:39 UTC (permalink / raw)
  To: ecos-discuss

Hi Andrew,

    Thank you for your respond. But I still have questions.
I use the command to get the source code from anoncvs,
"cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos".
But the content of the compat\linux\current\include\linux\types.h as
following:
/////////////////////  include\linux\types.h //////////////////////////////
#ifndef __LINUX_TYPES_H__
#define __LINUX_TYPES_H__

#include "cyg/infra/cyg_type.h"

#define uint8_t cyg_uint8
#define uint16_t cyg_uint16
#define uint32_t cyg_uint32
#define loff_t off_t

#define kvec iovec
#endif /* __LINUX_TYPES_H__ */

Sorry, I can not find the definition of int8_t, int16_t, int32_t.
#define int8_t cyg_int8
#define int16_t cyg_int16
#define int32_t cyg_int32

Is the command  correct ??
"cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos" ??

Thank you very much!!

Steven Cheng



PS :
    Sorry, my mail server is not fixed,  it troubles you when reply.
I will make it fixed.




-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2005-10-03  9:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-15  7:46 [ECOS] JFFS2 questions with eCos Steven_cheng
2005-09-15 14:59 ` Andrew Lunn
2005-09-20 11:55   ` Steven_cheng
2005-09-20 12:02     ` Andrew Lunn
2005-09-20 12:05       ` Steven_cheng
2005-09-20 12:21         ` Andrew Lunn
2005-09-20 13:46           ` Steven_cheng
2005-09-20 16:09             ` Andrew Lunn
2005-09-21  6:52               ` Steven_cheng
2005-09-21  8:36                 ` Andrew Lunn
2005-09-21  7:33           ` Steven_cheng
2005-09-21  8:31             ` Andrew Lunn
2005-09-29  9:47               ` Steven_cheng
2005-09-29 20:30                 ` Andrew Lunn
2005-09-29 21:19                   ` Steven_cheng
2005-09-29 21:31                     ` Andrew Lunn
2005-10-03  8:13                       ` Steven_cheng
2005-10-03  8:34                         ` Andrew Lunn
2005-10-03  9:33                           ` Steven_cheng
2005-10-03  9:58                             ` Andrew Lunn
2005-09-21 13:39 Steven_cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).