LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   compile kernel for x86_64 (http://www.linuxquestions.org/questions/slackware-14/compile-kernel-for-x86_64-a-675364/)

henkees 10-09-2008 02:41 PM

compile kernel for x86_64
 
I have an Intel dual core (64bits) computer and I have some experience with kernel compiling. I have a very simple -maybe very stupid- question:

Is it possible to install or compile the kernel for x86_64, so that the kernel is 64 bits and that it can support 32bits applications?

I searched and searched but can't find a good answer. I found something that you first must compile gcc for 64 bits, but how to do that, no idea...
(I don't even know if it is really possible...)
The only thing I found via google is that it is very tricky(?)

Can someone help me out of my dreams, or maybe... give the solution.

(I work of course with slackware (the real one, 32 bits)

Thanks in advance.

estabroo 10-09-2008 03:00 PM

Its easiest just to install a 64bit OS and then install the 32bit compatibility libraries for running the 32bit stuff.

henkees 10-09-2008 03:17 PM

I must say that I also work with Suse (64 bits), but I like Slack more because it's "clear and simple".
I have several times compiled the kernel so that it's quite small and it loads just what is needed for my hardware.
I can say it is quite fast for 32 bits now!

I have read that it could be possible to compile a kernel 64 bits on a 32 bits system with a gcc compiler that supports 64bits.
IF it is possible, then the system would get a little bit faster... IS it possible? How? Or is this really difficult stuff?
Thanks anyway!

T3slider 10-09-2008 09:06 PM

If you want a 64-bit Slackware with 32-bit compatibility, give Slamd64 a try. Bluewhite64 is a 64-bit port (if you can call it a port -- it differs from Slackware quite a bit), but WITHOUT 32-bit compatibility (as far as I know -- though this may have changed as of late). Slamd64 is more similar to a direct 64-bit port (and some prefer it for political reasons -- do a search if you want more information about that), and if I were to switch, that's the distro I would use. Slamd64 does seem to get updated a lot slower than Bluewhite64, though. However, regular 32-bit Slackware works fine for me without any 32-bit compatibility issues (for obvious reasons), so I see no need to switch -- yet.

As for compiling 64-bit stuff, if you do need a 64-bit gcc etc., you would need to do the circular copmilation technique, as far as I know -- but I haven't played with this stuff so I am probably dead wrong. If you do need to build circularly, it's a lot of effort.

gnashley 10-10-2008 02:08 AM

The kernel doesn't care whether applications are 32 bit or 64 bit. The applications depend on whether glibc is 32bit or 64bit. Since the kernel doesn't need or use any external libs, it doesn't care.
Creating a 64bit system is whole 'nother matter. but if all you want is 64bit optimization for your kernel, just select the appropriate arch and recompile.

H_TeXMeX_H 10-10-2008 04:18 AM

I don't think there's much use in compiling a 64-bit kernel for a 32-bit system. Just install slamd64, it's an unofficial port of Slackware to 64-bit with multilib support, meaning it can run 32-bit apps too.

Petri Kaukasoina 10-10-2008 11:10 AM

I run a x86_64 kernel on my pentium 4 with Slackware-current (normal 32-bit userspace). I just build the kernel on another system (x86_64 Centos). CONFIG_IA32_EMULATION=y is needed in the kernel config.

Maybe its merits are questionable but at least no HIMEM is needed: all memory is readily accessible with 64 address bits. I also installed a 64-bit version of Matlab (plus some 64-bit shared libraries for Matlab in /lib64 which I copied from Centos). And, some number crunching fortran and C programs were a bit faster (6-11 %) as x86_64 binaries vs. x86_32.

henkees 10-10-2008 02:36 PM

Thanks for all the answers!
It's getting more clear to me.
I'll try kernel compiling with 64bits arch supporting. I want to stay on Slack and not to go to Slamd64, because Slamd64 gave me some problems with the Intel processor. (I never buy an Intel anymore, but that's an other story...)
Thanks again, greetings, Henkees.


All times are GMT -5. The time now is 07:52 AM.