Skip to contentSkip to conversation

ram root filesystem

DISCUSSION AlessandroPPC 5 participants 7 messages Dec 3, 2003 – Dec 5, 2003

lore
Share & tools
lore
#0 lore raw

Hi to all,

I'm developing a custom application on 8260 based board. I have first used the ELDK package version 2.0.2 with Kernel 2.4.4
and nfs root filesystem. Now I want migrate my application on the system using ram fs instead of nfs.
To do this I have generated a ramdisk image derived from ELDK fs eliminating superfluous packages and using a makefile with
this instructions:

@echo "********************************************" @echo "create root files system"
@echo "********************************************"
rm -rf $(BUILD)/var/log/tegated
mkdir $(BUILD)/var/log/tegated
rm -rf $(RAMFS)/tmp/
mkdir $(RAMFS)/tmp
dd if=/dev/zero of=$(RAMFS)/ramrootfs bs=1k count=36864 mke2fs -F -m0 $(RAMFS)/ramrootfs
mount -o loop -t ext2 $(RAMFS)/ramrootfs $(RAMFS)/tmp
cp -av $(BUILD)/* $(RAMFS)/tmp
umount $(RAMFS)/tmp
cat $(RAMFS)/ramrootfs | gzip -9 > $(IMGTGZ) /opt/eldk/usr/bin/mkimage -T ramdisk -C gzip -n "DexGate filesystem
image" -d $(IMGTGZ) $(RAMDSK)
rm -rf $(RAMFS)/tmp/
@echo "********************************************" @echo "Ramdisk image now in /tftpboot/ramdisk"
@echo "********************************************"

In this way I'm able obtain a valid ramdisk image to download on my board using ppcboot. giving the commands

bootp 0x2500000 /tftpboot/image
BOOTP broadcast 1
ARP broadcast 1
TFTP from server 10.0.0.4; our IP address is 10.0.0.20 Filename '/tftpboot/image'.
Load address: 0x2500000
Loading: #################################################################

         #######################################################

done
Bytes transferred = 610742 (951b6 hex)
fec001> bootp 0x2600000 /tftpboot/ramdisk
BOOTP broadcast 1
ARP broadcast 2
TFTP from server 10.0.0.4; our IP address is 10.0.0.20 Filename '/tftpboot/ramdisk'.
Load address: 0x2600000
Loading: #################################################################

         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################

done
Bytes transferred = 11645509 (b1b245 hex)
fec001> setenv bootargs root=/dev/ram rw
fec001> bootm 0x2500000 0x2600000

At this point the system boots and the kernel mounts the ram disk but at time of rc.sysint script I have this error :

VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 60k init
INIT: version 2.78 booting

Mounting proc filesystem                   :  [  OK  ]
Configuring kernel parameters              :  [  OK  ]
Setting clock : Wed Dec 31 19:00:15 EST 1969  [  OK  ]
Activating swap partitions                 :  [  OK  ]
Setting hostname 10.0.0.20                 :  [  OK  ]

Checking root filesystem
/dev/ram:
The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:

    e2fsck -b 8193 <device>

[/sbin/fsck.ext2 (1) -- /] fsck.ext2 -a /dev/ram
fsck.ext2: Bad magic number in super-block while trying to open /dev/ram [FAILED]

*** An error occurred during the file system check. *** Dropping you to a shell; the system will reboot *** when you leave the shell.
Give root password for maintenance
(or type Control-D for normal startup):

Notice that if I write rc.sysinit script to skip "Checking root filesystem" I obtain the prompt but the syslogd deamon fails the startup.

Quoted 1 line

From ELDK distribution I have changed /etc/fstab file in

/dev/ram                /               ext2    defaults       0 0
none                    /proc           proc    defaults       0 0

and /etc/mtab file in

/dev/ram / ext2 rw 0 0
none /proc proc rw 0 0

Someone can say why fsck is not able to check ram fs and if the syslogd problem is related to ram fs?

thanks to all,
Regards,
Alessandro.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw

Dear Alessandro,

Quoted 3 lines · in message <[email protected]> you wrote:

To do this I have generated a ramdisk image derived from ELDK fs eliminating superfluous packages and using a makefile with

Question 1: why don't you use the much simpler and smaller setup based on the SELF ramdisk example image included with the ELDK? Please see http://www.denx.de/twiki/bin/view/DULG/HowToAddFiles

Quoted 3 lines

dd if=/dev/zero of=$(RAMFS)/ramrootfs bs=1k count=36864 mke2fs -F -m0 $(RAMFS)/ramrootfs
mount -o loop -t ext2 $(RAMFS)/ramrootfs $(RAMFS)/tmp

Question 2: Why don't you simply use the genext2fs tool that comes included with the ELDK? It is much simpler, and requires no root permissions to create a ramdisk image.

Quoted 2 lines

At this point the system boots and the kernel mounts the ram disk but at time of rc.sysint script I have this error :

...

Quoted 2 lines

Notice that if I write rc.sysinit script to skip "Checking root filesystem" I obtain the prompt but the syslogd deamon fails the startup.

The "rc.sysint" was never meant to be used from a ramdisk based root filesystem. If you change your configuration, you are expected to adapt all related config files and init scripts, too.

Quoted 2 lines

Someone can say why fsck is not able to check ram fs and if the syslogd problem is related to ram fs?

It makes no sense to run fsck on a ramdisk image which was just unpacked. Also, IMHO it makes littlee sense to use the full-blown SysV init style scripts in an embedded system which is running from a ramdisk image.

Have a look at the ELF image thatis included with the ELDK, and use this as a base.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] When all is said and done, more is said than done.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw

Use of several CFI flash chips physically mapped in memory

Hi,

I work on a custom 8250 board with a 2.4.18 Linux kernel. This board provides two AMD CFI flash devices.

Nowaday I only use the first chip which I map in the physical memory. I create several partitions with RW or RO accesses and I use CRAMFS and/or JFFS2 images. This works fine.

Now I would want to use the following functionalities :

1) I want to protect the first partition of the first device that contains a firmware which does not belong to the Linux system. Can I mislead Linux and provide the first sector address after the firware as the start address of the device. I don't know how the gen_probe process will react. So as Linux does not know the firware space and it can't erase the firmware sectors.

2) I want to use the two devices as a virtual one with many partitions splitted at will. The two chips are physically mapped in sequence. In my kernel, I have the following variables CONFIG_ELINOS_NR_MTD_DEVICES "Maximum number of MTD devices" and CONFIG_MTD_CONCAT MTD "Concatenating support". But they seem to be unused.

3) I want to use two 16 bits access chips physically mounted in parallel to make a virtual 32 bits access chip. Do solutions exist for this case ?

4) Finally, what about flash fast programming issues ?
Nowaday it is very slow to erase or program many sectors with the character access driver.
In my kernel, I have the following message
if (cfi->fast_prog) {
/* In cfi_amdstd_write() we frob the protection stuff
without paying any attention to the state machine.
This upsets in-progress erases. So we turn this flag
off for now till the code gets fixed. */
printk(KERN_NOTICE "cfi_cmdset_0002: Disabling fast programming due to c

ode brokenness.\n");
    cfi->fast_prog = 0;
}

