Compiling kernel for NS2

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Compiling kernel for NS2

Post by langerak » Sun Jan 02, 2011 7:54 pm

I am compiling a new kernel for my NS2 with use of my experience based on the old EDMini V2 i still own. I built the kernel using the orion5x_defconfig, altho i don't think the board in the NS2 is supported yet, as i receive this error when i let the NS2 boot this kernel (via TFTP):

Code: Select all

Marvell>> boot
## Booting image at 00800000 ...
   Image Name:   linux
   Created:      2011-01-02  15:49:04 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2854836 Bytes =  2.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...


Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000899).

Available machine support:

ID (hex)        NAME
0000054e        Marvell Orion-2 Development Board
000005e4        Marvell Orion-NAS Reference Design
00000631        Buffalo Linkstation Pro/Live
000005e5        Buffalo/Revogear Kurobox Pro
00000630        Buffalo Terastation Pro II/Live
00000742        Buffalo Linkstation Mini
000007d5        Buffalo Linkstation LS-HGL
00000606        D-Link DNS-323
0000061d        QNAP TS-109/TS-209
00000641        QNAP TS-409
00000661        Linksys WRT350N v2
00000674        Technologic Systems TS-78xx SBC
0000069d        HP Media Vault mv2120
000006dc        LaCie Ethernet Disk mini V2
000008eb        LaCie Big Disk Network
000008ea        LaCie d2 Network
00000926        LaCie 2Big Network
000006e6        Maxtor Shared Storage II
00000709        Netgear WNR854T
00000714        Marvell Orion-VoIP GE Reference Design
0000071a        Marvell Orion-VoIP FXO Reference Design
00000766        Marvell Orion-1-90 AP GE Reference Design

Please check your kernel config and/or bootloader.
Here are the u-boot startupmessages:

Code: Select all

           _           ____ _                                                                                     
          | |    __ _ / ___(_) ___                                                                                
          | |   / _` | |   | |/ _ \                                          
          | |___ (_| | |___| |  __/                                          
          |_____\__,_|\____|_|\___|     
 _   _     ____              _          
| | | |   | __ )  ___   ___ | |_        
| | | |___|  _ \ / _ \ / _ \| __|       
| |_| |___| |_) | (_) | (_) | |_        
 \___/    |____/ \___/ \___/ \__|  ** LOADER **
 ** MARVELL BOARD: ASTON_NS LE 
Hold rear button - short :
Hold rear button - long :  FAIL


U-Boot 1.1.4 (Sep 23 2009 - 10:38:35) Marvell version: 3.4.16  LaCie 1.2.8 256MB

U-Boot code: 00600000 -> 006701D0  BSS: -> 006BDE80

Soc: 88F6281 A0 (DDR2)
CPU running @ 800Mhz L2 running @ 400Mhz
SysClock = 200Mhz , TClock = 166Mhz 

DRAM CAS Latency = 3 tRP = 3 tRAS = 9 tRCD=3
DRAM CS[0] base 0x00000000   size 256MB 
DRAM Total size 256MB  16bit width
[512kB@f8000000] Flash: 512 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done

CPU : Marvell Feroceon (Rev 1)

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Waiting for LUMP (0)

Abort
no lump receive; continuing
However, it shows it's ID, so i guess there is some way to add an identifier for this board in the configs yet i don't know how, that's why i am posting here :). Anyone got an idea to correct this?

BTW, it seems that the serialheader used on the edmini V2 is the same on the NS2, except you need to connect to it much faster and send a break signal to catch the prompt :).

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Sun Jan 02, 2011 8:23 pm

Hmmm, been googling some stuff about that machine ID, it seems that i need the kirkwood_defconfig, so i'll try that tomorrow :).

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Compiling kernel for NS2

Post by fvdw » Sun Jan 02, 2011 11:55 pm

yes its a kirkwood processor inside the nwsp 2
The system board as used in the nws2 is supported in linux kernel

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Mon Jan 03, 2011 10:57 am

I've built the kernel in the morning, i'll try to boot that tonight :). Also got the basic filesystem ready, with Debian Squeeze (armel).

If anyone is interested in my kernel and the root filesystem, let me know, i'll post the links here :). For now my kernel has support for:

- All common filesystems (with NTFS write)

It's only one point, but worth mentioning if you plan to hang disks on the usbport :).

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Compiling kernel for NS2

Post by fvdw » Mon Jan 03, 2011 12:25 pm

Interesting writing support for NTFS, which driver did you use for NTFS ?

The one in the Linux kernel itself will not give write support for NTFS. I know it mentions this in the kernel config but actually it won't support it will always mount it read-only, at least that is my experience.(The last kernel I compiled for ARM was 2.6.33.1)
You will need a driver as provided by Paragon or the NTFS-3G driver. The last one is open source but painfull slow in writing. The paragon driver is a commercial one, you need to pay for it. The paragon driver needs the compiled kernel files to compile a driver for a specific kernel.

sheg
Posts: 27
Joined: Tue Dec 21, 2010 9:20 am

Re: Compiling kernel for NS2

Post by sheg » Mon Jan 03, 2011 1:16 pm

I installed gentoo stage3 in network space 2. I chrooted and installed kernel sources linux-2.6.36-gentoo-r5.

Then I did:
cd /usr/src/linux
make menuconfig
make && make modules_install

In menuconfig I found:

system type ARM Kirkwood
and
CONFIG_MACH_NETSPACE_V2:
Say 'Y' here if you want your kernel to support the LaCie Network Space v2 NAS.


If I am correct to boot the Gentoo system I need to create uImage and place it in /dev/sda8.

I installed Gentoo package dev-embedded/u-boot-tools that has the files:

/etc/fw_env.config
/usr/bin/bmp_logo
/usr/bin/easylogo
/usr/bin/fw_printenv
/usr/bin/fw_setenv -> fw_printenv
/usr/bin/gen_eth_addr
/usr/bin/img2srec
/usr/bin/mkimage

What parameters would you recommend for mkimage?

Also I succeeded in cloning the ns2 to another hard-disk and after installing it to Lacie chassis it is OK.

My plan is to use this spare disk, delete all Lacie stuff, copy the gentoo in it, and boot straight to gentoo.

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Mon Jan 03, 2011 1:18 pm

for mkimage use:

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'NetworkSpace2 Kernel 2.6.37' -d zImage.new uImage

Adjust the settings to your needs, you can replace the kernel image string with your own text and replace the zImage name to your built kernel image.

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Mon Jan 03, 2011 5:42 pm

Ok, i've built the Kirkwood kernel and tried booting it, however, it hangs and i don't know why:

Code: Select all

Marvell>> setenv bootargs console=ttyS0,115200 root=dev/sda1 rw init=/bin/sh
Marvell>> setenv serverip 192.168.0.75
Marvell>> setenv gatewayip 192.168.0.1
Marvell>> setenv ipaddr 192.168.0.76
Marvell>> tftp 00800000 uImage
Using egiga0 device
TFTP from server 192.168.0.75; our IP address is 192.168.0.76
Filename 'uImage'.
Load address: 0x800000
Loading: T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #############################################################
done
Bytes transferred = 2971600 (2d57d0 hex)
Marvell>> bootm
## Booting image at 00800000 ...
   Image Name:   NetworkSpace 2 2.6.37 Kernel
   Created:      2011-01-03  11:04:54 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2971536 Bytes =  2.8 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
I've seen the problem before, but i can't find any info regarding this, anyone got an idea?

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Compiling kernel for NS2

Post by fvdw » Mon Jan 03, 2011 6:24 pm

most of the times this is caused by an not compatible driver / or code used in the kernel.
I don't which config setting you used so difficult to make a geuess why it fails. It seems to halt quite early in the booting process.
Could be also a compiler issue, think you will need to use at least gcc 4.2.0
Maybe you should enable the debugging settings when compiling the kernel to get some more info on why it doesn't run

ps are you cross compiling or compiling the kernel on the ns2 ?
think you are compiling on the ns2 as when cross compiling there is no need to use mkimage, just make uImage would be enough assuming you have copied mkimage to usr/bin of your host PC running the cross compiler
Last edited by fvdw on Mon Jan 03, 2011 6:33 pm, edited 1 time in total.

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Mon Jan 03, 2011 6:29 pm

I left the config default, just built upon kirkwood_defconfig. I am crosscompiling it on a X86 with gcc 4.4.

I'll try the debugging options in menuconfig and see why that fails...

-EDIT-
Added some options regarding the Feroceon core in the NAS, to accept early ARM926, as this one is apparently... I'm now building the new kernel to see what's happening now, on the debugging part, there is basic debugging enabled already.

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Compiling kernel for NS2

Post by fvdw » Mon Jan 03, 2011 6:39 pm

langerak wrote:I left the config default, just built upon kirkwood_defconfig. I am crosscompiling it on a X86 with gcc 4.4.

I'll try the debugging options in menuconfig and see why that fails...
that looks good which tool chain do you use ?
I used for cross compiling a 2.6.33.1 kernel for the nwsp vs 1 the arm-2007q1 cross tool chain, but the nwsp vs 1 is a orion based processor

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Mon Jan 03, 2011 6:41 pm

I use arm-2007q3-53-arm-none-eabi-i686. Used that one on my old Orion (EDMini V2) as well, which was good, so used that one for this kernel / board.

That's right, NS1 is Orion (same as EDMini) and NS2 is Feroceon (Kirkwood).

-EDIT-

Compiled again, still no luck... Google does not know anything about it, only ppl complaining, but no fix... If you have some tips / info, it's appreciated :).

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Compiling kernel for NS2

Post by fvdw » Mon Jan 03, 2011 7:17 pm

very difficult, never cross compiled a kirkwood based kernel myself, does the compiler give any warning ?
you could also try a somewhat older kernel

langerak
Posts: 160
Joined: Sat May 29, 2010 6:37 pm

Re: Compiling kernel for NS2

Post by langerak » Mon Jan 03, 2011 7:21 pm

No, totally nothing, as that would be of structural help :). I'll try a different version tomorrow :), i'll do 2.6.34, as that one worked on my Orion :)

fvdw
Posts: 777
Joined: Wed Mar 18, 2009 11:13 pm

Re: Compiling kernel for NS2

Post by fvdw » Mon Jan 03, 2011 9:22 pm

ok

one question, why recompile the kernel, what do you miss in the current one ?
or is it just for fun ;)

Post Reply