views:

89

answers:

3

My development machine has a 64 bit proc, running a 32 bit distribution. I would like to compile and test a kernel module with a 64 bit kernel. My question is :

  • Is there a 64 bit liveCD with kernel development package included ?

  • If it does not exist, How can I build a module for a 64 bit kernel ? Then I can eventually test it with a liveCD

A: 

http://www.ubuntu.com/desktop/get-ubuntu/download has links for 64-bit download, and the "make USB on windows" option includes screenshots showing how to make a bootable 64-bit ubuntu USB memory stick. (None of the other options in the {CD, USB} x {Windows, Mac, Ubuntu} instructions mention anything about only working for x86 vs x86-64.)

sarnold
I know there are tons of liveCD, I am looking for CD with kernel-devel packages included
shodanex
Ah, `apt-get build-dep linux-image-server` probably would require a ton of RAM...
sarnold
+2  A: 

You can install a 64-bit VM on a 32-bit operating system, provided the CPU supports it. I know this is possible with VMWare, don't know about anything else.

If you're doing any system development nowadays, I'd say use a VM, regardless of the target platform. Just use a VM.

MarkR
There are other VM to be used on Linux: I use qemu (kvm-qemu) which is integrated in the Linux kernel, and VirtualBox works too.+1 for 'Just use a VM', even if this is much more complex if you are writing a driver for real hardware!
Didier Trosset
If writing a driver for real hardware, if it's USB you can "pass through" the USB to a VM guest. Otherwise, you're probably out of luck and need real tin. However in this instance, I would have several machines - do not run your editor and test the kernel on the same real box.
MarkR
It is for USB. Which VM have this pass through options ?
shodanex
VirtualBox certainly has a USB pass through
stsquad
It seems USB performance when running as a pass through is different, since our hardware does not work (yet). Not enough bandwith I guess
shodanex
+1  A: 

It might be more technical than you would want to try, but, if you can get a 64bit toolchain installed, you should be able to compile the kernel through:

make ARCH=amd64 CROSS_COMPILE=x86_64-pc-linux-gnu- menuconfig

You should be able to boot your regular 32bit userland with a 64bit kernel (if you select the appropriate binary compatibility options)

Cheers!

qdot