Forum Discussion
Altera_Forum
Honored Contributor
21 years agoR/W Filesystem?
I'm currently running the stock FS, built following the instructions in the Getting Started manual.
Is there any quick way to make this FS read/write? Changing the kernel command line string to 'root=/dev/mtdblock0 rw' didn't work. If this is possible, great -- my second problem is then how to 'save' FS changes back to flash (i.e. surviving a reboot/power cycle). If not, what do I need to do this? All I'd really like to do is be able to update config files and my userland apps via FTP instead of the oftentimes tedious (not to mention expensive) procedure of needing a ($$)Blaster cable and flashing the new FS image everytime I change a line of code. Thanks, Ryan Quantapoint23 Replies
- Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- What does the type mean, I only see c or b, what do I have to set ?[/b] --- Quote End --- b = Block Device, c = Char Device Use B. Ryan - Altera_Forum
Honored Contributor
Thanks a lot, it works fine
Regards Pierre-Olivier - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by wentao@Mar 31 2005, 09:14 AM mount -t jffs2 /dev/mtdblock0 /temp/flashmount -nshould be fine. that partition shall be erased first, otherwise you may get a long train of messages. --- Quote End --- Hi, After giving the following command "mount -t jffs2 /dev/mtdblock0 /mnt/rwfs -n" i'm getting a long train of messages. How to erase that partition? Thanks, Pankaj.
- Altera_Forum
Honored Contributor
Hi Pankaj,
to erase it, you have to do it directly, whithout any OS. a simple program like this should be enough :
This erases from address 0x500000 to 0x600000 according the erase block size is 0x10000. Regards Pod#include <stdio.h># include "system.h"# include "sys/alt_flash.h" int main() { alt_flash_fd* flash; int i; flash=alt_flash_open_dev(EXT_FLASH_NAME); for (i=0x500000;i<0x600000;i=i+0x10000) { printf("Erase %08x\n",i); alt_erase_flash_block(flash,i,0x10000); } return 0; } - Altera_Forum
Honored Contributor
Hi Pankaj,
You might also want to use the u-boot or Redboot monitors ... even if you __don't__ plan on using these as part of your product, they can be quite useful for such tasks during development. Regards, --Scott - Altera_Forum
Honored Contributor
After erasing that partition also i'm getting the same errors.
My boot messages are:
The error messages after giving mount command (which keep on appearing) are:uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. setup_arch: No persistant network settings signature at 007F0000 Built 1 zonelists Kernel command line: root=/dev/mtdblock0 ro PID hash table entries: 128 (order: 7, 2048 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory available: 14364k/16384k RAM, 0k/0k ROM (1506k kernel code, 317k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc. Serial: JTAG UART driver $Revision: 1.3 $ ttyJ0 at MMIO 0x821208b0 (irq = 1) is a jtag_uart RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize smc_probe: 50000 Khz Nios SMSC LAN91C111 Driver (v2.1), (Linux Kernel 2.6) eth0: SMC91C11xFD(rev:1) at 0x82110300 IRQ:6 MEMSIZE:8192b NOWAIT:0 ADDR: 00:07: ed:00:00:00 smc_probe: 50000 Khz Nios Using anticipatory io scheduler Altera NDK flash (AMD): Found 1 x8 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 Altera NDK flash (AMD): CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. cmdlinepart partition parsing not available RedBoot partition parsing not available Using Altera NDK partition definition Creating 5 MTD partitions on "Altera NDK flash (AMD)": 0x00200000-0x00500000 : "romfs/jffs2" 0x00500000-0x00600000 : "rwfs" 0x00000000-0x00200000 : "loader/kernel" 0x00600000-0x00700000 : "User configuration" 0x00700000-0x00800000 : "safe configuration" NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 1024 bind 2048) NET: Registered protocol family 1 NET: Registered protocol family 17 VFS: Mounted root (romfs filesystem) readonly. Freeing unused kernel memory: 48k freed (0x11aa000 - 0x11b5000) expand: from=/ramfs.img to=/dev/ram0 expand: from=/ramfs.img to=/dev/ram1 /etc/issue www.microtronix.com July 2004 Welcome to Linux on the Nios II Nios2 login: nios Password:
How to solve this problem? Thanks in anticipation, Regards, Pankaj.# mount -t jffs2 /dev/mtdblock0 /mnt/rwfs -n jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x722d in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x6631 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x2b00 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0xe310 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x6966 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x7973 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x6d65 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x6d6f in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000003c: 0xffd1 in stead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000040: 0x002e in stead Further such events for this erase block will not be printed Old JFFS2 bitmask found at 0x00004434 You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x00004504 You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x00004514 You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x000046b4 You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x00006398 You cannot use older JFFS2 filesystems with newer kernels Empty flash at 0x00009a20 ends at 0x00009a24 Empty flash at 0x0000b7c8 ends at 0x0000b7cc Empty flash at 0x0000b7e0 ends at 0x0000b7e4 Old JFFS2 bitmask found at 0x0000f55c You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x0000f62c You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x0000f63c You cannot use older JFFS2 filesystems with newer kernels Old JFFS2 bitmask found at 0x0000f7dc You cannot use older JFFS2 filesystems with newer kernels - Altera_Forum
Honored Contributor
I had the same problem, but it was solved when I erased the flash...
Can you verify that the zone you erased is actually empty (all 1's) ? pod - Altera_Forum
Honored Contributor
I'm facing the same problems again.
0. Why does the kernel accesses memory location - 0x00000000, after giving mount command :
I've checked the data at 0x00000000, it is not 0x722d as declared by error message. 1. I had only created new partition by allocating size and offset in "altera.c" file. Do I need to do something extra to make that partition compatible for jffs2? Regards, Pankaj# mount -t jffs2 /dev/mtdblock0 /mnt/rwfs -n jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x722d in stead - Altera_Forum
Honored Contributor
Hi Pankajsharma,
> Why does the kernel accesses memory location - 0x00000000, after > giving mount command It is scanning the jffs2 file system ... but I believe the value is an offset in the flash ... not the physical address. You can check this yourself ... use the force ;-) > I had only created new partition by allocating size and offset in "altera.c" file. > Do I need to do something extra to make that partition compatible for jffs2? Did you erase the partition? Regards, --Scott - Altera_Forum
Honored Contributor
Hi,
I am now able to mount jffs2 http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif The only change i made was : using mtdblock1 instead of mtdblock0. I still don't know why it is so, but it is working. Thanks for the replies, Regards, Pankaj.