Thanks
Special thanks to Gary Thomas for his reply about File system boot strategy.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw

R: ram root filesystem

In reply to Wolfgang Denk

Many Thanks Wolfgang Denk for your indacations.
Something abaut your questions.

Quoted 3 lines

Question 1: why don't you use the much simpler and smaller setup based on the SELF ramdisk example image included with the ELDK? Please see http://www.denx.de/twiki/bin/view/DULG/HowToAddFiles

My application now is running and it is stable with nfs-ELDK package, and I want pass
to ram fs to do a more efficiently embedded system with the minimum difference respect
to nfs because I don't want to lose the stability.

Quoted 4 lines

Question 2: Why don't you simply use the genext2fs tool that comes included with the ELDK? It is much simpler, and requires no root permissions to create a ramdisk image.

Yes I will try the genext2fs tool .

Quoted 3 lines

The "rc.sysint" was never meant to be used from a ramdisk based root filesystem. If you change your configuration, you are expected to adapt all related config files and init scripts, too.

Ok I 'm just adapting my config files and init scripts.

Quoted 6 lines

It makes no sense to run fsck on a ramdisk image which was just unpacked. Also, IMHO it makes littlee sense to use the full-blown SysV init style scripts in an embedded system which is running from a ramdisk image.

Yes I agree, but the question is : why a tool thought to check fs don't work on my fs image? Where is the mistake?
Sorry, but what do yo mean with IMHO ?

Quoted 3 lines

Have a look at the ELF image thatis included with the ELDK, and use this as a base.

I'm investigating abaut your ELF image...

Thanks again,
Regards,
Alessandro

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw

problem using both mpc857dsl fec and scc1

In reply to AlessandroPPC

Hi all,

I'm having a peculiar problem.

Briefly, my platform is MPC857DSL IAD board from Motorola. I'm using U-boot 0.4.8 to bootp the kernel(2.4.18 and 2.4.22) through SCC1 and then load
NFS. If I configure the kernel with only SCC1, then everything works
well(NFS works and ping through eth0 works). If I configure the kernel with only FEC (in fec.c PDPAR[UT]=0,UTMOD[SPLIT]=1,ENCTRL[FEC_PIN_MUX]=1), then everything works well through FEC which is hooked up to a RealTek RTL8305S switch.

