Results 1 to 10 of 10
Hey guys,
I want to start playing around with the linux kernel but I have some questions to get going.
Can I build on windows in cygwin or mingw and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-08-2008 #1Just Joined!
- Join Date
- Dec 2007
- Posts
- 6
Building the kernel - newbie
Hey guys,
I want to start playing around with the linux kernel but I have some questions to get going.
Can I build on windows in cygwin or mingw and then either run through some VMWare? Or just transfer to another computer and boot it from there? Cos I have a linux machine and I have a windows machine, but if I wreck the kernel, which I suspect I will do, then how do I restore my linux system? Thats why I want to do it on my windows system. I am trying to do it through Cygwin but it doesn't understand elf so, I don't know what to do. I have tried mingw but get the same elf issues but I'm told this can act as a cross compiler?
Basically I'm just really looking for some pointers in the right direction. I have tried googling but to no avail (which leads me to believe its not practical - or at least quite difficult)
Thanks,
Stephen
- 03-08-2008 #2
Hi,
You'll still be able to boot up in your old kernel, so if you cock up building your new one, you can boot up the old one and do any repairs you need.Distribution: Archlinux
Processor: 3 x Amd 64 bit
Ram: 4 GB
Graphics card: Nvidia GeForce 9800 GT
- 03-08-2008 #3Just Joined!
- Join Date
- Dec 2007
- Posts
- 6
- 03-08-2008 #4
Building a kernel/modules on one system and then transferring it to another is not recommended for those that are not experienced with it.
If you are building from different sources than your current running kernel is fine. You would normally have a unique entry in your boot loader for your new kernel and you always have the option of loading your original kernel.
If you are building from the same sources as your running kernel then you can append a version to the new kernel.
General setup -> Local version
If you append a local version then your kernel/modules will not conflict with your current kernel.
Men occasionally stumble over the truth,
but most of them pick themselves up
and hurry off as if nothing had happened.
Winston Churchill
... then the Unix-Gods created "man" ...
- 03-08-2008 #5Just Joined!
- Join Date
- Dec 2007
- Posts
- 6
- 03-08-2008 #6
If you're really worried about it, best not do it! Still, the risk is small. I've made loads of mistakes while building my own kernel, but I've always managed to correct them by choosing my previous kernel in the Grub menu. Note, that if you have a graphics card driver installed, you'll be greeted with a black screen and a flashing cursor: you need to re-install this.
Distribution: Archlinux
Processor: 3 x Amd 64 bit
Ram: 4 GB
Graphics card: Nvidia GeForce 9800 GT
- 03-08-2008 #7
Experience through failure .. until success.
If you have any Linux environment ... and kernel sources ... you can build a kernel.
Most modern kernel's are modular. So if you build a kernel for transfer then you must ensure that you transfer the modules that are also created.
If you build a monolithic kernel then there will be no modules.
I will admit I have never done that before.
I have built many kernels on the same system (I am always tweaking kernel parameters), on average I usually have 3 custom kernels I can boot from in my Grub boot loader.
When building a kernel for another system you have to be very sure that you have enabled the options for the system you are transferring to.
Men occasionally stumble over the truth,
but most of them pick themselves up
and hurry off as if nothing had happened.
Winston Churchill
... then the Unix-Gods created "man" ...
- 03-08-2008 #8Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
If you don't want to install linux and boot it, use a VM and install it there. It will be the easiest way.
Mingw can produce win32 objects code on a *nix environment. The opposite is not true. I don't know what are you exactly trying to achieve yet.Cos I have a linux machine and I have a windows machine, but if I wreck the kernel, which I suspect I will do, then how do I restore my linux system? Thats why I want to do it on my windows system. I am trying to do it through Cygwin but it doesn't understand elf so, I don't know what to do. I have tried mingw but get the same elf issues but I'm told this can act as a cross compiler?
To move a kernel from one installation into another shouldn't add much complexity, but there are some things you need to take into account. All the modules and the kernel must have the same magic version number. That means that you'll need to compile any external module that's not into the mainstream kernel on the same machine, with the same compiler and such.
- 03-08-2008 #9
The best place to build kernel source is in your home directory...you only need root privelages to install the kernel.
You are better off NOT using a vm to install the kernel...that will probably just make things harder.
Check out this article: The Kernel Configuration and Build Process
You may also want to check out The Linux Kernel in a Nutshell (oreilly) if your going to get serious
- 03-09-2008 #10I totally agree with this. Every time I build a new kernel this is how I do it. Works a treat!The best place to build kernel source is in your home directoryDistribution: Archlinux
Processor: 3 x Amd 64 bit
Ram: 4 GB
Graphics card: Nvidia GeForce 9800 GT


Reply With Quote

