Tuesday, March 20, 2007

Linux Kernel on Gumstix and i386

Had a few problems getting the Gumstix kernel to compile on an i386 based machine. I imported the entire Gumstix kernel tree into a subversion repository first then checked it out on my laptop. Then I removed the .config file from the subversion repository as this would obviously be set up for an ARM architecture, and replaced it with another .config from a Linux 2.6.20 kernel I had previously compiled on that machine. I thought this would be enough to compile the gumstix kernel on i386 as it changed the processor types etc, but alas it didn't work.

I got a load of errors when running make on the new kernel config such as :

include/asm/system.h:189:5: warning: "__LINUS_ARM_ARCH__" is not defined
include/asm/glue.h:110:2: error: #error Unknown data abort handler type


Obviously a problem with it trying to compile some of the arm asm stuff when I was trying to compile for i386. After a bit of digging I found that include/asm was a symlink to asm-arm so I have deleted this symlink from the svn repository and replaced it locally with a symlink to arm-i386. The kernel is currently compiling so hopefully this has done the trick, time will tel.....

Monday, March 19, 2007

Byte Order

For a while now I've been running some code I wrote in the FreeBSD kernel that has been returning stupid values for the sizes of packets when I print out the payload length field from the ip6_hdr struct as any ipv6 packet leaves the system. Every time I was getting stupid values such as 4096 for a 16 Byte payload, I had a quick think about it at the time and couldn't figure it out. Of course, it is ridiculously stupid now I've thought about it again, and also ridiculously obvious.

NETWORK BYTE ORDER AND HOST BYTE ORDER ARE DIFFERENT.

Hopefully putting this post on here should stop me making the same stupidly obvious mistake in the future, the ntohs() and htons() functions are there for a damn good reason, use them, I am now getting the correct output values on the original FreeBSD code and on my new Linux code. F'ing idiot.....

Friday, March 16, 2007

Birthday

Another year older, not much wiser though I fear.

Got to finish off a draft of this paper with Matt F then it's off to the pub around four o'clock for a nice long drinking session with a load of mates, see you in a bit Jimbo, put your foot down...

Thursday, March 15, 2007

MIPv6 and Gumstix

I've been trying to compile MIPv6 today for use on the gumstix. I compiled MIPv6 support into the 2.6.20 kernel that the latest version of the gumstix buildroot uses and that all worked fine.

I then tried to download the latest user space tool and cross compile that using the command :

./configure --build=i686-pc-linux-uclibc --host=arm-linux --target=arm-linux CPPFLAGS="-i/home/r0ute/phd/gumstix/br/gumstix-buildroot/
build_arm_nofpu/linux-2.6.20gum/include"


this chucks out the error :

checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.


So I checked config.log to find out that the arm gcc compiler doesn't recognise the CPPFLAGS option, I then tried without that and it says the Linux headers don't have MIPv6 support enabled, I think I might have to somehow point it to the headers for the gumstix, either that or the user space tool I am using is only compatible with the patches that they supply themselves and not ther version of MIPv6 shipped with the kernel, the error in config.log from what I can tell is here :

conftest.c:61: error: 'RTPROT_MIP' undeclared (first use in this function)

Will have to come back to this when I have more time however, this paper is needing to be done, as well as the NP++ implementation.

Tuesday, March 13, 2007

Been a while

Been a while since I last posted anything but decided to post a bit more hopefully, mostly with bits about my work to help me out in the future.

IPv6 and Gumstix
-------------------------------------------------------------------------------

This took me a while to sort out but I have finally worked out how to get IPv6 working on Gumstix, as usual, it is not actually that difficult, just a pain in the ass having to do it all from basically no documentation, and of course me making stupid mistakes. Anyway, the steps needed to do it can be found here :

Gumstix and IPv6

On to writing the actual NP++ code inside the Linux kernel now, hopefully won't be too hard to port over from FreeBSD.