Forum Discussion
Altera_Forum
Honored Contributor
20 years agoI could only agree that MMU makes the different.
Again the patch to support minx in unified diff. linux-2.6.x/include/asm-nios2nommu/bitops.h--- bitops.h 2005/11/10 06:55:12 1.1
+++ bitops.h 2005/11/10 06:56:58
@@ -469,4 +469,11 @@
# define ext2_find_first_zero_bit find_first_zero_bit
# define ext2_find_next_zero_bit find_next_zero_bit
+/* Bitmap functions for the minix filesystem. */
+#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
+#define minix_set_bit(nr,addr) set_bit(nr,addr)
+#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
+#define minix_test_bit(nr,addr) test_bit(nr,addr)
+#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
+
# endif /* _ASM_NIOS_BITOPS_H */ About the busybox, you can also use the stable release 1.01. http://busybox.net/downloads/busybox-1.01.tar.bz2 (http://busybox.net/downloads/busybox-1.01.tar.bz2) With the patch. --- modutils/insmod.c 2005/12/28 11:32:46 1.1
+++ modutils/insmod.c 2005/12/28 11:33:20
@@ -4022,7 +4022,7 @@
fstat(fd, &st);
len = st.st_size;
- map = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
+ map = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
if (map == MAP_FAILED) {
bb_perror_msg_and_die("cannot mmap `%s'", filename);
}
--- Makefile 2005/12/28 09:14:17 1.1
+++ Makefile 2005/12/28 13:16:09
@@ -123,9 +123,18 @@
include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
-include $(top_builddir)/.depend
-busybox: $(ALL_MAKEFILES) .depend include/config.h $(libraries-y)
+busybox: busybox.elf
+ $(APP_PLUGIN)/bin/elf2flt -s 16000 -o $@ $<
+
+#
+# Make a relocatable ELF file.
+#
+%.elf : %.bin
+ $(LD) -T $(APP_PLUGIN)/scripts/elf2flt.ld -Ur -o $@ $<
+
+busybox.bin: $(ALL_MAKEFILES) .depend include/config.h $(libraries-y)
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
- $(STRIPCMD) $@
+# $(STRIPCMD) $@
busybox.links: $(top_srcdir)/applets/busybox.mkll include/config.h $(top_srcdir)/include/applets.h
- $(SHELL) $^ >$@
@@ -272,7 +281,7 @@
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
docs/busybox.net/BusyBox.html busybox.links libbb/loop.h
- .config.old .hdepend busybox
+ .config.old .hdepend busybox *.bin
- rm -rf _install
- find . -name .\*.flags -exec rm -f {} \;
- find . -name \*.o -exec rm -f {} \;
--- Rules.mak 2005/12/28 09:17:00 1.1
+++ Rules.mak 2005/12/28 13:34:54
@@ -71,12 +71,13 @@
# If you are using Red Hat 6.x with the compatible RPMs (for developing under
# Red Hat 5.x and glibc 2.0) uncomment the following. Be sure to read about
# using the compatible RPMs (compat-*) at http://www.redhat.com !
-#LIBCDIR:=/usr/i386-glibc20-linux
+LIBCDIR?=$(UCLIBC_PLUGIN)
+KERNEL_INCLUDE=$(shell echo $(KERNEL_BUILD_DIRECTORY))/include
#
# For other libraries, you are on your own. But these may (or may not) help...
-#LDFLAGS+=-nostdlib
-#LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
-#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
+LDFLAGS+=-nostdlib -Wl,-r -Wl,-d -L$(LIBCDIR)/lib $(LIBCDIR)/lib/crt0.o
+LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
+CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(KERNEL_INCLUDE) -funsigned-char -iwithprefix include -D__uClinux__
# GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
@@ -96,6 +97,7 @@
-e 's/sh/sh/'
-e 's/mips-.*/mips/'
-e 's/mipsel-.*/mipsel/'
+ -e 's/nios2-.*/nios2nommu/'
-e 's/cris.*/cris/'
)
endif Or use the snapshot. http://busybox.net/downloads/busybox-snapshot.tar.bz2 (http://busybox.net/downloads/busybox-snapshot.tar.bz2) With the patch. --- Makefile 2005/12/27 13:07:23 1.1
+++ Makefile 2005/12/28 14:52:08
@@ -211,9 +211,18 @@
endif# ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
-busybox: .depend $(libraries-y)
+busybox: busybox.elf
+ $(APP_PLUGIN)/bin/elf2flt -s 16000 -o $@ $<
+
+#
+# Make a relocatable ELF file.
+#
+%.elf : %.bin
+ $(LD) -T $(APP_PLUGIN)/scripts/elf2flt.ld -Ur -o $@ $<
+
+busybox.bin: .depend $(libraries-y)
$(CC) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
- $(STRIPCMD) $@
+# $(STRIPCMD) $@
busybox.links: $(top_srcdir)/applets/busybox.mkll include/bb_config.h $(top_srcdir)/include/applets.h
- $(SHELL) $^ >$@
@@ -328,7 +337,7 @@
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
docs/busybox.net/BusyBox.html busybox.links libbb/loop.h
- .config.old busybox
+ .config.old busybox *.bin
- rm -rf _install testsuite/links
- find . -name .\*.flags -exec rm -f {} \;
- find . -name \*.o -exec rm -f {} \;
--- Rules.mak 2005/12/27 12:56:02 1.1
+++ Rules.mak 2005/12/28 14:53:39
@@ -72,12 +72,13 @@
# If you are using Red Hat 6.x with the compatible RPMs (for developing under
# Red Hat 5.x and glibc 2.0) uncomment the following. Be sure to read about
# using the compatible RPMs (compat-*) at http://www.redhat.com !
-#LIBCDIR:=/usr/i386-glibc20-linux
+LIBCDIR?=$(UCLIBC_PLUGIN)
+KERNEL_INCLUDE=$(shell echo $(KERNEL_BUILD_DIRECTORY))/include
#
# For other libraries, you are on your own. But these may (or may not) help...
-#LDFLAGS+=-nostdlib
-#LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
-#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR) -funsigned-char
+LDFLAGS+=-nostdlib -Wl,-r -Wl,-d -L$(LIBCDIR)/lib $(LIBCDIR)/lib/crt0.o
+LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
+CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(KERNEL_INCLUDE) -funsigned-char -iwithprefix include -D__uClinux__
# GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
@@ -103,6 +104,7 @@
-e 's/sh/sh/'
-e 's/mips-.*/mips/'
-e 's/mipsel-.*/mipsel/'
+ -e 's/nios2-.*/nios2nommu/'
-e 's/cris.*/cris/'
)
endif The .config must has, ## Build Options#
CONFIG_STATIC=y
CONFIG_LFS=y
USING_CROSS_COMPILER=y
CROSS_COMPILER_PREFIX="nios2-elf-"
EXTRA_CFLAGS_OPTIONS="-Dfork=vfork"
# # Installation Options# # CONFIG_INSTALL_NO_USR is not set
PREFIX="/usr/local/src/nios2/build/rootfs" Then build, make UCLIBC_PLUGIN=/usr/local/nios2-elf APP_PLUGIN=/usr/local/nios2-elf KERNEL_BUILD_DIRECTORY=/usr/local/src/nios2/build/kernel menuconfig
make UCLIBC_PLUGIN=/usr/local/nios2-elf APP_PLUGIN=/usr/local/nios2-elf KERNEL_BUILD_DIRECTORY=/usr/local/src/nios2/build/kernel
make UCLIBC_PLUGIN=/usr/local/nios2-elf APP_PLUGIN=/usr/local/nios2-elf KERNEL_BUILD_DIRECTORY=/usr/local/src/nios2/build/kernel install