Re: Loading a Second Kernel

2007-04-24 Thread J.C. Roberts
On Tuesday 17 April 2007 11:33, Jon Steel wrote:
 Hi

 Im trying to find a way to do a sort of very soft reboot. For example
 I want to boot up the computer into a kernel on one drive, and then
 after saying reboot, the computer loads up a kernel from a second
 drive.

 I have gotten this to work with the use of a file to pass information
 between boots, but that is not an ideal solution. What I really want
 is either a way to pass a parameter to the BIOS so that it can pass
 it to boot upon restarting, or a way to reload the boot loader into
 memory and then execute it.

 It would even be fine to use another operating system on the first
 boot. So it boots up into say Gentoo, and then when Im done with
 that, I want to load OpenBSD.

 Does anybody have an idea how I can approach this?

 Thanks

 Jonathan Steel

man 8 boot

You can do all sorts of cool things while booting and 
with /etc/boot.conf, including what you want (assuming your are booting 
instances of OpenBSD on each drive). The ``image'' is a combination of 
a device and a file name.

You can also change your boot device on some i386 systems through your 
CMOS settings or your SCSI controller settings. Other archs are much 
better at this (Sun, PARISC, Alpha, ...), and you don't need to fiddle 
with stuff.

Of course you can also net-boot, and make the desired change from one 
kernel/config to another at the server.

Kind Regards,
JCR



Re: Loading a Second Kernel

2007-04-23 Thread Tobias Weingartner
In article [EMAIL PROTECTED], Jon Steel wrote:
 
  I have gotten this to work with the use of a file to pass information
  between boots, but that is not an ideal solution. What I really want is
  either a way to pass a parameter to the BIOS so that it can pass it to
  boot upon restarting, or a way to reload the boot loader into memory and
  then execute it.

This is not really possible on the PC architecture.  The only way to
currently do this is to hack things.  Either by putting some stuff into
RAM, with checksums and all, and have /boot search for it, and if it
find it, execute it.  This may or may not work.  Some BIOS clear memory
on reboot, others don't.

Another way is to do some hacking to the unused parts of the NVRAM on
PCs, and check for that in /boot again, modifying the boot process as
you want.

  It would even be fine to use another operating system on the first boot.
  So it boots up into say Gentoo, and then when Im done with that, I want
  to load OpenBSD.

If that is the case, run vmware with a windows/linux host.  You can then
boot different root disks for example.

  Does anybody have an idea how I can approach this?

Bug Dell and other big consortium PC makers to have a BIOS API defined to
store things and retrieve things from NVRAM.  Hell to document what the
BIOS will use to configure console redirection, boot ordering, etc, so that
we can store and use the information in a compatible manner from userland.

Oh, while you're at it, have them define a simple way to do a putc(3) and
getc(3) through the bios as well (from 16-bit and 32-bit applications),
that will respect console redirections of course.


Lalalaa,

-- 
 [100~Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ1!=b]salax



Re: Loading a Second Kernel

2007-04-23 Thread Andy Hayward

On 4/17/07, Jon Steel [EMAIL PROTECTED] wrote:

Im trying to find a way to do a sort of very soft reboot. For example I
want to boot up the computer into a kernel on one drive, and then after
saying reboot, the computer loads up a kernel from a second drive.


This sounds very similar to the Linux kexec api. Whether it actually
is, and whether this can be ported to OpenBSD is left as an exercise.
:)

http://www-128.ibm.com/developerworks/linux/library/l-kexec.html

-- ach



Re: Loading a Second Kernel

2007-04-17 Thread Bret Lambert
On Tue, 2007-04-17 at 14:33 -0400, Jon Steel wrote:
 Hi
 
 Im trying to find a way to do a sort of very soft reboot. For example I
 want to boot up the computer into a kernel on one drive, and then after
 saying reboot, the computer loads up a kernel from a second drive.
 
 I have gotten this to work with the use of a file to pass information
 between boots, but that is not an ideal solution. What I really want is
 either a way to pass a parameter to the BIOS so that it can pass it to
 boot upon restarting, or a way to reload the boot loader into memory and
 then execute it.
 
 It would even be fine to use another operating system on the first boot.
 So it boots up into say Gentoo, and then when Im done with that, I want
 to load OpenBSD.
 
 Does anybody have an idea how I can approach this?
 

You could install a bootloader that uses a conf file, and have a script
that edits that and then reboots into your chosen OS.

Of course, down that road may lie much frustration as a badly-written
script can cause you to reboot with a ramdisk or some such and edit by
hand.

 Thanks
 
 Jonathan Steel



Re: Loading a Second Kernel

2007-04-17 Thread Johan SANCHEZ
 Hi

Hi
 
 Im trying to find a way to do a sort of very soft reboot. For example I
 want to boot up the computer into a kernel on one drive, and then after
 saying reboot, the computer loads up a kernel from a second drive.

forget about pc then move onto Sun and the like
eeprom boot-device  diskN where your os resides 

 I have gotten this to work with the use of a file to pass information
 between boots, but that is not an ideal solution. What I really want is
 either a way to pass a parameter to the BIOS so that it can pass it to
 boot upon restarting, or a way to reload the boot loader into memory and
 then execute it.

eeprom boot-file mykernel

 It would even be fine to use another operating system on the first boot.
 So it boots up into say Gentoo, and then when Im done with that, I want
 to load OpenBSD.
 
 Does anybody have an idea how I can approach this?

Not on a pc ...