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++

uClinux without Flash (again)

Altera_Forum
Honored Contributor II
5,359 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
967 Views

There is no free MMC driver on NIOS right now. And I am writing one using PIO. I will open it when ready. 

 

The Slackware is old and good, and I had been using it more than ten years. There is no problem to generate the tools chain. 

 

I never uses the Window's/IDE tools chain. I built them on Linux since the very early beta. 

The shipped NIOS2 for Linux use newlib, and lack the elf2flt to build busybox and apps. 

The source of the GND tools can be selected on the packages list when you install NIOS2. 

They will be installed into the dir altera/kits/nios2/bin/nios2-gnutools/src. 

I use these before I work on uclinux about one month ago, then I built the one from marc's page. 

So I have two tools chain now. 

 

To build the tools chain follow the marc's page. 

In build root menuconfig, set binutils ver to 2.15, gcc 3.4.3, and no busybox. 

 

I think the problem is still dos2unix. I had the same truncated zip problem when I use the original kernel source 

tree from microtronix. I had to remove dos2unix, and convert the source tree to fix the CRLF with 

zip -r and unzip -a to anther dir. You can try to convert the source tree on Linux, then compile them under windows.
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

 

--- Quote Start ---  

originally posted by hippo@Nov 26 2005, 07:54 PM 

there is no free mmc driver on nios right now. and i am writing one using pio. i will open it when ready. 

 

the slackware is old and good, and i had been using it more than ten years. there is no problem to generate the tools chain. 

 

i never uses the window's/ide tools chain. i built them on linux since the very early beta. 

the shipped nios2 for linux use newlib, and lack the elf2flt to build busybox and apps. 

the source of the gnd tools can be selected on the packages list when you install nios2. 

they will be installed into the dir  altera/kits/nios2/bin/nios2-gnutools/src. 

i use these before i work on uclinux about one month ago, then i built the one from marc's page. 

so i have two tools chain now. 

 

to build the tools chain follow the marc's page. 

in build root menuconfig, set binutils ver to 2.15, gcc 3.4.3, and no busybox. 

 

i think the problem is still dos2unix. i had the same truncated zip problem when i use the original kernel source 

tree from microtronix. i had to remove dos2unix, and convert the source tree to fix the crlf with 

zip -r  and unzip -a to anther dir. you can try to convert the source tree on linux, then compile them under windows. 

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

--- quote end ---  

 

--- Quote End ---  

 

 

OK, - so I think I get it now - the microtronix is a kernel source tree specifically targeted for Cygwin and the Eclipse IDE, while the process on Marcs page is a different kernel source tree targeted for linux, correct? The two are independant of eachother I&#39;m guessing..  

 

So for the cygwin method, you are suggesting that I zip up the microtronix tree in linux using &#39;zip&#39;, and unzip to another directory (shared in windows) in linux using unzip, and then try to build using that? (or perhaps overwriting the original microtronix tree with the unzipped version). And remove the dos2unix line also...
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Not exactly, the marc&#39;s are from the microtronix. Just remove the CRLF and dos2unix and some cygwin  

path. Then merge back to uclinux release. They are basically the same. 

 

I restore the dos2unix again, but can&#39;t get the same error. 

Please install marc&#39;s tools chain. 

 

You can also try, zip -r , rename the kernel tree, and unzip -a. Remove the dos2unix in the kernel 

Makefile, with a Linux editor. Adding# as comment will not work. 

You can not use windows editor, they will add CRLF. 

Then compile using windows tools. 

 

You can check the kernel usr dir, try gunzip initramfs_data.cpio.gz. To see if the gz is OK. 

If gunzip is OK, the AS is just .incbin of it, then it should be the tool&#39;s problem.
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Well, I tried building the toolchain described by Marc, and I used the uClibc version on his site, patched the buildroot like he said, and used gss versions 3.4.3 and 3.4.2, no busybox, and the build fails with: 

 

 

make -C internals 

make[4]: Entering directory `/mnt/usbhd/jdhar/buildroot/toolchain_build_nios2/uClibc/libc/misc/internals&#39; 

"/mnt/usbhd/jdhar/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-"gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -funit-at-a-time -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -isystem /mnt/usbhd/jdhar/buildroot/build_nios2/staging_dir/lib/gcc/nios2-linux-uclibc/3.4.2/include -DNDEBUG -c __uClibc_main.c -o __uClibc_main.o 

__uClibc_main.c:23:23: asm/errno.h: No such file or directory 

__uClibc_main.c: In function `__check_one_fd&#39;: 