But if I configure the kernel to use both SCC1 and FEC, SCC1 works and FEC doesn't. NFS and ping run well through SCC1(eth0). But when I try to ping out through FEC(eth1), I get ring buffer dumps and no ping response:

NETDEV WATCHDOG: eth1: transmit timed out
eth1: transmit timed out.
Ring data dump: cur_tx c1fa8100, tx_free 0, dirty_tx c1fa8100, cur_rx c1fa8020
tx: 16 buffers
c1fa8100: 9c00 002a 01f868c2
c1fa8108: 9c00 002a 01f86842
c1fa8110: 9c00 002a 01f867c2
c1fa8118: 9c00 002a 01f86742
c1fa8120: 9c00 002a 01f866c2
c1fa8128: 9c00 002a 01f86642
c1fa8130: 9c00 002a 01f865c2
c1fa8138: 9c00 002a 01f86542
c1fa8140: 9c00 002a 01f864c2
c1fa8148: 9c00 002a 01f86442
c1fa8150: 9c00 002a 01f863c2
c1fa8158: 9c00 002a 01f86342
c1fa8160: 9c00 002a 01f862c2
c1fa8168: 9c00 002a 01dafbe2
c1fa8170: 9c00 002a 01dafb62
c1fa8178: bc00 002a 01dafce2
rx: 32 buffers
c1fa8000: 8880 0252 01fa7000
c1fa8008: 8880 0040 01fa7800
c1fa8010: 8880 0162 01fa6000
c1fa8018: 8880 0040 01fa6800
c1fa8020: 8000 0000 01fa5000
c1fa8028: 8000 0000 01fa5800
c1fa8030: 8000 0000 01fa4000
c1fa8038: 8000 0000 01fa4800
c1fa8040: 8000 0000 01fa3000
c1fa8048: 8000 0000 01fa3800
c1fa8050: 8000 0000 01fa2000
c1fa8058: 8000 0000 01fa2800
c1fa8060: 8000 0000 01fa1000
c1fa8068: 8000 0000 01fa1800
c1fa8070: 8000 0000 01fa0000
c1fa8078: 8000 0000 01fa0800
c1fa8080: 8000 0000 01f9f000
c1fa8088: 8000 0000 01f9f800
c1fa8090: 8000 0000 01f9e000
c1fa8098: 8000 0000 01f9e800
c1fa80a0: 8000 0000 01f9d000
c1fa80a8: 8000 0000 01f9d800
c1fa80b0: 8000 0000 01f9c000
c1fa80b8: 8000 0000 01f9c800
c1fa80c0: 8000 0000 01f9b000
c1fa80c8: 8000 0000 01f9b800
c1fa80d0: 8000 0000 01f9a000
c1fa80d8: 8000 0000 01f9a800
c1fa80e0: 8000 0000 01f99000
c1fa80e8: 8000 0000 01f99800
c1fa80f0: 8000 0000 01f98000
c1fa80f8: a000 0000 01f98800

Doing an ifconfig gives me......(TX errors continue to accumulate indefinitely even after I stop ping)

eth0 Link encap:Ethernet HWaddr 00:02:87:55:66:77

          inet addr:199.199.199.129  Bcast:199.199.199.255

Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1538 errors:0 dropped:0 overruns:0 frame:0 TX packets:698 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100
RX bytes:1787601 (1.7 Mb) TX bytes:102816 (100.4 kb) Base address:0x3c00

eth1 Link encap:Ethernet HWaddr 00:02:87:D5:66:77
inet addr:192.168.2.129 Bcast:192.168.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:5 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100
RX bytes:1076 (1.0 kb) TX bytes:672 (672.0 b)
Base address:0xe00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:21 errors:0 dropped:0 overruns:0 frame:0 TX packets:21 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
RX bytes:2352 (2.2 kb) TX bytes:2352 (2.2 kb)

Any help is deeply appreciated.

Thanks,
Dennis Khoo
Software Engineer
Adapcom, INC.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw

Re: problem using both mpc857dsl fec and scc1

Hi,

I would say to double check your parallel port I/O settings

Jaap-Jan

Quoted 103 lines · Dennis Khoo

Hi all,

I'm having a peculiar problem.

Briefly, my platform is MPC857DSL IAD board from Motorola. I'm using U-boot 0.4.8 to bootp the kernel(2.4.18 and 2.4.22) through SCC1 and then load
NFS. If I configure the kernel with only SCC1, then everything works
well(NFS works and ping through eth0 works). If I configure the kernel with only FEC (in fec.c PDPAR[UT]=0,UTMOD[SPLIT]=1,ENCTRL[FEC_PIN_MUX]=1), then everything works well through FEC which is hooked up to a RealTek RTL8305S switch.

