Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12748 Discussions

uClinux without Flash (again)

Altera_Forum
Honored Contributor II
5,355 Views

I decided to give uClinux a try on my custom board, but I only have an SD card slot, no CFI. When reading the install guide for uClinux, and when trying it, it won't let me build a kernel project without a CFI device present? Is there any way to get around this? It seems odd that I can't build the kernel and run from DRAM, and then write to the SD Card if I wish to boot...  

 

Thx!
0 Kudos
58 Replies
Altera_Forum
Honored Contributor II
1,130 Views

I just got the NiosII for linux CD from Altera, but it was not installed properly withou quartus for linux. 

 

I'd like to setup the cross compiler env. in linux PC. But I cannot access the marc's web link:http://scorpius.homelinux.org/~marc/nios2.html (http://scorpius.homelinux.org/~marc/nios2.html) in China. Only the NiosII for linux CD, What should I do ?
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

 

--- Quote Start ---  

originally posted by mountain8848@Dec 6 2005, 10:43 PM 

i just got the niosii for linux cd from altera, but it was not installed properly withou quartus for linux. 

 

i'd like to setup the cross compiler env. in linux pc. but i cannot access the marc's web link:http://scorpius.homelinux.org/~marc/nios2.html (http://scorpius.homelinux.org/~marc/nios2.html) in china. only the niosii for linux cd, what should i do ? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11375) 

--- quote end ---  

 

--- Quote End ---  

 

 

You don&#39;t need to intsall anything - copy the binary folder from the linux CD to your linux distribution (it&#39;s like H-i386-linux etc... or something), put that folder in your path, and then: 

 

make ARCH=nios2nommu CROSS_COMPILE=(prefix of the binary)- hwselect SYSPTF=yourptf.ptf 

 

then menuconfig... 

 

then just regular make.
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

1. remove root=/dev/mtdblock2 ro 

2. enable <*> Initramfs  

3. setup Initramfs source file(s) 

 

but after build the kernel , gavin the following errors: 

 

... ... CC      init/do_mounts_initrd.o In file included from /cygdrive/d/EDA/altera/kits/nios2_50/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/include/linux/unistd.h:9,                 from /cygdrive/d/EDA/altera/kits/nios2_50/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/init/do_mounts_initrd.c:2: include2/asm/unistd.h:659: error: parse error before "setsid" include2/asm/unistd.h:659: warning: return type defaults to `int&#39; include2/asm/unistd.h: In function `setsid&#39;: include2/asm/unistd.h:659: error: `pid_t&#39; undeclared (first use in this function) ... ...
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

It looks like you have initrd enabled - turn it off, you do&#39;nt need it - just turn on Initramfs and point it to the source tree. 

 

It looks like you are still using Cygwin; this whole thread has been about how you can&#39;t use Cygwin for initramfs http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif You may want to try this with linux...
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

now I develop linux kernel in linux(redhat 9.0) 

 

1. copy /bin/nios2-elf-.... to pc from CD of nios2linux 

2. set PATH 

3. make hwselect ; make menuconfig ; make (like you stated out) 

the .config is much like you post in this thread. 

here is linux log 

version 3.4.1 (Altera Nios II 5.0 b73b))# 4 Sun Dec 11 19:38:18 CST 2005 uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: 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: 15232k/16384k RAM, 0k/0k ROM (633k kernel code, 330k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Linux NoNET1.0 for Linux 2.6 NIOS serial driver version 0.0 ttyS0 (irq = 3) is a builtin NIOS UART ttyS1 (irq = 7) is a builtin NIOS UART ttyS2 (irq = 8) is a builtin NIOS UART ttyS3 (irq = 9) is a builtin NIOS UART io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

Here is the kernel config: .config 

NOTE: only one red line is difference, cause it will cause error when it is "=y" 

# Automatically generated make config: don&#39;t edit# Linux kernel version: 2.6.11-uc0# Sun Dec 11 19:35:42 2005# # CONFIG_MMU is not set# CONFIG_FPU is not set 

CONFIG_UID16=y 

CONFIG_RWSEM_GENERIC_SPINLOCK=y# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 

CONFIG_GENERIC_CALIBRATE_DELAY=y 

# # Code maturity level options#  

CONFIG_EXPERIMENTAL=y 

CONFIG_CLEAN_COMPILE=y 

CONFIG_BROKEN_ON_SMP=y 

# # General setup#  

CONFIG_LOCALVERSION=""# CONFIG_BSD_PROCESS_ACCT is not set# CONFIG_SYSCTL is not set# CONFIG_AUDIT is not set 

CONFIG_LOG_BUF_SHIFT=14# CONFIG_HOTPLUG is not set# CONFIG_IKCONFIG is not set 

CONFIG_EMBEDDED=y 

#CONFIG_KALLSYMS is not set # original : CONFIG_KALLSYMS=y# CONFIG_KALLSYMS_EXTRA_PASS is not set 

CONFIG_FUTEX=y 

CONFIG_EPOLL=y# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 

CONFIG_CC_ALIGN_FUNCTIONS=0 

CONFIG_CC_ALIGN_LABELS=0 

CONFIG_CC_ALIGN_LOOPS=0 

CONFIG_CC_ALIGN_JUMPS=0 

CONFIG_TINY_SHMEM=y 

# # Loadable module support# # CONFIG_MODULES is not set 

# # Processor type and features#  

# # Platform dependant setup#  

CONFIG_NIOS2=y# CONFIG_MICROTRONIX_UKIT is not set# CONFIG_MICROTRONIX_STRATIX is not set# CONFIG_MICROTRONIX_CYCLONE is not set# CONFIG_MICROTRONIX_PSK is not set 

CONFIG_ALTERA_STRATIX=y# CONFIG_ALTERA_STRATIX_PRO is not set# CONFIG_ALTERA_STRATIX_II is not set# CONFIG_ALTERA_CYCLONE is not set# CONFIG_ALTERA_CYCLONE_1C12_EVAL is not set# CONFIG_NIOS2_HW_MUL_OFF is not set 

CONFIG_NIOS2_HW_MUL=y# CONFIG_NIOS2_HW_MULX is not set 

# # Miscellaneous Options# # CONFIG_AVALON_DMA is not set# CONFIG_PIO_DEVICES is not set 

CONFIG_EXCALIBUR=y# CONFIG_BREAK_ON_START is not set# CONFIG_LARGE_ALLOCS is not set 

CONFIG_RAMKERNEL=y# CONFIG_PREEMPT is not set 

CONFIG_CMDLINE="" 

# # Bus options (PCI, PCMCIA, EISA, MCA, ISA)# # CONFIG_PCI is not set 

# # PCCARD (PCMCIA/CardBus) support# # CONFIG_PCCARD is not set 

# # PC-card bridges#  

# # PCI Hotplug Support#  

# # Executable file formats#  

CONFIG_KCORE_AOUT=y 

CONFIG_KCORE_ELF=y 

CONFIG_BINFMT_FLAT=y# CONFIG_BINFMT_ZFLAT is not set# CONFIG_BINFMT_SHARED_FLAT is not set# CONFIG_BINFMT_MISC is not set 

# # Power management options# # CONFIG_PM is not set 

# # Device Drivers#  

# # Generic Driver Options#  

CONFIG_STANDALONE=y 

CONFIG_PREVENT_FIRMWARE_BUILD=y# CONFIG_FW_LOADER is not set 

# # Memory Technology Devices (MTD)# # CONFIG_MTD is not set 

# # Parallel port support# # CONFIG_PARPORT is not set 

# # Plug and Play support#  

# # Block devices# # CONFIG_BLK_DEV_FD is not set# CONFIG_BLK_DEV_COW_COMMON is not set# CONFIG_BLK_DEV_LOOP is not set# CONFIG_BLK_DEV_RAM is not set 

CONFIG_BLK_DEV_RAM_COUNT=16 

CONFIG_INITRAMFS_SOURCE="/home/uc/root" 

CONFIG_INITRAMFS_ROOT_UID=500 

CONFIG_INITRAMFS_ROOT_GID=500# CONFIG_CDROM_PKTCDVD is not set 

# # IO Schedulers#  

CONFIG_IOSCHED_NOOP=y 

CONFIG_IOSCHED_AS=y 

CONFIG_IOSCHED_DEADLINE=y 

CONFIG_IOSCHED_CFQ=y 

# # ATA/ATAPI/MFM/RLL support# # CONFIG_IDE is not set 

# # SCSI device support# # CONFIG_SCSI is not set 

# # Multi-device support (RAID and LVM)# # CONFIG_MD is not set 

# # Fusion MPT device support#  

# # IEEE 1394 (FireWire) support# # CONFIG_IEEE1394 is not set 

# # I2O device support#  

# # Networking support# # CONFIG_NET is not set# CONFIG_NETPOLL is not set# CONFIG_NET_POLL_CONTROLLER is not set 

# # ISDN subsystem#  

# # Telephony Support# # CONFIG_PHONE is not set 

# # Input device support# # CONFIG_INPUT is not set 

# # Userland interfaces#  

# # Input I/O drivers# # CONFIG_GAMEPORT is not set 

CONFIG_SOUND_GAMEPORT=y# CONFIG_SERIO is not set# CONFIG_SERIO_I8042 is not set 

# # Input Device Drivers#  

# # Character devices# # CONFIG_VT is not set# CONFIG_SERIAL_NONSTANDARD is not set# CONFIG_NIOS_SPI is not set# CONFIG_NIOS_BUTTON is not set 

# # Serial drivers# # CONFIG_SERIAL_8250 is not set 

# # Non-8250 serial port support#  

CONFIG_NIOS_SERIAL=y 

CONFIG_NIOS_SERIAL_CONSOLE=y# CONFIG_SERIAL_AJUART is not set# CONFIG_UNIX98_PTYS is not set# CONFIG_LEGACY_PTYS is not set 

# # IPMI# # CONFIG_IPMI_HANDLER is not set 

# # Watchdog Cards# # CONFIG_WATCHDOG is not set# CONFIG_RTC is not set# CONFIG_GEN_RTC is not set# CONFIG_DTLK is not set# CONFIG_R3964 is not set 

# # Ftape, the floppy tape device driver# # CONFIG_DRM is not set# CONFIG_RAW_DRIVER is not set 

# # I2C support# # CONFIG_I2C is not set 

# # Dallas&#39;s 1-wire bus# # CONFIG_W1 is not set 

# # Misc devices#  

# # Multimedia devices# # CONFIG_VIDEO_DEV is not set 

# # Digital Video Broadcasting Devices#  

# # Graphics support# # CONFIG_FB is not set 

# # Sound# # CONFIG_SOUND is not set 

# # USB support# # CONFIG_USB is not set 

CONFIG_USB_ARCH_HAS_HCD=y 

CONFIG_USB_ARCH_HAS_OHCI=y 

# # NOTE: USB_STORAGE enables SCSI, and &#39;SCSI disk support&#39; may also be needed; see USB_STORAGE Help for more information#  

# # USB Gadget Support# # CONFIG_USB_GADGET is not set 

# # MMC/SD Card support# # CONFIG_MMC is not set 

# # InfiniBand support# # CONFIG_INFINIBAND is not set 

# # File systems# # CONFIG_EXT2_FS is not set# CONFIG_EXT3_FS is not set# CONFIG_JBD is not set# CONFIG_REISERFS_FS is not set# CONFIG_JFS_FS is not set 

# # XFS support# # CONFIG_XFS_FS is not set# CONFIG_MINIX_FS is not set# CONFIG_ROMFS_FS is not set# CONFIG_QUOTA is not set# CONFIG_DNOTIFY is not set# CONFIG_AUTOFS_FS is not set# CONFIG_AUTOFS4_FS is not set 

# # CD-ROM/DVD Filesystems# # CONFIG_ISO9660_FS is not set# CONFIG_UDF_FS is not set 

# # DOS/FAT/NT Filesystems# # CONFIG_MSDOS_FS is not set# CONFIG_VFAT_FS is not set# CONFIG_NTFS_FS is not set 

# # Pseudo filesystems#  

CONFIG_PROC_FS=y 

CONFIG_SYSFS=y# CONFIG_DEVFS_FS is not set# CONFIG_TMPFS is not set# CONFIG_HUGETLB_PAGE is not set 

CONFIG_RAMFS=y 

# # Miscellaneous filesystems# # CONFIG_ADFS_FS is not set# CONFIG_AFFS_FS is not set# CONFIG_HFS_FS is not set# CONFIG_HFSPLUS_FS is not set# CONFIG_BEFS_FS is not set# CONFIG_BFS_FS is not set# CONFIG_EFS_FS is not set# CONFIG_CRAMFS is not set# CONFIG_VXFS_FS is not set# CONFIG_HPFS_FS is not set# CONFIG_QNX4FS_FS is not set# CONFIG_SYSV_FS is not set# CONFIG_UFS_FS is not set 

# # Partition Types# # CONFIG_PARTITION_ADVANCED is not set 

CONFIG_MSDOS_PARTITION=y 

# # Native Language Support# # CONFIG_NLS is not set 

# # Kernel hacking# # CONFIG_FULLDEBUG is not set# CONFIG_FRAME_POINTER is not set# CONFIG_MAGIC_SYSRQ is not set# CONFIG_NO_KERNEL_MSG is not set 

# # Security options# # CONFIG_KEYS is not set# CONFIG_SECURITY is not set 

# # Cryptographic options# # CONFIG_CRYPTO is not set 

# # Hardware crypto devices#  

# # Library routines# # CONFIG_CRC_CCITT is not set# CONFIG_CRC32 is not set# CONFIG_LIBCRC32C is not set
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

TO_BE_DONE

0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

Thank jdhar and hippo so much, I worked out the right vmlinux, which can bootup with initramfs. 

--------------------------------------------------------------- 

I crated ROOTFS half-automatically & half-manually 

1. zip win pc ROOTFS 

2. copy to linux pc 

3. unzip -a in order to dos2linux 

4. modify them properly: such as symbolic link files (ln -fvs * *)and /dev (mknod) 

5. ln -fvs ./busybox init 

--------------------------------------------------------------- 

I tested by : 

1. ftp vmlinuc to win pc 

2. nios2-download -g vmlinux 

3. test telnet, ping .... ok 

--------------------------------------------------------------- 

 

 

other problems: 

1. I just got vmlinux in <linux-2.6.x> directory. I&#39;d like to build out vmlinux.bin in order to let u-boot to boot or flash-programmer. How to do it ?  

 

2. Could you send me the webpages about nios2-linux toolchain in marc&#39;shttp://scorpius.homelinux.org/~marc/nios2.html (http://scorpius.homelinux.org/~marc/nios2.html) to jwq815@sina.com?
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

hi,mountain8848 

you build the kernel under windows or linux? 

 

 

 

--- Quote Start ---  

originally posted by mountain8848@Dec 12 2005, 11:05 PM 

thank jdhar[/b] and hippo so much, I worked out the right vmlinux, which can bootup with initramfs. 

--------------------------------------------------------------- 

I crated ROOTFS  half-automatically & half-manually 

1. zip win pc ROOTFS 

2. copy to linux pc 

3. unzip -a in order to dos2linux 

4. modify them properly: such as symbolic link files (ln -fvs * *)and /dev (mknod) 

5. ln -fvs ./busybox init 

--------------------------------------------------------------- 

I tested by : 

1. ftp vmlinuc to win pc 

2. nios2-download -g vmlinux 

3. test telnet, ping .... ok 

--------------------------------------------------------------- 

 

 

other problems: 

1. I just got vmlinux in <linux-2.6.x> directory. I&#39;d like to build out vmlinux.bin in order to let u-boot to boot or flash-programmer. How to do it ?  

 

2. Could you send me the webpages about nios2-linux toolchain in marc&#39;shttp://scorpius.homelinux.org/~marc/nios2.html (http://scorpius.homelinux.org/~marc/nios2.html)  to jwq815@sina.com

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11493) 

--- Quote End ---  

[/b] 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

"all of the thread is talking about how to build the kernel under linux"

0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

> I&#39;d like to build out vmlinux.bin in order to let u-boot to boot or flash-programmer. 

> How to do it ?  

 

For u-boot: 

 

1. Optionally compress the linux binary. 

2. Create the u-boot image file from the linux binary (or compressed binary). 

3. Load the image file into ram. 

4. Execute the u-boot "bootm" command. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

1. 

----------------------------------------------------- 

In redhat, when I  

 

make ARCH=....  

 

it just built out vmlinux, which is used for "nios2-download -g vmlinux" to debug in SDRAM. I&#39;d like to get vmlinux.bin, which is used for nios2-flash-program. 

 

is it also nios2-elf-objcopy?? 

 

2. 

----------------------------------------------------- 

there is a exe file in <plugs>/<microtronix>/application/bin/elf2flt.exe 

 

but how to get elf2flt in redhat?  

I cannot surf marc&#39;s page to build toolchain.
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

Regarding Q1, I&#39;m not sure, I tried doing the same at one point, but I don&#39;t think I ever got it... 

 

Regarding elf2flt, check the linux distribution CD where you got all the linux binaries from. If it&#39;s not there, I&#39;m afraid you will have to build the toolchain somehow... or at least get those binaries. You can probably email Marc himself and ask for binaries.
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

1. There is no elf2flt in the linux distribution CD. The source is in the examples/software/linux/utils/elf2flt. But you need libbfd to build it. It should be better to do the buildroot following the marc&#39;s page. 

 

2. "nios2-elf-objcopy -O binary vmlinux vmlinux.bin" will create the raw binary file.
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

 

--- Quote Start ---  

originally posted by hippo@Dec 14 2005, 08:06 PM 

1. there is no elf2flt in the linux distribution cd. the source is in the examples/software/linux/utils/elf2flt. but you need libbfd to build it. it should be better to do the buildroot following the marc&#39;s page. 

 

2. "nios2-elf-objcopy -o binary vmlinux vmlinux.bin" will create the raw binary file. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11562) 

--- quote end ---  

 

--- Quote End ---  

 

 

I agree with hippo - the toolchain is ultimately the best way to go... I tried working with the windows one, and it&#39;s just so much slower and you can&#39;t automate it like with linux - so I would definitely advise trying to build it.
0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

but I cannot surf marc&#39;s website here, China.

0 Kudos
Altera_Forum
Honored Contributor II
1,130 Views

 

--- Quote Start ---  

originally posted by mountain8848@Dec 15 2005, 03:13 AM 

but i cannot surf marc&#39;s website here, china. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11578) 

--- quote end ---  

 

--- Quote End ---  

 

 

I&#39;m looking for a Proxy Server outside China,so we can visit the site
0 Kudos
Reply