__uClibc_main.c:72: error: `EBADF&#39; undeclared (first use in this function) 

__uClibc_main.c:72: error: (Each undeclared identifier is reported only once 

__uClibc_main.c:72: error: for each function it appears in.) 

__uClibc_main.c: At top level: 

__uClibc_main.c:70: warning: &#39;__check_one_fd&#39; defined but not used 

__uClibc_main.c:92: warning: &#39;__check_suid&#39; defined but not used 

 

I got the binaries from marc directly, so I will try getting the 2.6.9 kernel and patching it as instructed on the page - but I&#39;m not hopeful that it will work either... 

 

I tried removing the extra LFs by zipping/unzipping (I verified that it did remove them in fact).. and I replaced the linux-2.6.x directory in the microtronix setup files with the new directory and reinstalled. When I build, I get this at the very end: 

 

nios2_system.h: 

init/.version.o.d: done. 

LD init/built-in.o 

LD .tmp_vmlinux1 

KSYM .tmp_kallsyms1.S 

AS .tmp_kallsyms1.o 

./..tmp_kallsyms1.o.d: not found 

make[1]: *** [.tmp_kallsyms1.o] Error 127 

make: *** [_all] Error 2 

make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x&#39; 

 

I changed the makefile from: 

 

dos2unix $(depfile);  

 

to just: 

 

$(depfile);  

 

I also tried removin the line altogether, and it didn&#39;t work... on the plus side though, it seems like it removed the Warning about the CPIO Archive
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

You should use kernel ver 2.6.11, as it was in microtronix v1.4. 

 

You should already get the kernel build in cygwin !! 

The dos2unix does not matter. (?) 

Check the vmlinux file. 

After some search in the Makefile and Kconfig, the last error was from ksymall for debug 

which is from, 

menuconfig -> kernel hacking -> full Symbolic/Source debuggin support. 

You can safely disable it.
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

 

--- Quote Start ---  

originally posted by hippo@Nov 27 2005, 07:57 PM 

you should use kernel ver 2.6.11, as it was in microtronix v1.4. 

 

you should already get the kernel build in cygwin !! 

the dos2unix does not matter. (?) 

check the vmlinux file. 

after some search in the makefile and kconfig, the last error was from ksymall for debug 

which is from, 

menuconfig -> kernel hacking -> full symbolic/source debuggin support. 

you can safely disable it. 

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

--- quote end ---  

 

--- Quote End ---  

 

 

I disabled it, and it&#39;s still giving me that error... no options on in kernel hacknig, and I&#39;m using as few kernel options as possible. I converted the linux-2.6.x tree using zip/unzip, but should I do the same with my project directory also? Ie, with the .config file... I don&#39;t think it would make a difference since only output is being placed there. 

 

I don&#39;t understand how come this is so difficult to do in Windows... there must be something else I&#39;m doing wrong?
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

I try the cygwin console, it just failed in making the Initramfs. 

It is time to move to Linux. Linux is much faster than cygwin, too. 

 

You can use the GNU tools in NIOS2 for Linux platform. I did try it. 

Make sure the altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-linux-gnu/bin is in your path. 

You can use the "unzip -a" of the kernel tree of microtronix as I did it. 

Then  

1. make ARCH=nios2nommu CROSS_COMPILE=nios2-elf- hwselect SYSPTF=your.ptf 

2. make ARCH=nios2nommu CROSS_COMPILE=nios2-elf- menuconfig 

3. make ARCH=nios2nommu CROSS_COMPILE=nios2-elf- 

 

Below is the sample .config 

# # Automatically generated make config: don&#39;t edit# Linux kernel version: 2.6.11-uc0# Mon Nov 28 22:35:10 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=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
967 Views

Ya, I do&#39;nt think it&#39;s possible in windows - I just trashed the whole microtronix tree, grabbed the source from the install file, converted it using zip/unzip and installed the converted version, made a new kernel project in the IDE, and tried to compile with no options, and it still gave me the same error... 

 

Since you said the NIOS 2 Linux bins work fine, I won&#39;t try using the buildroot method - and I agree that linux should be faster more efficient, it&#39;s just all this pain in setting it up. I will try the binaries when I&#39;m at my linux computer, and let you know... 

 

Thanks so much!
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Finally some progress (I think)!! 

 

Here is what I did: 

 

I converted the microtronix tree and placed it in linux... I then copied the H-i686-pc-linux-gnu/ directory from the Nios II linux CD and set my path to the bin directory in there (with all the elf-* files). I created a filesystem project in Eclipse IDE with very few things, but I have an /bin/init.exe and /etc/inittab in there. I copied the init.exe to /init so it would find it - and my inittab is: 

# inittab for uClinux# Format:# ttyline:termcap-entry:getty-command# ttyS0:vt100:/bin/agetty 115200 ttyS0# ttyS1:vt100:/bin/agetty 115200 ttyS1 

ttyJ0:vt100:/bin/agetty 115200 ttyJ0 

 

 

I&#39;m guessing I need more things in here? 

 

Anyway, some comments: It&#39;s still doing dos2unix when I compile in linux using the three make commands you listed.. but I don&#39;t get the warning anymore, and it builds successfully. Here&#39;s an example: 

 

make[1]: `arch/nios2nommu/kernel/asm-offsets.s&#39; is up to date. 