But if I configure the kernel to use both SCC1 and FEC, SCC1 works and FEC doesn't. NFS and ping run well through SCC1(eth0). But when I try to ping out through FEC(eth1), I get ring buffer dumps and no ping response:

NETDEV WATCHDOG: eth1: transmit timed out
eth1: transmit timed out.
Ring data dump: cur_tx c1fa8100, tx_free 0, dirty_tx c1fa8100, cur_rx c1fa8020
tx: 16 buffers
c1fa8100: 9c00 002a 01f868c2
c1fa8108: 9c00 002a 01f86842
c1fa8110: 9c00 002a 01f867c2
c1fa8118: 9c00 002a 01f86742
c1fa8120: 9c00 002a 01f866c2
c1fa8128: 9c00 002a 01f86642
c1fa8130: 9c00 002a 01f865c2
c1fa8138: 9c00 002a 01f86542
c1fa8140: 9c00 002a 01f864c2
c1fa8148: 9c00 002a 01f86442
c1fa8150: 9c00 002a 01f863c2
c1fa8158: 9c00 002a 01f86342
c1fa8160: 9c00 002a 01f862c2
c1fa8168: 9c00 002a 01dafbe2
c1fa8170: 9c00 002a 01dafb62
c1fa8178: bc00 002a 01dafce2
rx: 32 buffers
c1fa8000: 8880 0252 01fa7000
c1fa8008: 8880 0040 01fa7800
c1fa8010: 8880 0162 01fa6000
c1fa8018: 8880 0040 01fa6800
c1fa8020: 8000 0000 01fa5000
c1fa8028: 8000 0000 01fa5800
c1fa8030: 8000 0000 01fa4000
c1fa8038: 8000 0000 01fa4800
c1fa8040: 8000 0000 01fa3000
c1fa8048: 8000 0000 01fa3800
c1fa8050: 8000 0000 01fa2000
c1fa8058: 8000 0000 01fa2800
c1fa8060: 8000 0000 01fa1000
c1fa8068: 8000 0000 01fa1800
c1fa8070: 8000 0000 01fa0000
c1fa8078: 8000 0000 01fa0800
c1fa8080: 8000 0000 01f9f000
c1fa8088: 8000 0000 01f9f800
c1fa8090: 8000 0000 01f9e000
c1fa8098: 8000 0000 01f9e800
c1fa80a0: 8000 0000 01f9d000
c1fa80a8: 8000 0000 01f9d800
c1fa80b0: 8000 0000 01f9c000
c1fa80b8: 8000 0000 01f9c800
c1fa80c0: 8000 0000 01f9b000
c1fa80c8: 8000 0000 01f9b800
c1fa80d0: 8000 0000 01f9a000
c1fa80d8: 8000 0000 01f9a800
c1fa80e0: 8000 0000 01f99000
c1fa80e8: 8000 0000 01f99800
c1fa80f0: 8000 0000 01f98000
c1fa80f8: a000 0000 01f98800

Doing an ifconfig gives me......(TX errors continue to accumulate indefinitely even after I stop ping)

eth0 Link encap:Ethernet HWaddr 00:02:87:55:66:77

          inet addr:199.199.199.129  Bcast:199.199.199.255

Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1538 errors:0 dropped:0 overruns:0 frame:0 TX packets:698 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100
RX bytes:1787601 (1.7 Mb) TX bytes:102816 (100.4 kb) Base address:0x3c00

eth1 Link encap:Ethernet HWaddr 00:02:87:D5:66:77
inet addr:192.168.2.129 Bcast:192.168.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:5 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100
RX bytes:1076 (1.0 kb) TX bytes:672 (672.0 b)
Base address:0xe00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:21 errors:0 dropped:0 overruns:0 frame:0 TX packets:21 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
RX bytes:2352 (2.2 kb) TX bytes:2352 (2.2 kb)

Quoted 8 lines

Any help is deeply appreciated.

Thanks,
Dennis Khoo
Software Engineer
Adapcom, INC.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw

Re: problem using both mpc857dsl fec and scc1

Hi Jaap-Jan,

Quoted 1 line

I would say to double check your parallel port I/O settings

Thanks

Actually, when I switched to ramdisk instead of NFS, then both SCC1 and FEC
work together. Maybe some timimg issue in the fec.c code affected by
packets coming in initially?

Thanks again

Dennis Khoo
Software Engineer
Adapcom, INC

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/