linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bootable CD idea
@ 2003-04-30 11:54 John Bradford
  2003-04-30 12:21 ` Richard B. Johnson
  0 siblings, 1 reply; 10+ messages in thread
From: John Bradford @ 2003-04-30 11:54 UTC (permalink / raw)
  To: linux-kernel

Just a random idea that occurred to me...

Since the El-Torito bootable CD standard supports multiple floppy
images on a single CD, it would be possible to write a script that
takes a .config file, and the source to, say all the -pre and -rc
versions of a particular kernel, compiles multiple kernels with the
same .config, and writes a CD with them all on, set to boot from an
arbitrary disk partition.

It would make:

> > > Foo doesn't work in -rc2
> > Did it work in -rc1
> Not sure

E-Mail exchanges a thing of the past.

Note, that as each floppy image is separate, it's not the same as
trying to cram multiple kernels on a 2.88 MB floppy image, and is
therefore actually do-able :-).

John.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 11:54 Bootable CD idea John Bradford
@ 2003-04-30 12:21 ` Richard B. Johnson
  2003-04-30 12:41   ` John Bradford
  0 siblings, 1 reply; 10+ messages in thread
From: Richard B. Johnson @ 2003-04-30 12:21 UTC (permalink / raw)
  To: John Bradford; +Cc: linux-kernel

On Wed, 30 Apr 2003, John Bradford wrote:

> Just a random idea that occurred to me...
>
> Since the El-Torito bootable CD standard supports multiple floppy
> images on a single CD, it would be possible to write a script that
> takes a .config file, and the source to, say all the -pre and -rc
> versions of a particular kernel, compiles multiple kernels with the
> same .config, and writes a CD with them all on, set to boot from an
> arbitrary disk partition.
>
> It would make:
>
> > > > Foo doesn't work in -rc2
> > > Did it work in -rc1
> > Not sure
>
> E-Mail exchanges a thing of the past.
>
> Note, that as each floppy image is separate, it's not the same as
> trying to cram multiple kernels on a 2.88 MB floppy image, and is
> therefore actually do-able :-).
>
> John.

Well, it's a boot-loader problem that has to be solved in one
of the boot-loader programs like grub or lilo. When booting a
CD, the BIOS is made to 'think' that a CD is a floppy. It
loads the boot-record and jumps to its code. From that point
on, whatever happens is based upon how, what, and where the
boot record and subsequent code executes. With the large
data space available, you could certainly have multiple
operating systems. It's simply a coding problem. If you
want to modify one of the existing boot-loader programs
let me know. I may be able to help, and certainly can test.

FYI I have a bootable CR/ROM (who doesn't), that contains
a limited root file-system with ramdisks that mount on
/tmp and /var. I use this to boot any linux machine and
repair it. It would be nice to be able to select different
operating system versions as well.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 12:21 ` Richard B. Johnson
@ 2003-04-30 12:41   ` John Bradford
  2003-04-30 13:14     ` Tomas Szepe
  2003-04-30 13:47     ` Tigran Aivazian
  0 siblings, 2 replies; 10+ messages in thread
From: John Bradford @ 2003-04-30 12:41 UTC (permalink / raw)
  To: root; +Cc: John Bradford, linux-kernel

> > Just a random idea that occurred to me...
> >
> > Since the El-Torito bootable CD standard supports multiple floppy
> > images on a single CD, it would be possible to write a script that
> > takes a .config file, and the source to, say all the -pre and -rc
> > versions of a particular kernel, compiles multiple kernels with the
> > same .config, and writes a CD with them all on, set to boot from an
> > arbitrary disk partition.
> >
> > It would make:
> >
> > > > > Foo doesn't work in -rc2
> > > > Did it work in -rc1
> > > Not sure
> >
> > E-Mail exchanges a thing of the past.
> >
> > Note, that as each floppy image is separate, it's not the same as
> > trying to cram multiple kernels on a 2.88 MB floppy image, and is
> > therefore actually do-able :-).
> >
> > John.
> 
> Well, it's a boot-loader problem that has to be solved in one
> of the boot-loader programs like grub or lilo. When booting a
> CD, the BIOS is made to 'think' that a CD is a floppy. It
> loads the boot-record and jumps to its code. From that point
> on, whatever happens is based upon how, what, and where the
> boot record and subsequent code executes. With the large
> data space available, you could certainly have multiple
> operating systems. It's simply a coding problem. If you
> want to modify one of the existing boot-loader programs
> let me know. I may be able to help, and certainly can test.

I didn't think we'd need to modify anything - the BIOS lets us choose
the floppy image we want, so each image only needs to contain a
bootloader[1], and a kernel.  The root filesystem doesn't need to be
on the CD - if the disk is to be used for quickly visiting another
kernel to see if something breaks, you'd want your normal root
filesystem.  If you set the root filesystem to /dev/fd0, you can
actually use a real floppy, as the kernel bypasses the BIOS floppy
emulation :-).  So, you can boot from a CD, and use a floppy that
you've prepared separately as your root filesystem.

Were you suggesting that we could have the root filesystem as a set of
blocks on the CD, which are accessed directly, and not via El-Torito
floppy emulation?  That would be pretty useful.  Heh, initial ram disk
on a CD would be even better...

[1] I originally thought that the 2.4 kernel's in-built floppy
bootloader used BIOS calls to access the disk, and that a 2.4 kernel
image as the El-Torito boot image would work, as the kernel would be
accessing the emulated disk, but it didn't seem to when I tried it
just now - it failed with an error saying something along the lines of
it had run out of data to decompress.

> FYI I have a bootable CR/ROM (who doesn't), that contains
> a limited root file-system with ramdisks that mount on
> /tmp and /var. I use this to boot any linux machine and
> repair it. It would be nice to be able to select different
> operating system versions as well.

Yeah, maybe I was just being lazy, but I imagined something like:

make allprepatches 

running the same config through 2.4.21-pre1 to -pre7, and -rc1, and
writing a CD that boots and gives you a menu to select from.

Kind of like make bzdisk, but for 2003 instead of 1991 :-).

I mean, if we're killing of the in-kernel bootloader in 2.5, why not?

John.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 12:41   ` John Bradford
@ 2003-04-30 13:14     ` Tomas Szepe
  2003-04-30 13:46       ` John Bradford
  2003-04-30 13:47     ` Tigran Aivazian
  1 sibling, 1 reply; 10+ messages in thread
From: Tomas Szepe @ 2003-04-30 13:14 UTC (permalink / raw)
  To: John Bradford; +Cc: root, linux-kernel

> [john@grabjohn.com]
> 
> I didn't think we'd need to modify anything - the BIOS lets us choose
> the floppy image we want, so each image only needs to contain a
> bootloader[1], and a kernel.

Why not use isolinux[1] to boot however many images you feel like booting?

-- 
Tomas Szepe <szepe@pinerecords.com>

[1] http://syslinux.zytor.com/iso.php

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 13:47     ` Tigran Aivazian
@ 2003-04-30 13:25       ` John Bradford
  2003-04-30 18:57         ` H. Peter Anvin
  0 siblings, 1 reply; 10+ messages in thread
From: John Bradford @ 2003-04-30 13:25 UTC (permalink / raw)
  To: Tigran Aivazian; +Cc: John Bradford, root, linux-kernel

> > [1] I originally thought that the 2.4 kernel's in-built floppy
> > bootloader used BIOS calls to access the disk, and that a 2.4 kernel
> > image as the El-Torito boot image would work, as the kernel would be
> > accessing the emulated disk, but it didn't seem to when I tried it
> > just now - it failed with an error saying something along the lines of
> > it had run out of data to decompress.
> 
> when you did "make bzImage", are you sure you didn't get the message about 
> the kernel being too big for floppy booting?

No, I've just checked - the same kernel image boots fine from a real floppy.

The CD image just gives:

Loading ...........................
Uncompressing Linux ...

Ran out of input data

--- System halted

Looking at bootsect.S, I am suprised it doesn't work, as it's done via
Int 0x13, so I can't see why it doesn't see the BIOS-emulated floppy
correctly.

John.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 13:14     ` Tomas Szepe
@ 2003-04-30 13:46       ` John Bradford
  0 siblings, 0 replies; 10+ messages in thread
From: John Bradford @ 2003-04-30 13:46 UTC (permalink / raw)
  To: Tomas Szepe; +Cc: John Bradford, root, linux-kernel

> > I didn't think we'd need to modify anything - the BIOS lets us choose
> > the floppy image we want, so each image only needs to contain a
> > bootloader[1], and a kernel.
> 
> Why not use isolinux[1] to boot however many images you feel like booting?

Good point :-)

John.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 12:41   ` John Bradford
  2003-04-30 13:14     ` Tomas Szepe
@ 2003-04-30 13:47     ` Tigran Aivazian
  2003-04-30 13:25       ` John Bradford
  1 sibling, 1 reply; 10+ messages in thread
From: Tigran Aivazian @ 2003-04-30 13:47 UTC (permalink / raw)
  To: John Bradford; +Cc: root, linux-kernel

On Wed, 30 Apr 2003, John Bradford wrote:
> [1] I originally thought that the 2.4 kernel's in-built floppy
> bootloader used BIOS calls to access the disk, and that a 2.4 kernel
> image as the El-Torito boot image would work, as the kernel would be
> accessing the emulated disk, but it didn't seem to when I tried it
> just now - it failed with an error saying something along the lines of
> it had run out of data to decompress.

when you did "make bzImage", are you sure you didn't get the message about 
the kernel being too big for floppy booting?

Regards
Tigran


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 13:25       ` John Bradford
@ 2003-04-30 18:57         ` H. Peter Anvin
  2003-04-30 19:21           ` John Bradford
  0 siblings, 1 reply; 10+ messages in thread
From: H. Peter Anvin @ 2003-04-30 18:57 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <200304301325.h3UDPtla000141@81-2-122-30.bradfords.org.uk>
By author:    John Bradford <john@grabjohn.com>
In newsgroup: linux.dev.kernel
>
> > > [1] I originally thought that the 2.4 kernel's in-built floppy
> > > bootloader used BIOS calls to access the disk, and that a 2.4 kernel
> > > image as the El-Torito boot image would work, as the kernel would be
> > > accessing the emulated disk, but it didn't seem to when I tried it
> > > just now - it failed with an error saying something along the lines of
> > > it had run out of data to decompress.
> > 
> > when you did "make bzImage", are you sure you didn't get the message about 
> > the kernel being too big for floppy booting?
> 
> No, I've just checked - the same kernel image boots fine from a real floppy.
> 

The boot sector bootloader is broken for anything but genuine legacy
floppies, because it relies on getting the proper sector not found in
order to determine the geometry.  Most LBA<->CHS conversions -- and
that includes El Torito, IDE floppies, USB floppies, and just about
anything else that isn't a classical legacy floppy -- simply spill
into the next track, confusing bootsect.S.  This is part of why
bootsect.S is gone in 2.5.

	-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 18:57         ` H. Peter Anvin
@ 2003-04-30 19:21           ` John Bradford
  2003-04-30 21:18             ` H. Peter Anvin
  0 siblings, 1 reply; 10+ messages in thread
From: John Bradford @ 2003-04-30 19:21 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

> > > > [1] I originally thought that the 2.4 kernel's in-built floppy
> > > > bootloader used BIOS calls to access the disk, and that a 2.4 kernel
> > > > image as the El-Torito boot image would work, as the kernel would be
> > > > accessing the emulated disk, but it didn't seem to when I tried it
> > > > just now - it failed with an error saying something along the lines of
> > > > it had run out of data to decompress.
> > > 
> > > when you did "make bzImage", are you sure you didn't get the message about 
> > > the kernel being too big for floppy booting?
> > 
> > No, I've just checked - the same kernel image boots fine from a real floppy.
> > 
> 
> The boot sector bootloader is broken for anything but genuine legacy
> floppies, because it relies on getting the proper sector not found in
> order to determine the geometry.  Most LBA<->CHS conversions -- and
> that includes El Torito, IDE floppies, USB floppies, and just about
> anything else that isn't a classical legacy floppy -- simply spill
> into the next track, confusing bootsect.S.  This is part of why
> bootsect.S is gone in 2.5.

Ah, it makes more sense now :-).  So, could I bodge 2.4 in to working
by modifying bootsect.S with something like this?


        movw    $disksizes+1, %si         # Force 18 sectors/track
probe_loop:
        lodsb
        cbtw                            # extend to word
        xchgw   %cx, %ax                # %cx = track and sector
        xorw    %dx, %dx                # drive 0, head 0
        movw    $0x0200, %bx            # address = 512, in INITSEG (%es = %cs)
        movw    $0x0201, %ax            # service 2, 1 sector
        int     $0x13
        movb    $0x03, %ah              # read cursor pos
        xorb    %bh, %bh

John.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bootable CD idea
  2003-04-30 19:21           ` John Bradford
@ 2003-04-30 21:18             ` H. Peter Anvin
  0 siblings, 0 replies; 10+ messages in thread
From: H. Peter Anvin @ 2003-04-30 21:18 UTC (permalink / raw)
  To: John Bradford; +Cc: linux-kernel

John Bradford wrote:
> 
> Ah, it makes more sense now :-).  So, could I bodge 2.4 in to working
> by modifying bootsect.S with something like this?
> 
> 
>         movw    $disksizes+1, %si         # Force 18 sectors/track
> probe_loop:
>         lodsb
>         cbtw                            # extend to word
>         xchgw   %cx, %ax                # %cx = track and sector
>         xorw    %dx, %dx                # drive 0, head 0
>         movw    $0x0200, %bx            # address = 512, in INITSEG (%es = %cs)
>         movw    $0x0201, %ax            # service 2, 1 sector
>         int     $0x13
>         movb    $0x03, %ah              # read cursor pos
>         xorb    %bh, %bh
> 
> John.

Perhaps you could, but why the fsck do you want to beat a dead horse
over and over again?  Use a real bootloader instead.

	-hpa


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-04-30 21:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-30 11:54 Bootable CD idea John Bradford
2003-04-30 12:21 ` Richard B. Johnson
2003-04-30 12:41   ` John Bradford
2003-04-30 13:14     ` Tomas Szepe
2003-04-30 13:46       ` John Bradford
2003-04-30 13:47     ` Tigran Aivazian
2003-04-30 13:25       ` John Bradford
2003-04-30 18:57         ` H. Peter Anvin
2003-04-30 19:21           ` John Bradford
2003-04-30 21:18             ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).