CHK include/asm-nios2nommu/asm-offsets.h 

CHK include/linux/compile.h 

CHK usr/initramfs_list 

UPD usr/initramfs_list 

CPIO usr/initramfs_data.cpio 

GZIP usr/initramfs_data.cpio.gz 

AS usr/initramfs_data.o 

dos2unix: converting file usr/.initramfs_data.o.d to UNIX format ... 

LD usr/built-in.o 

GEN .version 

CHK include/linux/compile.h 

UPD include/linux/compile.h 

CC init/version.o 

dos2unix: converting file init/.version.o.d to UNIX format ... 

LD init/built-in.o 

LD .tmp_vmlinux1 

KSYM .tmp_kallsyms1.S 

AS .tmp_kallsyms1.o 

LD .tmp_vmlinux2 

KSYM .tmp_kallsyms2.S 

AS .tmp_kallsyms2.o 

LD vmlinux 

SYSMAP System.map 

SYSMAP .tmp_System.map 

Building modules, stage 2. 

MODPOST 

 

I&#39;m guessing there are dos2unix&#39;s elsewhere in the tree Makefiles? 

 

Then, I download the .sof to the board, and using sopc builder in windows/cygwin, I do: 

 

nios2-download --go ./vmlinux <-- compiled in linux 

 

It downloads and runs, and here is the output: 

 

Linux version 2.6.11-uc0 (jdhar@nawattla02.lsil.com) (gcc version 3.4.1 (Altera 

Nios II 5.0 b86))# 6 Mon Nov 28 14:28:08 EST 2005 

 

 

uClinux/Nios II 

Altera Nios II support © 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: 14976k/16384k RAM, 0k/0k ROM (750k kernel code, 484k data) 

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

Linux NoNET1.0 for Linux 2.6 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x80801860 (irq = 2) is a jtag_uart 

io scheduler noop registered 

io scheduler anticipatory registered 

io scheduler deadline registered 

io scheduler cfq registered 

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

Freeing unused kernel memory: 320k freed (0x10da000 - 0x1129000) 

Warning: unable to open an initial console. 

 

So no error on mounting root, which is great.. so I&#39;m not sure about that warning, and I&#39;m going to try and play around with inittab.  

 

Is creating the filesystem in Eclipse ok, or is that what buildroot is for in linux? 

 

I tried playing aroudn with different filesystems, and it seems that if I have more than just the very minimum (busybox.exe for example), it will fail to mount root altogether (I get a kernel panic/sync error).
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Cheer!! 

 

About the root fs, it should be better to build it by hand. It is simple and clean. 

I would prefer doing all the works in a shell console, instead of the IDE. 

The IDE may add something unpredictable. 

You should build everything in console, and back to IDE when you download and test. 

 

You can borrow a lot from Slackware/initrd, in tranditional Linux life style. 

Setup all the dirs, bin,sbin,etc,dev,usr,usr/bin,var,tmp,proc,sys ... 

Check if you have all the devices you will use, zero,null,console ( and hda,hda1... etc) 

It maybe missing /dev/console that give you the warning. 

 

Setup the install path to your root fs in Busybox menuconfig. And make install, it will copy and 

setup the symlinks. 

Add a symlink /init to /sbin/init for initramfs to work. 

 

And a very simple inittab, 

# Startup the file system 

null::sysinit:/bin/mount -t proc proc /proc 

null::sysinit:/bin/mount -t sysfs sysfs /sys 

# busybox console 

::askfirst:/bin/sh 

 

You should be sitting in front of busybox prompt now. 

 

About the apps, I would prefer add them to busybox. 

It saves space and troubles.
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

I agree, I want to stick with linux now, no more IDE except for downloading - but I definitely don&#39;t know how to build the filesystem from scratch.  

 

Should I just create an empty directory, and then create the following directories: 

/bin 

/sbin 

/etc 

/dev 

/usr 

/var 

/tmp 

/proc 

/sys 

 

I don&#39;t understand how to create entries in the /dev directory - the only device I need for now is the JTAG UART (I think) - so how do I create an entry for this? 

What other entries in /dev do I need? Once I do that, I can create an /etc/inittab file like you said.. 

 

Then I have to get busybox working, correct? I was able to do a make menuconfig in Cygwin in the busybox directory, but I couldn&#39;t get it in linux... should I follow the instructions on MArcs page for busybox, or should I copy it from the examples apps directory in windows??? Then onc eI have it in linux, I should be able to add any apps using the menu and do a make; make install. I did this all in windows, but I would like to do it in linux too (keep it simple like you said).  

 

So correct me if I&#39;m wrong, but /init is automatically executed when the root initramfs is mounted, correct? and /sbin/init will be built by busybox... and init uses /etc/inittab to do more stuff?? How is the login console started then? 

 

I will try and get busybox building in linux now... can I just download from the busybox site, or is there a special build for nios2? 

 

 

--- Quote Start ---  

originally posted by hippo@Nov 28 2005, 08:07 PM 

cheer!! 

 

about the root fs, it should be better to build it by hand. it is simple and clean. 

i would prefer doing all the works in a shell console, instead of the ide. 

the ide may add something unpredictable. 

you should build everything in console, and back to ide when you download and test. 

 

you can borrow a lot from slackware/initrd, in tranditional linux life style. 

setup all the dirs, bin,sbin,etc,dev,usr,usr/bin,var,tmp,proc,sys  ... 

check if you have all the devices you will use, zero,null,console ( and hda,hda1... etc) 

it maybe missing /dev/console that give you the warning. 

 

setup the install path to your root fs in busybox menuconfig. and make install, it will copy and 

setup the symlinks. 

add a symlink /init to /sbin/init  for initramfs to work. 

 

and a very simple inittab, 

# startup the file system 

null::sysinit:/bin/mount -t proc proc /proc 

null::sysinit:/bin/mount -t sysfs sysfs /sys 

# busybox console 

::askfirst:/bin/sh 

 

you should be sitting in front of busybox prompt now. 

 

about the apps, i would prefer add them to busybox. 

it saves space and troubles. 

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

--- quote end ---  

 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
967 Views

To create the file system, some reading from the "linux from scratch" will help. 

It is simple, just mkdir of all of them. And copy some of the dev nodes from you linux host. 

Eg, cp -a /dev/console /dev/zero /dev/null .... uc_rootfs/dev 

 

You don&#39;t need the jtag device, because it is registered as "/dev/console". 

 

From boot, the kernel mount initramfs as root, execute /init, which is symlink to /sbin/init, 

and symlink to busybox, it reads /etc/inittab. 

The line in my sample inittab,  

::askfirst:/bin/sh 

execute the /bin/sh on console, and was symlink to busybox (msh). 

 

Freeing unused kernel memory: 272k freed (0x138000 - 0x17b000) 

init started: BusyBox v1.00-pre8 (2005.10.28-01:02+0000) multi-call binary 

Please press Enter to activate this console. 

BusyBox v1.00-pre8 (2005.10.28-01:02+0000) Built-in shell (msh) 

Enter &#39;help&#39; for a list of built-in commands.# ls 

bin etc init mnt proc sbin tmp var 

dev home lib opt root sys usr#  

 

To build busybox, you can use the altera/kits/nios2/examples/softeware/linux/busybox. 

It should the same as marc&#39;s. Do "zip -r and unzip -a" to convert CRLF. 

make menuconfig, make, make install. 

 

I was using marc&#39;s buildroot. I will check if we have to build uclibc before busybox. 

You could also try marc&#39;s page.
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

ya, that&#39;s the busybox I tried building earlier today - I will copy it over to linux just like the kernel tree. So I guess I need to know if I need uclibc also?? ANd when I run make, that make is the host make, not nios2-elf-gcc correct (as in not make ARCH=nios2nommu ...)??  

 

 

--- Quote Start ---  

originally posted by hippo@Nov 28 2005, 09:39 PM 

to create the file system, some reading from the "linux from scratch" will help. 

it is simple, just mkdir of all of them. and copy some of the dev nodes from you linux host. 

eg,  cp -a /dev/console /dev/zero /dev/null  .... uc_rootfs/dev 

 

you don&#39;t need the jtag device, because it is registered as "/dev/console". 

 

from boot, the kernel mount initramfs as root, execute /init, which is symlink to /sbin/init, 

and symlink to busybox, it reads /etc/inittab. 

the line in my sample inittab,  

::askfirst:/bin/sh 

execute the /bin/sh on console, and was symlink to busybox (msh). 

 

freeing unused kernel memory: 272k freed (0x138000 - 0x17b000) 

init started:  busybox v1.00-pre8 (2005.10.28-01:02+0000) multi-call binary 

please press enter to activate this console. 

busybox v1.00-pre8 (2005.10.28-01:02+0000) built-in shell (msh) 

enter &#39;help&#39; for a list of built-in commands.# ls 

bin etc init  mnt proc  sbin  tmp var 

dev home  lib opt root  sys usr#  

 

to build busybox, you can use the altera/kits/nios2/examples/softeware/linux/busybox. 

it should the same as marc&#39;s. do "zip -r and unzip -a" to convert crlf. 

make menuconfig, make, make install. 

 

i was using marc&#39;s buildroot. i will check if we have to build uclibc before busybox. 

you could also try marc&#39;s page. 

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

--- quote end ---  

 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Yes, we need uClibc first. Read the uClibc/INSTALL. I am doing it on a slackware host. 

It is not easy to do it without buildroot.  

 

I have resoled the compile prolem in buildroot, which you had before. 

The kernel header must be set to 2.6.9 in menuconfig. 

I have tested it in slackware 10.2. 

 

After the buildroot done, you can follow the marc&#39;s page to build busybox. 

I have tested the examples/software/linux/busybox, and it works too. 

First copy the config file to .config, edit the paths in Makefile,Rules.mk,  

for $(APP_PLUGIN),$(UCLIBC_PLUGIN), 

just as marc&#39; page said. 

Then make menuconfig, make, make install. 

 

Below is my .config of buildroot, 

# # Automatically generated make config: don&#39;t edit#  

BR2_HAVE_DOT_CONFIG=y# BR2_arm is not set# BR2_armeb is not set# BR2_cris is not set# BR2_i386 is not set# BR2_m68k is not set# BR2_mips is not set# BR2_mipsel is not set 

BR2_nios2=y# BR2_powerpc is not set# BR2_sh is not set# BR2_sparc is not set 

BR2_ARCH="nios2" 

# # Build options#  

BR2_WGET="wget --passive-ftp" 

BR2_SVN="Subversion (svn) checkout command"# BR2_TAR_VERBOSITY is not set 

BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir" 

BR2_JLEVEL=1 

# # Toolchain Options#  

# # Kernel Header Options# # BR2_KERNEL_HEADERS_2_4_25 is not set# BR2_KERNEL_HEADERS_2_4_27 is not set# BR2_KERNEL_HEADERS_2_4_29 is not set 

BR2_KERNEL_HEADERS_2_6_9=y# BR2_KERNEL_HEADERS_2_6_10 is not set# BR2_KERNEL_HEADERS_2_6_11 is not set 

BR2_DEFAULT_KERNEL_HEADERS="2.6.9" 

# # uClibc Options# # BR2_UCLIBC_VERSION_SNAPSHOT is not set# BR2_ENABLE_LOCALE is not set 

# # Binutils Options# # BR2_BINUTILS_VERSION_2_14_90_0_8 is not set 

BR2_BINUTILS_VERSION_2_15=y# BR2_BINUTILS_VERSION_2_15_94_0_2_2 is not set# BR2_BINUTILS_VERSION_2_16 is not set# BR2_BINUTILS_VERSION_2_16_90_0_1 is not set# BR2_BINUTILS_VERSION_2_16_90_0_2 is not set# BR2_BINUTILS_VERSION_2_16_90_0_3 is not set 

BR2_BINUTILS_VERSION="2.15" 

# # Gcc Options# # BR2_GCC_VERSION_3_3_3 is not set# BR2_GCC_VERSION_3_3_5 is not set# BR2_GCC_VERSION_3_4_2 is not set 

BR2_GCC_VERSION_3_4_3=y# BR2_GCC_VERSION_4_0_0 is not set# BR2_GCC_VERSION_4_1_0 is not set 

BR2_GCC_VERSION="3.4.3" 

BR2_GCC_USE_SJLJ_EXCEPTIONS="" 

BR2_EXTRA_GCC_CONFIG_OPTIONS=""# BR2_INSTALL_LIBSTDCPP is not set# BR2_INSTALL_OBJC is not set 

# # Ccache Options#  

BR2_CCACHE=y 

# # Gdb Options# # BR2_PACKAGE_GDB is not set# BR2_PACKAGE_GDB_SERVER is not set# BR2_PACKAGE_GDB_CLIENT is not set 

# # elf2flt#  

BR2_ELF2FLT=y 

# # Common Toolchain Options# # BR2_ENABLE_MULTILIB is not set 

BR2_LARGEFILE=y 

BR2_TARGET_OPTIMIZATION="-Os -pipe" 

# # Package Selection for the target#  

# # The default minimal system# # BR2_PACKAGE_BUSYBOX is not set 

# # The minimum needed to build a uClibc development system# # BR2_PACKAGE_BASH is not set# BR2_PACKAGE_BZIP2 is not set# BR2_PACKAGE_COREUTILS is not set# BR2_PACKAGE_DIFFUTILS is not set# BR2_PACKAGE_ED is not set# BR2_PACKAGE_FINDUTILS is not set# BR2_PACKAGE_FLEX is not set# BR2_PACKAGE_GAWK is not set# BR2_PACKAGE_GCC_TARGET is not set# BR2_PACKAGE_CCACHE_TARGET is not set# BR2_PACKAGE_GREP is not set# BR2_PACKAGE_MAKE is not set# BR2_PACKAGE_PATCH is not set# BR2_PACKAGE_SED is not set# BR2_PACKAGE_TAR is not set 

