LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 10-16-2004, 07:33 PM   #1
sibtay
Member
 
Registered: Aug 2004
Location: U.S
Distribution: Ubuntu
Posts: 145

Rep: Reputation: 15
Loading kernel into memory


Hello

i am trying to make a linux distro.
For that i need to build an installer. my idea is to run a very basic (low foot print) kernel, run bash on top of it and then run the install scripts that i have created.

The kernel image will be present on some external storage media like cd, floppy or usb and therefore would have to be loaded in the memory first.

How can i achieve this.

My question is "how can i load the image of a kernel from an external storage device to the RAM" without using grub or LILO

Or in other words i want to create a boot disk that would load the kernel image in the memory (and do some other stuff which i'll ask later)

thank you
 
Old 10-17-2004, 05:34 PM   #2
CloudBuilder
Member
 
Registered: May 2003
Location: Netherlands
Distribution: Ubuntu, Puppy
Posts: 386

Rep: Reputation: 30
There is a lot of stuff about that .

Google for>>> life CD>>> or Knoppix>>> or look at linux-live.org

Normally those live cd's put everything in memory by an emulated disk in memory.

CloudBuilder
 
Old 10-18-2004, 03:37 AM   #3
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
You are going to need to compile in support for RAMdisks and an initial RAMdisk (initrd).

As for booting it, I would say using SYSLINUX/ISOLINUX, depending on what media you are booting from (floppy or CD).
 
Old 10-22-2004, 12:08 PM   #4
sibtay
Member
 
Registered: Aug 2004
Location: U.S
Distribution: Ubuntu
Posts: 145

Original Poster
Rep: Reputation: 15
Hi MS3FGX
where can i find information related to this thing SYSLINUX/ISOLINUX
 
Old 10-23-2004, 08:58 PM   #5
Kye
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
would love to know how to install linux onto a laptop with no cd rom, can I go through a network some how?, how do I get the net work if that is the case, running first from dos with no OS on it yet?

Network dos drivers boot disk?
 
Old 10-24-2004, 06:40 AM   #6
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Quote:
Originally posted by Kye
would love to know how to install linux onto a laptop with no cd rom, can I go through a network some how?, how do I get the net work if that is the case, running first from dos with no OS on it yet?

Network dos drivers boot disk?
Most distributions allow for installing over the network quite easily. Some are in fact a lot easier to use that way (Debian, Gentoo).

Read the installation instructions for the distribution you are interested in. Usually the only thing you will have to do manually is to create the boot floppies from image files.


Håk
 
Old 10-24-2004, 08:06 AM   #7
CloudBuilder
Member
 
Registered: May 2003
Location: Netherlands
Distribution: Ubuntu, Puppy
Posts: 386

Rep: Reputation: 30
Quote:
Originally posted by Kye
would love to know how to install linux onto a laptop with no cd rom, can I go through a network some how?, how do I get the net work if that is the case, running first from dos with no OS on it yet?

Network dos drivers boot disk?
In case of Suse they have in install from their own network. You have to load their disk and then you can get the full os.

CloudBuilder
 
Old 10-31-2004, 12:44 PM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Post

Quote:
Originally posted by sibtay
Hello

i am trying to make a linux distro.
For that i need to build an installer. my idea is to run a very basic (low foot print) kernel, run bash on top of it and then run the install scripts that i have created.

The kernel image will be present on some external storage media like cd, floppy or usb and therefore would have to be loaded in the memory first.

How can i achieve this.

My question is "how can i load the image of a kernel from an external storage device to the RAM" without using grub or LILO

Or in other words i want to create a boot disk that would load the kernel image in the memory (and do some other stuff which i'll ask later)

thank you
basically, to do this from cd you need three things on the cd:

- isolinux

- a ramdisk image

- a kernel



isolinux will make the cd bootable... it will boot the kernel and load the ramdisk image...

the ramdisk image needs only to contain a basic linux system... you could go for something like busybox (which is a VERY small system) or just install whatever you need in there...


here's a rough outline of the BASIC steps needed to make a bootable linux ramdisk cd, AFAIK:


# make a directory to create the cd:

mkdir /tmp/livecd


# make a directory called "isolinux" and one called "kernels" in there...

mkdir /tmp/livecd/isolinux

mkdir /tmp/livecd/kernels



# download the latest isolinux package from http://www.kernel.org/pub/linux/utils/boot/syslinux/ and unpack it...
# basically, you just need the isolinux.bin file...

cd /tmp

wget http://www.kernel.org/pub/linux/util...ux-2.11.tar.gz

tar -xzf syslinux-2.11.tar.gz

cd syslinux-2.11

cp isolinux.bin /tmp/livecd/isolinux



# now place a kernel in the kernel dir:

cp /example/bzImage /tmp/livecd/kernels/bare.i


# now take care of the ramdisk... create and format an image like this:
# this example makes a 16MB ramdisk image file...

dd if=/dev/zero of=/tmp/ramdisk.img bs=1k count=16384

mkfs.ext2 -F -m 0 /tmp/ramdisk.img



# now mount the ramdisk image and install your basic system into it:

mount -o loop /tmp/ramdisk.img /mnt/ramdisk

# this is how you'd install your packages using your ramdisk image as root on slackware,
# it'll be different on other distros, but you get the idea:

cd /wherever_your_packages_are

installpkg -root /mnt/ramdisk *.tgz


# in your case, remember to install your installation scripts and stuff... the actual packages and stuff
# that your end-users will be installing obviously doesn't need to go in this ramdisk, though...

# edit whatever else you need to edit in the ramdisk image, like /etc/fstab, which will
# need to have a line like this, indicating the root system should be the ramdisk:

Code:
/dev/ram0        /                ext2        defaults         0   0

# when you're done tweaking the ramdisk image's system run ldconfig through it:

ldconfig -r /mnt/ramdisk


# you can then unmount the ramdisk image

umount /mnt/ramdisk


# now compress the ramdisk image:

cd /tmp

gzip -9 ramdisk.img



# now place it in the isolinux dir:

mv /tmp/ramdisk.img.gz /tmp/livecd/isolinux/ramdisk.img


### so now your /tmp/livecd/isolinux directory contains the isolinux.bin
### and ramdisk.img files, while the /tmp/livecd/kernels dir contains
### your kernel...


# the only file you're missing now is an isolinux.cfg file...

touch /tmp/livecd/isolinux/isolinux.cfg


# open it up with vi or something

vi /tmp/livecd/isolinux/isolinux.cfg


and make it look somewhat like this (EXAMPLE):

Code:
default /kernels/bare.i initrd=ramdisk.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=16384 rw root=/dev/ram
prompt 0

# once that's done, you're ready to create an ISO image which you can then burn to a cd:

cd /tmp/livecd

mkisofs -o /tmp/livecd.iso -R -J -hide-rr-moved -v -d -N \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b isolinux/isolinux.bin -c isolinux/isolinux.boot .



your ramdisk-based linux cd iso image is now ready in /tmp/livecd.iso!!

=)

Last edited by win32sux; 11-06-2004 at 06:28 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Loading Program Into Memory Kumarrrr Mandriva 2 07-31-2005 05:18 AM
Mandrake Hangs on Loading Program into memory. anon111 Linux - Newbie 2 10-28-2004 07:31 AM
Saving and loading objects with dynamic memory to file (C++) - how? MadCactus Programming 3 08-08-2004 03:26 PM
Loading modules error after loading compiled kernel td0l2 Linux - Newbie 12 07-28-2004 11:10 AM
Installation freezes when loading program to memory supreme_command Mandriva 2 02-24-2004 09:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration