LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   modifying the original Linux kernel, say 2.6.34, to make it running as OS (https://www.linuxquestions.org/questions/linux-kernel-70/modifying-the-original-linux-kernel-say-2-6-34-to-make-it-running-as-os-811624/)

aarsh 06-01-2010 11:43 PM

modifying the original Linux kernel, say 2.6.34, to make it running as OS
 
How can I modify the original Linux kernel, say 2.6.34, to make it running as my OS ? (ACTUALLY IN VIRTUAL BOX


please note that :
------------------

1. I AM NOT ASKING YOU HOW TO USE VITUAL BOX. I KNOW IT. BUT I'VE WRITTEN IN THE QUESTION, JUST TO BE CLEAR.

2. I AM NOT ASKING TO SIMPLY UPGRADE MY KERNEL. RATHER, I WANT THE LINUX KERNEL TO WORK AS MY OS.

3. I DON'T BOTHER ABOUT COMMAND LINE OR GUI. ALL THAT I WANT IS TO JUST MAKE THE KERNEL RUNNING.

XavierP 06-02-2010 04:49 AM

You can't. Hence the whole GNU/Linux thing - Linus created the kernel and needed a toolset to turn it into an OS. GNU had a toolset and needed a kernel. Have a look at the LFS Book, there are a set of very basic tools you need to make the kernel boot - once it has booted you will have an extremely minimal system.

aarsh 06-03-2010 09:28 AM

thank you brother for your kind help.

but a doubt is there..
what was there in the first original linux then?
was it not an independent OS ?

aarsh 06-03-2010 09:34 AM

Quote:

Originally Posted by XavierP (Post 3989800)
You can't. Hence the whole GNU/Linux thing - Linus created the kernel and needed a toolset to turn it into an OS. GNU had a toolset and needed a kernel. Have a look at the LFS Book, there are a set of very basic tools you need to make the kernel boot - once it has booted you will have an extremely minimal system.

okay .. so what is that toolset ?? can you please explain a little bit ??

XavierP 06-03-2010 09:52 AM

In my sig, there is a link to a chart showing all the Linux distros and where they came from. Get it here: http://futurist.se/gldt/wp-content/uploads/gldt1005.png

The toolset is everything that is not the kernel. Read up on the history here: http://en.wikipedia.org/wiki/History_of_Linux and here: https://netfiles.uiuc.edu/rhasan/linux/

HasC 06-03-2010 09:53 AM

http://en.wikipedia.org/wiki/GNU/Linux
Read the history bit.
http://en.wikipedia.org/wiki/History_of_Linux

theNbomr 06-03-2010 01:24 PM

Quote:

Originally Posted by aarsh (Post 3989572)
How can I modify the original Linux kernel, say 2.6.34, to make it running as my OS ?

2. I AM NOT ASKING TO SIMPLY UPGRADE MY KERNEL. RATHER, I WANT THE LINUX KERNEL TO WORK AS MY OS.

This is sounding like a question of semantics. Perhaps you could tell us what you mean by 'OS'? The strict definition that most pedants would use is that the kernel IS the OS.
Given that, the method of getting the kernel 'working' is to launch it with a bootloader such as LILO, Grub, or PXE. But I don't think this is really what you are asking. Or is it?

--- rod.

XavierP 06-03-2010 03:09 PM

I read it as he wants to run only the kernel - no other programs. AFAIK, that won't work, you need a minimal set of programs to do this.

theNbomr 06-03-2010 05:11 PM

That seems like a reasonable interpretation. The last selection in the poll makes me think he is confused about what a kernel is. Making a new kernel does not produce a drastically different distro.
--- rod.

aarsh 06-07-2010 06:16 AM

@ theNbomr:

thanks for your kind help. I know that only kernel is not sufficient to make any os to run but i am talking about the custom as well as minimized os (having grub boot loader and all other 'MUST' components ).. which just loads the core component of the linux kernel. and i wanted to ask the same in the polls to find people like me.

theNbomr 06-07-2010 11:52 AM

I don't know of what value your extreme minimalist configuration would be, but as I see it, you could easily set up a bootloader to launch an arbitrary kernel, and pass as the init process, only a simple do-nothing program. To test how this might go, simply boot almost any system that uses grub, and at the boot prompt, enter edit mode. Edit the command line, replacing the 'init=' argument with 'init=/bin/bash'. When it boots, you will have an almost-minimal OS with only a running kernel and a shell. This is basically single-user mode.
There are toolkits available that provide a means to produce a minimal, or however complex distro you require. One that I have tried is buildroot, which perhaps would be useful to you.

--- rod.

aarsh 06-07-2010 10:52 PM

can you tell me specifically that what to do to attach grub code to Linux kernel ?
I am a rally newbie and don't know what to do after downloading the source code of GRUB and Linux kernel :-(

hda7 06-15-2010 04:13 PM

Quote:

Originally Posted by aarsh (Post 3996116)
can you tell me specifically that what to do to attach grub code to Linux kernel ?
I am a rally newbie and don't know what to do after downloading the source code of GRUB and Linux kernel :-(

Well, after you build the kernel and grub, you'll want to install grub to a device (say a hard drive). I usually install grub like this (use your device instead of hda1):
Code:

mount /dev/hda1 /mnt/hda1
grub-install --root-directory=/mnt/hda1 /dev/hda1

After the install, look for a folder on your device (usually boot/grub/) that contains the grub files. A file menu.lst should contain something like this:
Code:

title Your Linux Distro Name
rootnoverify (hd0,0) # (hd0,0) is the grub name for hda1. (hd1,2) would be hdb3, etc.
kernel /path/to/kernel/on/device
initrd /path/to/initrd # If necessary.

If you can find the grub manual you can probably find more information.
Then just make sure your device has the boot flag set (see man fdisk), check, check, and check again, and then reboot.

theNbomr 06-15-2010 05:41 PM

You are presently running some distribution. Look in grub.conf (may be called menu.lst), probably located in /boot and see how it is done there. Of course, in your minimalist setup, you won't want to run init, but something much smaller.

--- rod.

esm_menc 06-25-2010 05:55 PM

Voted for kUbuntu but..
 
Although I use kUbuntu, Most of my other PC's are using "slitaz (installed)".


All times are GMT -5. The time now is 06:53 AM.