Developing a 64 bit kernel module on a 32 bit distro - linux-kernel

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

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.

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!

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.)

Related

Target Platform, All CPU or X86 difference

I am confused what setting of target platform should be chosen to enable my application to run on all computers, regardless of the processor type. I tried All CPU but it did not work on a few computers.
Thanks
The x86 works on 32bit OS as well on 64bit OS, the same for AnyCPU. So what is the difference?
The difference lays in the way the JIT compiler emits the code of your application on the target computer.
When you use x86 platform the code emitted by JIT is always a 32bit code, also on 64bit systems.
This could be a problem if you don't have installed the correct 32 drivers/dll needed by your applications (The Microsoft.ACE.OleDB is one of these problematic libraries).
Conversely, when you use the AnyCPU platform the JIT emits 32bit code on 32bit systems and 64bit code on 64bit systems. And this is more problematic than x86 because you need the correct drivers for both systems. So I suspect that the reason your app fails on some systems is due to the lack of the correct (for the system bitness) libraries used by your app.
In doubt I think is better to use x86 platform unless you have very specific requirements for 64bit systems.

Mac Architecture Questions

Hi everyone :) am a newbie to develop applications for Mac. My questions are regading to different OS architectures in Mac and am greatly confused in this. Kindly bear with me if my questions are very cheap. Thank u all:)
I know that there is 32 bit support for 10.6(SnowLeopard). I would like to know if there is 32 bit support for 10.7(Lion)??
I have a 64 bit machine. I want a 32 bit 10.7 on it. How would i do so??
I have a 32 bit iMac and I have 10.6.8 in it. I have built an application on it; the application uses a user developed library which is also 32 bit. Now I carry on this application to another Mac machine which has 64 bit processor with 10.7(Lion). Will I be able to execute the same application as such in 10.7(Lion)?? I was not able to do so.
OS X uses a binary format that can support multiple architectures (e.g. 32- and 64-bit Intel, as well as PowerPC, etc) in a single executable or library. Most of the binaries and libraries in Lion are dual-architecture 32&64-bit Intel. So, yes, there is 32-bit support in Lion.
There is no such thing as 32-bit Lion; it's a dual-architecture OS. It can boot the kernel in either 32- or 64-bit mode, and run programs in 32- or 64-bit mode. Unlike most other OSes, it can even run programs in 64-bit mode under a 32-bit kernel. Whenever you run a program in Lion, it checks what architectures the program includes and what the CPU is capable of, and picks the "best" mode to run that program in.
There's no obvious reason this shouldn't work. If you were trying to use a 32-bit-only library from a program that was running in 64-bit mode, or a 64-bit-only library from a program running in 32-bit, it would fail. But if the program is 32-bit only it'll obviously run in that mode, your user developed library is 32-bit, and all of the libraries supplied with the OS are 32+64-bit.
There are a few things that might cause your 32-bit program to fail under Lion. First, does it depend on any libraries other than the one you mentioned and those supplied with the OS (e.g. libraries compiled locally by something like MacPorts, Fink, or Homebrew)? If so, those libraries might've been compiled 64-bit only. IMO libraries should always be compiled for all relevant architectures to avoid this sort of problem, but that's not the default.
Another possible source of trouble is if your program isn't really a program, but something that loads into another program (e.g. a plugin of some sort, screensaver, etc). In that case, your plugin needs to support whatever mode the program that'll load it is running in. You can actually get this issue with Java programs, since the java runtime will start in 64-bit mode (when the CPU supports it) in Lion.
Telling us more about your program and what specific error you get would probably help a lot...

Clean get of 32 bit source code onto a 64 bit machine. Precautions?

I'm about to do a clean get of 32 bit source code onto my new Windows 7 64 bit machine. Is there anything special I need to do (switch to 32 bit mode, etc) or will Windows detect this and adapt accordingly?
The "bitness" of the operating system has nothing to do with getting source code. Your IDE determines what the target is of your compile of the source code, and most IDEs now can target either.
In other words, Windows doesn't have to do anything, and neither do you. Your development environment uses the source code, and determines what happens with it. Windows has absolutely nothing to do with it, except to run any resulting executable that's produced if it's compatible with that version of Windows. (And Win64 runs 32-bit applications just fine.)
Just as a note: You can't "switch to 32-bit mode" with a 64-bit operating system. It's always going to be a 64-bit operating system, even if you're running a 32-bit application. The application may not know it's running on a 64-bit OS, but it will be despite it's ignorance of that fact. :)

What do I need to do to install and run Code Sourcery on an x86 64-bit Windows host system?

I have seen this question asked for a Linux host system but not for Windows.
I have a Windows 7 64-bit host system. I am running into a 32 bit issue I think and I see this vague phrase in the Code Sourcery documentation.
"Therefore, even when running on a 64-bit host system, Sourcery CodeBench requires 32-bit host libraries. Consult your operating system documentation for more information about obtaining these libraries."
I can't find any documentation because I don't know what "these" libraries are.
Thanks,
Seth M King
That sentence is really only for Linux users; a lot of Linux distributions don't include the basic system libraries (the equivalent of the stuff in c:\Windows\System) needed to run 32-bit applications.
Windows includes everything that's needed as far as this is concerned.

Is there any way to execute 64-bit programs on a 32-bit computer?

Just a simple question: Is there any way to run a program compiled under a 64 bit Windows environment (with mingw64) on a 32 bit machine? Any DLL or any compatibility layer which I can use?
If you are talking about a 32-bit processor, then no. But if you are running a 32-bit OS on 64-bit hardware, then you can do it with VMWare. A 64-bit guest can run on a 32-bit host, if the hardware supports it.
Bochs should do the trick, but you'd need another copy of Windows to run in the virtual machine. (Some editions of Windows include additional licenses for virtual machines, so you might be in luck.)
Performance would probably be very poor.
No you cannot do this. The other direction is possible through an emulator, e.g. on Windows it is called WOW64.
It is standard practise on platforms that still have large install base of the 32-bit versions of the OS to ship either just a 32-bit version, or both 32- and 64-bit versions.
I can recommend VirtualBox for this purpose, you can download the free version and it's easier to use than VMWare. However you will need a 64bit installation CDROM, and storage space for a full system install, and if you are installing Microsoft Windows they will expect you to pay for a license key.
Also your CPU needs to support both 64 bit mode in the hardware, and the vt-X/AMD-V features (most of them do). It's a bit slower, although mostly that seems to be the display that slows it down, not the internal program calculations. This is NOT an emulation, the CPU is really running native 64 bit, but VirtualBox fakes the hardware devices (display, disk, network, etc) so the result is not as nice as running normally. 3D graphics acceleration is available, but it has limitations.
An easier option is simply to hire an online Virtual Machine by searching for someone offering 64 bit versions of Windows Server (there are plenty). Usually they will offer connection over Remote Desktop, typically you can pay by the month. Upload your programs, run what you want, then delete it when you are finished and cancel the service. The service provider handles installation, licensing, hardware, etc.
hey that was a problem that gave me a headache for a while but i solved it. I had windows 10 32 bit but when i opened system in control panel it said that "32 bit architecture, 64 bit processor." lookup some websites and your hardware must have a few things which you can check in CPU-Z( lookup some webpages for this) its necessary. Then export your folders,documents, softwares in an external hard drive..now download the windows 10 64 bit iso file and boot it.ands viola! you got 64 bit architecture ( i also recommend upgrading ram atleast minimum 4 gb) or the other way is to install 64 bit guest in VMware ir another virtual machine software...gud luck
No, It is not possible...........

Resources