Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Booting ucLinux

UCLinux is unable to find the root filesystem, and panics.

Observations:

>microtronix[mtd]: RAM probe address=0xa00000 size=0x0

>Creating 1 MTD partitions on "RAM":

>0x00000000-0x00000000 : "ROMfs"

>mtd: partition "ROMfs" is out of reach -- disabled

It finds no ram because it looks for ram inside the flash.

How can I tell it where to look for the ram?

I have 2 flash chips, one located at 0x00400000, containing the kernel, and another at 0x00800000, containing the rootfs. The ram is located at 0x01000000

So my question is how to tell the kernel where to look for the filesystem.

Console output:

---

nios2-terminal: connected to hardware target using JTAG UART on cable

nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0

nios2-terminal: starting in terminal mode only (Control-C exits)

Linux version 2.6.5-uc0 (ht@unchi) (gcc version 3.3.3 (Altera Nios II 1.0 b316))# 2 Thu Dec 9 12:51:54 2004

uClinux/Nios II

Altera Nios II support © 2004 Microtronix Datacom Ltd.

setup_arch: No persistant network settings signature at 00FF0000

On node 0 totalpages: 4096

DMA zone: 0 pages, LIFO batch:1

Normal zone: 4096 pages, LIFO batch:1

HighMem zone: 0 pages, LIFO batch:1

Built 1 zonelists

Kernel command line: root=/dev/mtdblock0 ro

PID hash table entries: 16 (order 4: 128 bytes)

Memory available: 14608k/4096k RAM, 0k/0k ROM (1293k kernel code, 281k data)

Calibrating delay loop... 24.78 BogoMIPS

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

POSIX conformance testing by UNIFIX

NET: Registered protocol family 16

Serial: JTAG UART driver $Revision: 1.3 $

ttyJ0 at MMIO 0x80000000 (irq = 8) is a jtag_uart

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

eth0: Open Ethernet Core Version 1.0

oeth_probe: 50000 Khz Nios: 16 RX, 16 TX buffs

Using anticipatory io scheduler

microtronix[mtd]: RAM probe address=0xa00000 size=0x0

Creating 1 MTD partitions on "RAM":

0x00000000-0x00000000 : "ROMfs"

mtd: partition "ROMfs" is out of reach -- disabled

microtronix[mtd]: set ROMfs to be root filesystem

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

end_request: I/O error, dev mtdblock0, sector 2

EXT2-fs: unable to read superblock

end_request: I/O error, dev mtdblock0, sector 0

FAT: unable to read boot sector

VFS: Cannot open root device "mtdblock0" or mtdblock0

Please append a correct "root=" boot option

Kernel panic: VFS: Unable to mount root fs on mtdblock0

---

Havard

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You need to write your own mapping driver ... or modify the default one

    provided by microtronix if your memory map doesn't match.

    Take a look in drivers/mtd/maps ... I think the file you want to review

    is microtronix.c ... or something like that ... sorry I don't have the source

    tree handy right now. Regardless ... the the mtd_partition array needs

    to match your hardware.

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm a little bit confused about how to do this. The reference guide describes how to install the source code, but this seemes only to be for debugging purpouses. How should I proceed to install the source code, modify the code, and get the modified result back into my kernel project?

    Havard
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi... you can modify the code directly in the plugin and when you re-build your kernel project, the changes will be reflected in your new code.

    As a side-note:

    A bug in the current release of Nios II Linux currently rebuilds the entire kernel project each time since the nios2_system.h file is constantly being rebuilt.

    I would recommend setting the <kernel_project>/build/include/nios2_system.h file to read-only unless you&#39;re constantly changing your target hardware... it&#39;s a kludge until our maintenance release is out but it should help.