# # Other stuff# # BR2_PACKAGE_AUTOCONF is not set# BR2_PACKAGE_AUTOMAKE is not set# BR2_PACKAGE_BERKELEYDB is not set# BR2_PACKAGE_BISON is not set# BR2_PACKAGE_BOA is not set# BR2_PACKAGE_CUSTOMIZE is not set# BR2_PACKAGE_ISC_DHCP is not set# BR2_PACKAGE_DIRECTFB is not set# BR2_PACKAGE_DISTCC is not set# BR2_PACKAGE_DNSMASQ is not set# BR2_PACKAGE_DROPBEAR_SSHD is not set# BR2_PACKAGE_E2FSPROGS is not set# BR2_PACKAGE_FAKEROOT is not set# BR2_PACKAGE_FILE is not set# BR2_PACKAGE_FREETYPE is not set# BR2_PACKAGE_GETTEXT is not set# BR2_PACKAGE_GZIP is not set# BR2_PACKAGE_HOSTAP is not set# BR2_PACKAGE_HOTPLUG is not set# BR2_PACKAGE_IPROUTE2 is not set# BR2_PACKAGE_IPTABLES is not set# BR2_PACKAGE_JPEG is not set# BR2_PACKAGE_LESS is not set# BR2_PACKAGE_LIBELF is not set# BR2_PACKAGE_LIBFLOAT is not set# BR2_PACKAGE_LIBGLIB12 is not set# BR2_PACKAGE_LIBMAD is not set# BR2_PACKAGE_LIBPCAP is not set# BR2_PACKAGE_LIBPNG is not set# BR2_PACKAGE_LIBSYSFS is not set# BR2_PACKAGE_LIBTOOL is not set# BR2_PACKAGE_LINKS is not set# BR2_PACKAGE_LRZSZ is not set# BR2_PACKAGE_LTP-TESTSUITE is not set# BR2_PACKAGE_LZO is not set# BR2_PACKAGE_M4 is not set# BR2_PACKAGE_MICROCOM is not set# BR2_PACKAGE_MICROPERL is not set# BR2_PACKAGE_MICROWIN is not set# BR2_PACKAGE_MKDOSFS is not set# BR2_PACKAGE_MPG123 is not set# BR2_PACKAGE_MROUTED is not set# BR2_PACKAGE_MTD is not set# BR2_PACKAGE_NANO is not set# BR2_PACKAGE_NCURSES is not set# BR2_PACKAGE_NETKITBASE is not set# BR2_PACKAGE_NETKITTELNET is not set# BR2_PACKAGE_NETSNMP is not set# BR2_PACKAGE_NEWT is not set# BR2_PACKAGE_NTP is not set# BR2_PACKAGE_OPENSSH is not set# BR2_PACKAGE_OPENSSL is not set# BR2_PACKAGE_OPENVPN is not set# BR2_PACKAGE_PCIUTILS is not set# BR2_PACKAGE_PORTAGE is not set# BR2_PACKAGE_PORTMAP is not set# BR2_PACKAGE_PPPD is not set# BR2_PACKAGE_PROCPS is not set# BR2_PACKAGE_PYTHON is not set# BR2_PACKAGE_RAIDTOOLS is not set# BR2_READLINE is not set# BR2_PACKAGE_RSYNC is not set# BR2_PACKAGE_RXVT is not set# BR2_PACKAGE_SFDISK is not set# BR2_PACKAGE_SLANG is not set# BR2_PACKAGE_SOCAT is not set# BR2_PACKAGE_STRACE is not set# BR2_PACKAGE_TCPDUMP is not set# BR2_PACKAGE_TFTPD is not set# BR2_PACKAGE_TINYLOGIN is not set# BR2_PACKAGE_TINYX is not set# BR2_PACKAGE_TN5250 is not set# BR2_PACKAGE_TTCP is not set# BR2_PACKAGE_UDEV is not set# BR2_PACKAGE_UDHCP is not set# BR2_PACKAGE_UTIL-LINUX is not set# BR2_PACKAGE_VALGRIND is not set# BR2_PACKAGE_VTUN is not set# BR2_PACKAGE_WGET is not set# BR2_PACKAGE_WHICH is not set# BR2_PACKAGE_WIRELESS_TOOLS is not set# BR2_PACKAGE_XORG is not set# BR2_PACKAGE_ZLIB is not set 

# # Target Options# # BR2_TARGET_ROOTFS_CRAMFS is not set# BR2_TARGET_ROOTFS_EXT2 is not set# BR2_TARGET_ROOTFS_JFFS2 is not set# BR2_TARGET_ROOTFS_SQUASHFS is not set# BR2_TARGET_ROOTFS_TAR is not set 

