Compiling custom kernel for rt2500


Forum: Networking
Topic: Compiling custom kernel for rt2500
started by: quirky

Posted by quirky on Jan. 11 2006,13:24
Hi,

DSL works great on my aging 64Mb 450Mhz laptop - I was really surprised 1. that it ran at all 2. how well it did run! far better than the HD installed Redmondware. The one problem is with the wireless network card: I have a ralink chipset card and my wireless network uses WPA. Now, this card has GPL'd drivers (rt2500) that work fine once set up, but they are completely incompatible with DSL's SMP-enabled kernel. insmod'ing the rt2500 module is ok, but when you ifconfig an IP address to the network interface you get a system hang. It is a known problem, even on single CPU/non hyperthreaded machines, and the only solution is to use a kernel without SMP. Because of this, I'd really like to compile a DSL kernel configured without SMP (the target machine is single CPU anyway).

I've followed the various knoppix remastering howtos and have been able to reproduce a regular remastered DSL iso with minor changes. I've downloaded the DSL 2.4.31 kernel source and dsl.config. So now I've got my chroot'd "master" environment with the kernel sources in /usr/src as expected. The questions I have are:

1. How do I install gcc-2.95, make, etc into this chroot environment? Do I have to physically download more stuff from the net or can I use .dsl files that come included in the dsl-2.0.iso? I'm a bit confused about .dsl vs .deb in DSL actually (my other machine has Ubuntu installed, so I understand deb files ok, .dsl is a bit of a mystery)

2. Do I have to compile from within DSL or can I do it from a different distribution? My guess is that it doesn't matter, as long as I compile with DSL's gcc-2.95.

3. What would be the steps to compile the kernel? Obviously there'd be Apply Knoppix patch, Use "make menuconfig" to remove SMP support, but what would come next? "make all"? What files would be generated and where would they go?

I've compiled my own custom 2.6.14 Ubuntu kernel using the Debian make-kpkg utility, so I know the basics. But make-kpkg hides the details of where kernel modules need to go and so on - it just produces a new linux_image.deb file that you can install with dpkg. e.g. do I have to regenerate any other files manually?

Perhaps all this would be easier with a HD install, but I've been told that I can't install Linux on the target laptop, despite the stability problems Win98 gives. My plan is to use DSL, use 'ssh -X' to connect to my Ubuntu PC and use the laptop as a kind of thin client, and a remastered live CD would do the trick. Plus it sounds cool "Oh, yeah, I use DSL with a custom kernel..." :)

thanks in advance!

Posted by quirky on Jan. 12 2006,07:50
Well, I guess no one knows! However here are some answers:

A .dsl file is simply a gzipped tar file (tar.gz) renamed to .dsl. So installation is as easy as "tar xzvf whatever.dsl". Mystery solved :)

gcc-2.95 is no longer supplied in DSL (as far as I can tell), instead we get tcc by default and gcc 3.3 can be downloaded from the mydsl mirrors. This probably means that the DSL documentation needs updating.

In addition to the compiler change, I needed libncurses and -dev, and gnu-utils. Also from mydsl.

The 2.4.31 kernel seems to compile fine with gcc 3.3, providing you undo the part of the Knoppix patch that hardcodes gcc-2.95 into the Makefile. Perhaps it will cause problems later, I'll see, but I hope not since I am recompiling all the modules with 3.3 too. I followed the distro-independent kernel compile HOWTO without problems, this answered my other questions. The isolinux "stuff" is regenerated when one remasters the iso, it seems. Hopefully that means the new kernel image and modules will go where they are supposed to. ???

Oh, and I had no trouble compiling from within the chroot environment in Ubuntu - it let me connect to the net too without problems. This is very handy, as I could wget the required software.

I'll update with more info when I've finished + tested it. If it works.

Posted by tempestuous on Jan. 12 2006,09:16
Quite a few wifi problems have been reported under DSL2+.  This is the first time someone has suggested a specific kernel configuration which might be at fault.
I will mention this issue in the "DSL Ideas and Suggestions" forum.

Posted by quirky on Jan. 13 2006,18:56
I first noticed it with Ubuntu's 686-smp kernel and reported this bug:
< http://bugzilla.ubuntu.com/show_bug.cgi?id=21485 >

