Nut/OS development on Red Hat Enterprise Linux 4 (RHEL4)


Computerwise, I grew up on the command lines of various proprietary Operating Systems of Mini- and Microcomputers (someone remembering these terms?) during the late 70s and 80s. During the nineties, Windows started to spoil me. Professionally, I came never near Unix or Linux.

Recently, I decided to give it a try. This is a short summary of the outcome...

I started by installing a trial version of VMware Workstation 5.5 on my Windows/XP SP2 machine and installed RHEL4 as a Guest Operating System. Getting RHEL4 to work was not hard, but (as I learned later) it was imporant to select some optional RPM packages to be included: GTK and GTK_devel.

Using VMware has - among other things - the advantage of being able to save the "virtual disk" by simply copying and zipping it. This way, it is easily possible to revert back to previous states, which proved important due to the errors a ran into.

I used the documents Installing on Debian and the Installing on SuSE from the Ethernut web site as a reference, and that helped enormously!

First, I downloaded the following files:

Downloaded Files

At the RPM Search Engine I found the RPM packages, the gz and bz2 came from their respective "home"-pages.

Next, I unzipped the .gz archives (leaving Ethernut-403.tar.bz2 alone) just by clicking on them and created their directories under "/".
Then I started a terminal window, (here comes the command line again) and executed their "./configure", "make" and "make install" commands.
On a previous attempt, I tried to use RPMs for LUA and wxGTK, but this ended up in various error messages when installing Ethernut SW.

After installing wxGTK the various library files ended up in the directory "/wxGTK-2.6.2/lib"

wxGTK Files

Now was the time to install the RPM packages avr-binutils, avr-gcc and avr-libc. This went smooth without any hickups.

Next was installing Ethernut. After unzipping Ethernut-4.0.3.tar.bz" I found out that all files were located in the "Ethernut-4.0.3" directory, and there was no "nut" directory I was used to (when using Ethernut-403.exe under Windows). So I created a "nut" directory and moved all files and directories into it.

Then I used a shell window to run Ethernut's "./configure", "make" and "make install". On previous tries, this step failed when I used a LUA RPM (which was installed just by clicking on it without any compiles to be executed) instead of the gz archive.

The last problem was nutconf complaining not finding wxGTK libraries in "/usr/X11R6/lib".
So I create symbolic links in "/usr/X11R6/lib" to the wxGTK libraries in "/wxGTK-2.6.2/lib".
There my be another way resolving this (path or libpath setting?) but at least this worked for me.

Symbolic Links

Then I ran "ldconfig", which lasted just some seconds and terminated without any message.

nutconf started successfully but could not find "/Ethernut-4.0.3/nut/nut/conf/repository.nut". Why "....nut/nut..."? I still don't know. I terminated nutconf, restarted it and selected "ethernut21b.conf" in the "File Open" dialog, and it did it!

Now I wanted to see if I could compile Nut/OS and Nut/NET libraries and entered the settings as described in the Ethernut Software Manual. Finally clicking "Build" was the ultimate goal of all those steps.

Nutconf Window

These are the messages from nutconf's output window:

22:07:15: Nut/OS Configurator Version 1.2.3
22:07:15: Linked to wxWidgets 2.6.2
22:07:15: Running on Linux 2.6.9-5.EL i686
22:07:16: Failed to load help file
22:07:39: Loading /ethernut-4.0.3/nut/conf/repository.nut
22:07:39: Loading /ethernut-4.0.3/nut/conf/ethernut21b.conf
22:07:39: OK
22:19:49: Creating Makefiles for avr-gcc in /ethernut-4.0.3/nutbld
22:19:49: Creating header files in /ethernut-4.0.3/nutbld
22:19:49: OK
22:19:52: ----- Running 'make clean' -----
22:19:59: ----- 'make clean' terminated successfully -----
22:19:59: ----- Running 'make all' -----
avr-ar: creating libnutarch.a
avr-ar: creating libnutos.a
avr-ar: creating libnutdev.a
avr-ar: creating libnutc.a
avr-ar: creating libnutcrt.a
avr-ar: creating libnutnet.a
avr-ar: creating libnutpro.a
avr-ar: creating libnutfs.a
make[1]: avr-g++: Kommando nicht gefunden
make[1]: *** [nutcpp.o] Fehler 127
make: *** [all] Fehler 2
22:20:51: ----- 'make all' failed with error 2 -----
22:22:56: ----- Running 'make install' -----
make[1]: avr-g++: Kommando nicht gefunden
make[1]: *** [nutcpp.o] Fehler 127
make: *** [install] Fehler 2
22:23:02: ----- 'make install' failed with error 2 -----
22:25:44: Copying samples from /ethernut-4.0.3/nut/app to /ethernut-4.0.3/nut/nutapp
22:25:44: Creating Makefiles for avr-gcc in /ethernut-4.0.3/nut/nutapp
22:25:44: OK

I dont know the reason for the avr-g++: Kommando nicht gefunden (command not found) and the following "Fehler 127" (error 127) yet.

Still being curious, I logged into the sample directory of "httpd":


[root@localhost ethernut-4.0.3]# cd nut
[root@localhost nut]# cd nutapp
[root@localhost nutapp]# cd httpd
[root@localhost httpd]# ls
httpserv.c Makefile sample
[root@localhost httpd]# make
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall -Wstrict-prototypes -Wa,-ahlms=httpserv.lst -DETHERNUT2 -D__HARVARD_ARCH__ -I/ethernut-4.0.3/nutbld/include -I/ethernut-4.0.3/nut/include httpserv.c -o httpserv.o
httpserv.c: In function `ShowSockets':
httpserv.c:341: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:344: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:347: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:350: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:353: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:356: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:359: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:362: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:365: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:368: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:371: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
httpserv.c:374: Warnung: Zuweisung streicht Qualifizierer von Zeiger-Zieltypen
crurom -r -ourom.c sample avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall -Wstrict-prototypes -Wa,-ahlms=urom.lst -DETHERNUT2 -D__HARVARD_ARCH__ -I/ethernut-4.0.3/nutbld/include -I/ethernut-4.0.3/nut/include urom.c -o urom.o
avr-gcc httpserv.o urom.o -mmcu=atmega128 -Wl,--defsym=main=0,-Map=httpserv.map,--cref -L/ethernut-4.0.3/nutbld/lib /ethernut-4.0.3/nutbld/lib/nutinit.o -lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs -lnutcrt -o httpserv.elf
avr-objcopy -R .eeprom -O ihex httpserv.elf httpserv.hex rm httpserv.elf
[root@localhost httpd]# ls
httpserv.c httpserv.lst httpserv.o sample urom.lst
httpserv.hex httpserv.map Makefile urom.c urom.o
[root@localhost httpd]# ls -l
insgesamt 1536
-rw-r--r-- 1 root root 19507 18. Mär 22:25 httpserv.c
-rw-r--r-- 1 root root 226266 18. Mär 22:35 httpserv.hex
-rw-r--r-- 1 root root 66512 18. Mär 22:35 httpserv.lst
-rw-r--r-- 1 root root 149925 18. Mär 22:35 httpserv.map
-rw-r--r-- 1 root root 11364 18. Mär 22:35 httpserv.o
-rw-r--r-- 1 root root 3539 18. Mär 22:25 Makefile
drwxr-xr-x 3 root root 4096 18. Mär 22:25 sample
-rw-r--r-- 1 root root 134975 18. Mär 22:35 urom.c
-rw-r--r-- 1 root root 895997 18. Mär 22:35 urom.lst
-rw-r--r-- 1 root root 28296 18. Mär 22:35 urom.o
[root@localhost httpd]#


I did not have an Ethernut board at hand, so I still have to try the download of the code to see if it's working.

That's all, Folks!

Valid HTML 4.01 Transitional