# # Board Support Options#  

# # Generic System Support# # BR2_TARGET_GENERIC_ACCESS_POINT is not set# BR2_TARGET_GENERIC_FIREWALL is not set# BR2_TARGET_GENERIC_DEV_SYSTEM is not set
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Ok - so I built busybox using the examples directory in windows - I just did it in windows for now because I couldn&#39;t get linux working yet. It built fine, and I installed it into a directory in my kernel build tree. so here is what I have: 

 

In /bin I have: 

 

-rwxr-xr-x 1 jdhar vpgrp 259100 2005-11-29 10:21 busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:31 cat -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 chgrp -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 chmod -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 chown -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 cp -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 dd -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 dmesg -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 echo -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 false -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 kill -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 ln -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 ls -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 mkdir -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 mknod -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 more -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 mount -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 msh -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 mv -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 ps -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 pwd -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 rm -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 rmdir -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 sh -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 sync -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 touch -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 true -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:33 umount -> busybox* 

lrwxrwxrwx 1 jdhar vpgrp 7 2005-11-29 10:32 uname -> busybox* 

 

In /dev I have a lot, but some important ones: 

 

@console,c,5,1 

@null,c,1,3 

@ttyJ0,c,232,16 

 

for /sbin, I copied agetty.exe from the IDE to /sbin/agetty: 

 

-rwxr-xr-x 1 jdhar vpgrp 55212 2005-11-28 14:36 agetty* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 fdisk -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 freeramdisk -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 init -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 insmod -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 klogd -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 logread -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:33 lsmod -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:34 pivot_root -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:34 rmmod -> ../bin/busybox* 

lrwxrwxrwx 1 jdhar vpgrp 14 2005-11-29 10:34 syslogd -> ../bin/busybox* 

 

In /, I have a link to /sbin/init 

 

And in /etc, I have two files: inittab and rc.. my inittab is: 

# Startup the file system# null::sysinit:/bin/mount -t proc proc /proc# null::sysinit:/bin/mount -t sysfs sysfs /sys 

::sysinit:/bin/sh /etc/rc 

# busybox console 

ttyJ0::respawn:/sbin/agetty 115200 ttyJ0 

::askfirst:/bin/sh 

 

and /etc/rc is just an echo so I can see something...  

 

I still get the warning - can&#39;t open console message.  

 

Is there any way to see if init is even being called??
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Ok, so here&#39;s some other news... I got buildroot to build with the flags you told me to set. Let me see if I understand this much: 

 

- buildroot generates a toolchain which is basically similar to the toolchain I was using off the NIOS II Linux CD, however, this is nios2-linux-uclibc... and the other was nios2-elf-gcc...?? 

- I can use either to build the kernel the same way I have been doing, it&#39;s just I guess the buildroot toolchain requires an extra step to convert the vmlinux file to a .bin file that can be downloaded??? 

- /buildroot/build_nios2/root <-- this is the root filesystem that I will want initramfs to use?? 

- I should use busybox and set the target to /buildroot/build_nios2/root so it can populate it with applications?? 

- Now busybox requires uclibc... is that something I have to download again, because buildroot already used it, didn&#39;t it? Do I have to setup the environment somehow to know where uclibc is?? 

 

One thing I don&#39;t understand is how the nodes in /dev are created since it doesn&#39;t seem that busybox does that, or buildroot...
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

 

--- Quote Start ---  

originally posted by jdhar@Nov 30 2005, 03:32 AM 

ok, so here&#39;s some other news... i got buildroot to build with the flags you told me to set. let me see if i understand this much: 

 

- buildroot generates a toolchain which is basically similar to the toolchain i was using off the nios ii linux cd, however, this is nios2-linux-uclibc... and the other was nios2-elf-gcc...?? 

--- Quote End ---  

 

Yes, they are the same compiler. Only the default link library differ. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

- I can use either to build the kernel the same way I have been doing, it&#39;s just I guess the buildroot toolchain requires an extra step to convert the vmlinux file to a .bin file that can be downloaded???[/b] 

--- Quote End ---  

 

Yes, you can use either. You can convert a vmlinux, which is an ELF format , to binary for programming the flash with the objcopy command. 

nios2-linux-uclibc-objcopy -O binary vmlinux vmlinux.bin 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

- /buildroot/build_nios2/root <-- this is the root filesystem that I will want initramfs to use??[/b] 

--- Quote End ---  

 

Yes, you should copy them to another place to be used as your root fs. 

Remove usr/include usr/lib to save space. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

- I should use busybox and set the target to /buildroot/build_nios2/root so it can populate it with applications??[/b] 

--- Quote End ---  

 

