DISCLAIMER: this installation procedure is provided "as is" with no guarantees.Author: loic Cuvillon (loic AT eavr.u-strasbg.fr).
Derivative work from 'nxtOSEK installation in Windows' page. The contributor is not affiliate with the nxtOSEK project.

1. Build and Install GNU ARM

GNU ARM is a distribution of GCC (GNU Compiler Collection) for ARM core and it supports the ARM7 CPU inside the NXT.

The complete process should take at least half an hour and finish with the message "Build complete !".

If everything went well, binary executables (helloworld.rxe) and program upload scripts should be generated in the directory.

Note: the option -Wno-inline can be added to
CFLAGS and CXXFLAGS in the file ecrobot/tool_gcc.mak to remove all
warnings about inline functions

3. Install the Enhanced NXT firmware on NXT

nxtOSEK
supports three ways to upload a programm to the NXT and those are designed
for different purposes. Each way requires installation of different
software. Each way has pros and cons and it is strongly recommend to use
John Hansen's Enhanced NXT firmware because it provides same GUI as the
standard LEGO firmware and other programming languages (i.e. NXT-G,
NBC/NXC) also can be used without replacing the firmware.
See the corresponding section in the Windows installation for more information on the 2 other ways.

Installation of the Enhanced NXT firmware is a one time
procedure and may be safer under windows (but until now, the author
never has troubles with firmware update and find it is easier under
Linux).

a.Installation of the Enhanced NXT firmware for windows

Download LEGO MINDSTORMS NXT Driver v1.02 from LEGO software update website
and execute setup.exe to install the driver along with instruction.
During the installation, installer adds a USB driver to a Windows
system directory, thus you need to provide an administrator right to
your user account before installing the driver.

Note
that if LEGO standard programming software was already installed in the
PC, there is no need to install LEGO MINDSTORMS NXT Driver.

Download John Hansen's (for windows) NeXTTool archive and extract it. NeXTTool is a console program and enables uploading of .rxe and .rfw files to the NXT.

Download John Hansen's Enhanced NXT firmware
(any version numbered 106 or later) and store the Enhanced NXT firmware
(lms_arm_nbcnxc_1xx.rfw ) to the directory where NeXTTool.exe is
stored.

Open a command Prompt – go to Start => Run =>
and then type “cmd”. Use the command "cd" to go in the directory where
NeXTTool.exe is stored.

Connect the NXT brick to the USB port and turn it on

To install the firmware, type the command below, where
“lms_arm_nbcnxc_1xx.rfw” is the filename that you downloaded previously.

nexttool /COM=usb -firmware=lms_arm_nbcnxc_1xx.rfw

Troubleshooting: After completion of the upload,
sometimes NXT display is messed and block : reboot it by a quick push
on reset button (see below) or remove the battery. If the NXT makes a
ticking sound, it is still in firmware upload mode.

To check that the firmware version of the NXT has changed to 1.xx, type:

nexttool /COM=usb -versions

Protocol version = 1.124
Firmware version = 1.xx

b.Installation of the Enhanced NXT firmware for Linux

Note: Nextool binary for Linux seems to fail for firmware upload.

Install required packages:

~$ sudo apt-get install scons libusb-dev libusb-0.1-4

Download the libnxt archive and extract it. Go in the new directory and build the project with scons:

~$ cd libnxt-0.3/ ~$ scons

A program call fwflash is created.

Download John Hansen's Enhanced NXT firmware
(any version numbered 106 or later includes the native-invocation
feature) and store the Enhanced NXT firmware (i.e
lms_arm_nbcnxc_1xx.rfw) in the directory where fwflash is stored.

Connect the NXT brick to usb and turn it on. Then
press the reset button for more than 4s to put it in firmware upload
mode (nxt display is cleared but it makes a ticking sound).

Flash the firmware with the following command (it takes some dozen of seconds), where 1xx is replaced by the number of the firmware:

~$ sudo ./fwflash lms_arm_nbcnxc_1xx.rfw

Troubleshooting: After completion of the upload,
sometimes NXT display is messed and block : reboot it by a quick push
on the reset button or remove the battery. If the NXT makes a ticking
sound, it is still in firmware upload mode. If troubles, use and see
windows firmware update procedure (and LEGO UserGuide).

4. Setup nxtOSEK program upload software with enhanced firmware

a.NeXTTool (building from source)

Required Packages: libusb-0.1-4 libusb-dev fpc

~$ sudo apt-get install libusb-dev libusb-0.1-4 subversion fpc

Note: fpc is the free pascal compiler

Download John Hansen's NeXTTool source from
bricxcc repository. Revision 1 is known to work for usb and bluetooth
(but last revision may also work even if there seems to be troubles
with bluetooth) :

Optionnal 1: To upload over usb without being a
priviledge user or To upload over bluetooth, you need to configure udev
and define an alias name in a file 'nxt.dat' as explained in this post:
Minsdtorm 2.0 development on linux . Then turn on the NXT and run the following command (example: helloword_OSEK.rxe) :

Optionnal 2: Building of nbc/nxc assembler/NX C
compiler for NXT from brixcc directory (cd NXT; make -f nbcunix.mak).
Please refer to this nice blog page on Minsdtorm 2.0 development on linux if you want to go further.

To upload over bluetooth, you need to define an alias name in a file 'nxt.dat' as explained in this post: Minsdtorm 2.0 development on linux . Then turn on the NXT and run the following command (example: helloword_OSEK.rxe) :