Also, Suse don't provide the rt2500.ko for their SMP kernel.

When it happened with DSL, I assumed it was 'detecting' the hyper threading processesor, until I tried it on my old laptop which is a PII (I think). The real "fix" would be for some hero to fix the rt2500 drivers, but that seems unlikely to happen.

I'm now sorting out the final few hitches in my remastering. I'm getting kernel panics atm  :(

Posted by quirky on Jan. 13 2006,21:30
It worked!

I'm posting this from my remastered non-SMP DSL :)

Posted by paku on Jan. 14 2006,08:08
Quote (Guest @ Jan. 13 2006,16:30)
It worked!

I'm posting this from my remastered non-SMP DSL :)




Thats fine thing you get the card to function  Do you want to help me too so i get my card to function. I have the same card like you with the same problem that you had before.

Posted by starcannon on Jan. 15 2006,21:46
Yes please a detailed step by step of what you did would be very nice, i to run an rt2500 based wifi and can not get it running on anything past dsl 1.5.

Thanks
Rob

Posted by paku on Jan. 18 2006,12:51
Now i have compailed the kernel for the Rt2500 wireless card. I removed the SMP. And the kernel are running OK. But now it come with the other problem. The ndiswrapper dont funktion anymore. Must I do a new ndiswrapper install, I tried that, but with no succeed. It gave otput like this when gave command make:


winnt_types.h:358: warning: unnamed struct/union that defines no instances
winnt_types.h:364: warning: unnamed struct/union that defines no instances
winnt_types.h:380: warning: malformed `#pragma pack'
winnt_types.h:380: warning: ignoring pragma: )
winnt_types.h:393: warning: malformed `#pragma pack'
winnt_types.h:393: warning: ignoring pragma: )
winnt_types.h:632: warning: malformed `#pragma pack'
winnt_types.h:632: warning: ignoring pragma: )
winnt_types.h:675: warning: malformed `#pragma pack'
winnt_types.h:675: warning: ignoring pragma: )
winnt_types.h:696: warning: malformed `#pragma pack'
winnt_types.h:696: warning: ignoring pragma: )
winnt_types.h:765: warning: malformed `#pragma pack'
winnt_types.h:765: warning: ignoring pragma: )
winnt_types.h:854: warning: unnamed struct/union that defines no instances
winnt_types.h:855: warning: unnamed struct/union that defines no instances
winnt_types.h:864: warning: unnamed struct/union that defines no instances
winnt_types.h:865: warning: unnamed struct/union that defines no instances
winnt_types.h: In function `IoCopyCurrentIrpStackLocationToNext':
winnt_types.h:904: structure has no member named `current_stack_location'
winnt_types.h:906: structure has no member named `current_stack_location'
winnt_types.h:906: structure has no member named `current_stack_location'
winnt_types.h: In function `IoSetCompletionRoutine':
winnt_types.h:914: structure has no member named `current_stack_location'
winnt_types.h: At top level:
winnt_types.h:965: warning: unnamed struct/union that defines no instances
In file included from hal.c:24:
ntoskernel.h:472: warning: unnamed struct/union that defines no instances
ntoskernel.h:510: warning: unnamed struct/union that defines no instances
ntoskernel.h:513: warning: unnamed struct/union that defines no instances
make[1]: *** [hal.o] Error 1
make[1]: Leaving directory `/home/dsl/DOWNLOADS/ndiswrapper-1.8/driver'
make: *** [all] Error 2

Should someone be friendly and give me some instruction to what do next so I can get dsl 2.1 to funktion with Rr2500 wireless card.

Posted by tempestuous on Jan. 18 2006,13:32
Don't use ndiswrapper.  The aim of the modified kernel was to get the native-Linux Ralink driver working -
< http://damnsmalllinux.org/cgi-bin....t=10369 >
It's here - < http://distro.ibiblio.org/pub....ndidate >

Posted by paku on Jan. 18 2006,14:16
Thanks for replay. I downloade the rt2500.o and run the comand

sudo insmod rt2500.o, but error came with this output

dsl@box:~/DOWNLOADS$ sudo insmod rt2500.o
rt2500.o: unresolved symbol del_timer_sync

Posted by paku on Jan. 18 2006,15:41
:)  :)  

Thanks to all who helpped me out in to the real world with Rt2500 wireless card.
It funktion now, and very good. I had to compaile the Rt2500 from the source. Should I put a little step by step guide of how I made it to work on laptop tecra 8100 with 256ram....but you now the proces already.

Posted by tempestuous on Jan. 18 2006,22:11
... of course.  The rt2500 module needed to be recompiled against the modified kernel.
I'm sure others in the DSL community would like to have your new kernel and rt2500 module.

Posted by paku on Jan. 19 2006,11:12
This is what i did so i get the rt2500.o to funktion in dsl 2.1.

How  did  I made the Rt2500 (Ralink)Wireless card  funktion in DSL.
1. Asked lot of things in DSL forum.
2. Installed DSL to the hard disk.  
3. Then I used the program on desktop MyDSL and installed gcc1.dsl.info (I did  not share if it needed) and then libncurses5.dev.dsl.info and gnu-utils.info
4. Then I installed Synaptic.
5. Opened terminal and run:
sudo apt-get install gcc patch
6. Then downloaded kernel sources linux-2.4.31.tar.gz and dsl.config and knoppix-kernel.patch from
< http://distro.ibiblio.org/pub....sources >
7. Then  I packed up the kernel source   tar -xzvf linux-2.4.31.tar.gz
8. Changed to the new folder linux-2.4.31 and copy the knoppix-kernel.patch to the same folder.
9. Run command :  make menuconfig. Scrolled down and gave the other config file, the path to dsl.config (that i downloade)
10. Then  I removed the SMP and added APIC
11. Then exit the program and it asked if I wanted to save the new config file (yes).
12. Then I gave the patch command
patch -p1 -d linux-2.4.31 <knoppix.patch
13. Then command make dep
14. After that I wanted to  give a name to the new kernel, I opened with emelfm the kernel source folder and opened the file Makefile. And there is text EXTRAVERSION= here  your name for the kernel. Save and exit.
15. Give command make bzImage (remeber that you mast be in the same folder all the time)
16. Then command make modules  
17. sudo make modules_install ( I had to use sudo)
18. Then sudo make install.



19. Then program emelfm (super user) and go to /boot/grub/menu.lst
edit the file menu.lst so you can see the new kernel in grub list. Give it a new  title and the name of the new kernel you gave.  (Ex of mine: title DSL Pakun kernel
kernel /boot/vmlinuz-2.4.31paku root=/dev/hda2 quiet vga=791 nodma noscsi frugal)
20. Then Rebot and when you come to the group  menu take the new one and so it go.
____
  Rt2500 driver
1. Download rt2500 from
< http://rt2x00.serialmonkey.com/wiki/index.php/Downloads >  (there is a link to the  sourceforge,klick on that and download the driver from the green link and from there take the rt2500.
2.Packed up with command tar -xzvf rt2500-1.0.0.tar.gz
3. Change in to new directory /Module and give command make config and it will ask you some question and give what it want an go an to the next command  make all.
4. The driver  are somewhere  in the  kernel source directory or  Module directory (the file is rt2500.o)
5. Then sudo insmod rt2500.o then it install the module (lsmod you can se it have been installed) and go to System-Net setup-iwconfig and do the rest of your configs.

You can then put it to start automatically  after every boot so you don’t need to insmod after every loggin and so to the iwconfig script to.


...i hope I did not forget noting.

Posted by polo_step on Feb. 02 2006,04:15
I'm very happy to see people are working on getting the RT2500 working in DSL.  I have a new notebook with this wireless card built in and I would REALLY love to be able to use it with my DSL thumbdrive system so that I may employ DSL as a serious OS for my purposes.

Unfortunately, I am not expert enough with Linux yet to be confident in my understanding of the thread so far, but if this mod is incorporated into the next release of DSL, I'll be in business. :)

There are lots of these devices out there.

Posted by dare2dreamer on Feb. 02 2006,10:21
Couple of thoughts...

1. DSL 2.2 is slated to go back to the 2.4.26 kernel. Any chance of you building your driver for that kernel?

2. Have you seen the open source project wiki?
< http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page >

I've used this driver under Ubuntu, and it's rock solid under a 2.6 kernel.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.