Yes, "make install" will populate it. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

- Now busybox requires uclibc... is that something I have to download again, because buildroot already used it, didn&#39;t it? Do I have to setup the environment somehow to know where uclibc is??[/b] 

--- Quote End ---  

 

The buildroot builds the uclibc already. So you don&#39;t have to download again. 

 

If you use marc&#39;s patch, update Makefile,Rules.mak, seach barco and change to your staging_dir. 

 

If you use examples///busybox, and the following three line to the beginning of Rules.mak . 

STAGING_DIR = /usr/local/src/buildroot/build_nios2/staging_dir UCLIBC_PLUGIN = $(STAGING_DIR) APP_PLUGIN = $(STAGING_DIR) 

And in staging_dir , add symlink scripts --> lib, 

in staging_dir/bin, add symlink elf2flt --> nios2-linux-uclibc-elf2flt . 

 

Note, you must prepare a initial .config for busybox before menuconfig. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

One thing I don&#39;t understand is how the nodes in /dev are created since it doesn&#39;t seem that busybox does that, or buildroot...[/b] 

--- Quote End ---  

 

Either use "mknod" to create them, or copy them from your Linux host. 

cp -a /dev/zero /dev/null /dev/console  rootfs/dev
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Ok, here&#39;s what I did: 

 

buildroot: 

 

followed the instructions on Marcs page, no problems here, it build the nios2 toolchain in the staging directory along with some sort of root filesystem. I copied this file system to a separate place 

 

busybox: 

 

I used the config file off his home page, modified the patch file to point to my staging directory instead, and compiled - created the busybox executable with no problems. Ran make install and it copied it to my new root fs directory... 

 

I then did the cp -a on all the /dev entries you listed, so those are now in my root directory, and I created the symlink to /sbin/init  

 

I haven&#39;t modified inittab at all since buildroot created this <--- should I do this??? 

 

Kernel: 

 

Built the kernel using the new toolchain this time, not the Nios 2 linux CD one... 

 

And it worked!!! I added the ::askfirst::.. line to inittab, and I got the busybox shell. I&#39;m not sure how others got all of this working in windows, but I&#39;m glad I finally got it in linux... thanks for all your help, I think this thread is definitely big enough! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
0 Kudos
Altera_Forum
Honored Contributor II
967 Views

Great!! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif  

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

I haven&#39;t modified inittab at all since buildroot created this <--- should I do this???[/b] 

--- Quote End ---  

 

You can use this, and add the line of /bin/sh as you already did it. 

 

I would like to invite you to post this as a project on the forum. 

This would be very helpful to those who develope custom boards. 

 

I am working on a PIO based MMC/SD card driver, with my spare time. 

I shall post it as another project when ready.
0 Kudos
Altera_Forum
Honored Contributor II
965 Views

 

--- Quote Start ---  

originally posted by hippo@Nov 30 2005, 01:24 AM 

great!! http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/laugh.gif  

 

<div class='quotetop'>quote  

--- quote end ---  

 

--- quote start ---  

i haven&#39;t modified inittab at all since buildroot created this <--- should i do this??? 

--- Quote End ---  

 

You can use this, and add the line of /bin/sh as you already did it. 

 

I would like to invite you to post this as a project on the forum. 

This would be very helpful to those who develope custom boards. 

 

I am working on a PIO based MMC/SD card driver, with my spare time. 

I shall post it as another project when ready. 

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

[/b] 

--- Quote End ---  

 

 

I take it you are using true MMC mode instead of SPI, which is why you are using PIO? That should be really cool once it is done; I am actually moving away from MMC/SD now to CF just because of lack of driver support http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif Is the driver included in the kernel any good, or does that not even work? 

 

When I&#39;m more comfortable with playing around with the boot process of linux (I have already learnt so much!), I will definitely either post a project or make a sort of extension to Marcs instructions - anyone reading this thread should get all the information they need as I knew nothing when I started, but it would be nice to have it one place!
0 Kudos
Altera_Forum
Honored Contributor II
965 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

I take it you are using true MMC mode instead of SPI, which is why you are using PIO? That should be really cool once it is done; I am actually moving away from MMC/SD now to CF just because of lack of driver support sad.gif Is the driver included in the kernel any good, or does that not even work?[/b] 

--- Quote End ---  

 

 

The mmc interface level drivers included with the kernel are for intel XA and arm, though higher mmc 

level driver are common. We still need a low level MMC interface driver for NIOS2. The SPI driver in the kernel tree did not serve this. I had worked on both MMC/SD protocol and SPI protocol using PIO ports for embeded systems in the past. I am trying to port the drivers to uclinux. We always have limited LE resources on a FPGA, and doing it in software can save some space in hardware. Hardware should be used for speed-critical purpose.
0 Kudos
Reply