All of lore.kernel.org
 help / color / mirror / Atom feed
* restoring x86 BIOS state before reboot
@ 2007-04-06 15:46 Bart Trojanowski
  2007-04-06 17:48 ` Jan Engelhardt
  2007-04-29  6:51   ` Eric W. Biederman
  0 siblings, 2 replies; 18+ messages in thread
From: Bart Trojanowski @ 2007-04-06 15:46 UTC (permalink / raw)
  To: fastboot; +Cc: linux-kernel

Hi all,

I am looking at a two stage boot where linux is loaded to do some system
initialization before booting to Windows, which needs BIOS.

I am interested in bypassing the BIOS on the second boot.

I wanted to know if anyone has attempted to restore the BIOS memory such 
that this could be attempted.  If not, I would love to get some pointers
:)

My plan right now is to backup the 128k of memory under 0x10000 to some
staging memory under 0x90000, temporarily while in real mode, and then
move it up somewhere higher once the kernel is running.

Then on reboot I hope to undo the above and jump to 0x00007c00.

Does this approach have any merit?

Cheers,

-Bart

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

* Re: restoring x86 BIOS state before reboot
  2007-04-06 15:46 restoring x86 BIOS state before reboot Bart Trojanowski
@ 2007-04-06 17:48 ` Jan Engelhardt
  2007-04-29  6:51   ` Eric W. Biederman
  1 sibling, 0 replies; 18+ messages in thread
From: Jan Engelhardt @ 2007-04-06 17:48 UTC (permalink / raw)
  To: Bart Trojanowski; +Cc: fastboot, linux-kernel


On Apr 6 2007 11:46, Bart Trojanowski wrote:
>Hi all,
>
>I am looking at a two stage boot where linux is loaded to do some system
>initialization before booting to Windows, which needs BIOS.
>
>I am interested in bypassing the BIOS on the second boot.
>
>I wanted to know if anyone has attempted to restore the BIOS memory such 
>that this could be attempted.  If not, I would love to get some pointers
>:)

Hmm.... minix3's "boot monitor" seems to be something in that direction.
When typing "halt" on minix, the system is 'shut down' and control is
passed to the boot monitor where you can select minix again.


Jan
-- 

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-04-06 15:46 restoring x86 BIOS state before reboot Bart Trojanowski
@ 2007-04-29  6:51   ` Eric W. Biederman
  2007-04-29  6:51   ` Eric W. Biederman
  1 sibling, 0 replies; 18+ messages in thread
From: Eric W. Biederman @ 2007-04-29  6:51 UTC (permalink / raw)
  To: Bart Trojanowski
  Cc: fastboot, linux-kernel, Kexec Mailing List, Jan Engelhardt

Bart Trojanowski <bart@jukie.net> writes:

> Hi all,
>
> I am looking at a two stage boot where linux is loaded to do some system
> initialization before booting to Windows, which needs BIOS.
>
> I am interested in bypassing the BIOS on the second boot.
>
> I wanted to know if anyone has attempted to restore the BIOS memory such 
> that this could be attempted.  If not, I would love to get some pointers
> :)
>
> My plan right now is to backup the 128k of memory under 0x10000 to some
> staging memory under 0x90000, temporarily while in real mode, and then
> move it up somewhere higher once the kernel is running.
>
> Then on reboot I hope to undo the above and jump to 0x00007c00.
>
> Does this approach have any merit?

The primary problem isn't so much the BIOS memory.  That is usually
preserved.  But rather the BIOS gets confused at the massive change
in hardware state.  At least I think that is what happens.

On some BIOS/kernel configuration it isn't a problem I think I
got maybe a 20% success rate trying to use the 16bit linux entry
point that starts the new kernel from kexec when I was investigating
it.

You might get a little more success if you backup the BIOS memory
I don't know.

As long as you are not coming out of a panic situation there is
no theoretical reason why you shouldn't get the BIOS back and
working again, but the how of it is a challenge.

The possibility I keep playing with is to load the Bochs BIOS or
some other implementation of the basic boot services that I have
control over so that if it doesn't work the code can be fixed.
There has been some limited success with this technique in the
context of LinuxBIOS.

The ACPI tables should be reusable as is.

It may also be worth investigating if it is possible to bypass
the part of windows that uses BIOS calls.  I really don't have
a clue how a modern windows systems boots.

Eric

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-04-29  6:51   ` Eric W. Biederman
  0 siblings, 0 replies; 18+ messages in thread
From: Eric W. Biederman @ 2007-04-29  6:51 UTC (permalink / raw)
  To: Bart Trojanowski
  Cc: Kexec Mailing List, fastboot, linux-kernel, Jan Engelhardt

Bart Trojanowski <bart@jukie.net> writes:

> Hi all,
>
> I am looking at a two stage boot where linux is loaded to do some system
> initialization before booting to Windows, which needs BIOS.
>
> I am interested in bypassing the BIOS on the second boot.
>
> I wanted to know if anyone has attempted to restore the BIOS memory such 
> that this could be attempted.  If not, I would love to get some pointers
> :)
>
> My plan right now is to backup the 128k of memory under 0x10000 to some
> staging memory under 0x90000, temporarily while in real mode, and then
> move it up somewhere higher once the kernel is running.
>
> Then on reboot I hope to undo the above and jump to 0x00007c00.
>
> Does this approach have any merit?

The primary problem isn't so much the BIOS memory.  That is usually
preserved.  But rather the BIOS gets confused at the massive change
in hardware state.  At least I think that is what happens.

On some BIOS/kernel configuration it isn't a problem I think I
got maybe a 20% success rate trying to use the 16bit linux entry
point that starts the new kernel from kexec when I was investigating
it.

You might get a little more success if you backup the BIOS memory
I don't know.

As long as you are not coming out of a panic situation there is
no theoretical reason why you shouldn't get the BIOS back and
working again, but the how of it is a challenge.

The possibility I keep playing with is to load the Bochs BIOS or
some other implementation of the basic boot services that I have
control over so that if it doesn't work the code can be fixed.
There has been some limited success with this technique in the
context of LinuxBIOS.

The ACPI tables should be reusable as is.

It may also be worth investigating if it is possible to bypass
the part of windows that uses BIOS calls.  I really don't have
a clue how a modern windows systems boots.

Eric

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-04-29  6:51   ` Eric W. Biederman
@ 2007-04-29  9:41     ` Bernhard Walle
  -1 siblings, 0 replies; 18+ messages in thread
From: Bernhard Walle @ 2007-04-29  9:41 UTC (permalink / raw)
  To: kexec, linux-kernel, Jan Engelhardt

* Eric W. Biederman <ebiederm@xmission.com> [2007-04-29 08:51]:
> 
> It may also be worth investigating if it is possible to bypass
> the part of windows that uses BIOS calls.  I really don't have
> a clue how a modern windows systems boots.

I think ReactOS has a bootlader that can also boot Windows, or at
least they are close to booting the Windows kernel. That bootloader
could be then used for booting Windows without BIOS calls.

I also heard that the 100-$-Laptop should now be able to use Windows.
As it's using LinuxBIOS, this could also be interesting. However,
maybe Microsoft simply modifies a special Windows for this, or they
integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(


Thanks,
   Bernhard

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-04-29  9:41     ` Bernhard Walle
  0 siblings, 0 replies; 18+ messages in thread
From: Bernhard Walle @ 2007-04-29  9:41 UTC (permalink / raw)
  To: kexec, linux-kernel, Jan Engelhardt

* Eric W. Biederman <ebiederm@xmission.com> [2007-04-29 08:51]:
> 
> It may also be worth investigating if it is possible to bypass
> the part of windows that uses BIOS calls.  I really don't have
> a clue how a modern windows systems boots.

I think ReactOS has a bootlader that can also boot Windows, or at
least they are close to booting the Windows kernel. That bootloader
could be then used for booting Windows without BIOS calls.

I also heard that the 100-$-Laptop should now be able to use Windows.
As it's using LinuxBIOS, this could also be interesting. However,
maybe Microsoft simply modifies a special Windows for this, or they
integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(


Thanks,
   Bernhard

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-04-29  9:41     ` Bernhard Walle
@ 2007-04-29 14:46       ` Eric W. Biederman
  -1 siblings, 0 replies; 18+ messages in thread
From: Eric W. Biederman @ 2007-04-29 14:46 UTC (permalink / raw)
  To: kexec; +Cc: linux-kernel, Jan Engelhardt

Bernhard Walle <bwalle@suse.de> writes:

> * Eric W. Biederman <ebiederm@xmission.com> [2007-04-29 08:51]:
>> 
>> It may also be worth investigating if it is possible to bypass
>> the part of windows that uses BIOS calls.  I really don't have
>> a clue how a modern windows systems boots.
>
> I think ReactOS has a bootlader that can also boot Windows, or at
> least they are close to booting the Windows kernel. That bootloader
> could be then used for booting Windows without BIOS calls.
>
> I also heard that the 100-$-Laptop should now be able to use Windows.
> As it's using LinuxBIOS, this could also be interesting. However,
> maybe Microsoft simply modifies a special Windows for this, or they
> integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(

I know it isn't a ClosedSource part in LinuxBIOS.

In any particular case you can work through the details, and
make it work.

The hard part is making the general case work.

Eric

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-04-29 14:46       ` Eric W. Biederman
  0 siblings, 0 replies; 18+ messages in thread
From: Eric W. Biederman @ 2007-04-29 14:46 UTC (permalink / raw)
  To: kexec; +Cc: linux-kernel, Jan Engelhardt

Bernhard Walle <bwalle@suse.de> writes:

> * Eric W. Biederman <ebiederm@xmission.com> [2007-04-29 08:51]:
>> 
>> It may also be worth investigating if it is possible to bypass
>> the part of windows that uses BIOS calls.  I really don't have
>> a clue how a modern windows systems boots.
>
> I think ReactOS has a bootlader that can also boot Windows, or at
> least they are close to booting the Windows kernel. That bootloader
> could be then used for booting Windows without BIOS calls.
>
> I also heard that the 100-$-Laptop should now be able to use Windows.
> As it's using LinuxBIOS, this could also be interesting. However,
> maybe Microsoft simply modifies a special Windows for this, or they
> integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(

I know it isn't a ClosedSource part in LinuxBIOS.

In any particular case you can work through the details, and
make it work.

The hard part is making the general case work.

Eric

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-04-29  9:41     ` Bernhard Walle
@ 2007-04-29 16:28       ` David Woodhouse
  -1 siblings, 0 replies; 18+ messages in thread
From: David Woodhouse @ 2007-04-29 16:28 UTC (permalink / raw)
  To: Bernhard Walle; +Cc: kexec, linux-kernel, Jan Engelhardt

On Sun, 2007-04-29 at 11:41 +0200, Bernhard Walle wrote:
> I also heard that the 100-$-Laptop should now be able to use Windows.
> As it's using LinuxBIOS, this could also be interesting. However,
> maybe Microsoft simply modifies a special Windows for this, or they
> integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(

You heard wrong. Microsoft have a few early test units and are trying to
get Windows to boot on it. I believe their plan involves replacing
LinuxBIOS with a 'normal' PC BIOS.

-- 
dwmw2


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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-04-29 16:28       ` David Woodhouse
  0 siblings, 0 replies; 18+ messages in thread
From: David Woodhouse @ 2007-04-29 16:28 UTC (permalink / raw)
  To: Bernhard Walle; +Cc: kexec, linux-kernel, Jan Engelhardt

On Sun, 2007-04-29 at 11:41 +0200, Bernhard Walle wrote:
> I also heard that the 100-$-Laptop should now be able to use Windows.
> As it's using LinuxBIOS, this could also be interesting. However,
> maybe Microsoft simply modifies a special Windows for this, or they
> integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(

You heard wrong. Microsoft have a few early test units and are trying to
get Windows to boot on it. I believe their plan involves replacing
LinuxBIOS with a 'normal' PC BIOS.

-- 
dwmw2


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-04-29  9:41     ` Bernhard Walle
@ 2007-05-11 18:23       ` Pavel Machek
  -1 siblings, 0 replies; 18+ messages in thread
From: Pavel Machek @ 2007-05-11 18:23 UTC (permalink / raw)
  To: kexec, linux-kernel, Jan Engelhardt

Hi!

> > It may also be worth investigating if it is possible to bypass
> > the part of windows that uses BIOS calls.  I really don't have
> > a clue how a modern windows systems boots.
> 
> I think ReactOS has a bootlader that can also boot Windows, or at
> least they are close to booting the Windows kernel. That bootloader
> could be then used for booting Windows without BIOS calls.
> 
> I also heard that the 100-$-Laptop should now be able to use Windows.
> As it's using LinuxBIOS, this could also be interesting. However,
> maybe Microsoft simply modifies a special Windows for this, or they
> integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(

I do not think OLPC is using linuxBIOS these days. What they have
certainly looks like Sun's ROM monitor.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-05-11 18:23       ` Pavel Machek
  0 siblings, 0 replies; 18+ messages in thread
From: Pavel Machek @ 2007-05-11 18:23 UTC (permalink / raw)
  To: kexec, linux-kernel, Jan Engelhardt

Hi!

> > It may also be worth investigating if it is possible to bypass
> > the part of windows that uses BIOS calls.  I really don't have
> > a clue how a modern windows systems boots.
> 
> I think ReactOS has a bootlader that can also boot Windows, or at
> least they are close to booting the Windows kernel. That bootloader
> could be then used for booting Windows without BIOS calls.
> 
> I also heard that the 100-$-Laptop should now be able to use Windows.
> As it's using LinuxBIOS, this could also be interesting. However,
> maybe Microsoft simply modifies a special Windows for this, or they
> integrate a ClosedSource part in that LinuxBIOS, I don't know ... :-(

I do not think OLPC is using linuxBIOS these days. What they have
certainly looks like Sun's ROM monitor.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-05-11 18:23       ` Pavel Machek
@ 2007-05-11 19:29         ` Jeremy Fitzhardinge
  -1 siblings, 0 replies; 18+ messages in thread
From: Jeremy Fitzhardinge @ 2007-05-11 19:29 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kexec, linux-kernel, Jan Engelhardt

Pavel Machek wrote:
> I do not think OLPC is using linuxBIOS these days. What they have
> certainly looks like Sun's ROM monitor.

Yep, looks like they've got Mitch Bradley, (ex?) of Firmworks, doing
their firmware.  That means its pretty much exactly OpenFirmware.  Lots
of yummy, delicious Forth.

    J

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-05-11 19:29         ` Jeremy Fitzhardinge
  0 siblings, 0 replies; 18+ messages in thread
From: Jeremy Fitzhardinge @ 2007-05-11 19:29 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kexec, linux-kernel, Jan Engelhardt

Pavel Machek wrote:
> I do not think OLPC is using linuxBIOS these days. What they have
> certainly looks like Sun's ROM monitor.

Yep, looks like they've got Mitch Bradley, (ex?) of Firmworks, doing
their firmware.  That means its pretty much exactly OpenFirmware.  Lots
of yummy, delicious Forth.

    J

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-05-11 18:23       ` Pavel Machek
@ 2007-05-11 20:18         ` H. Peter Anvin
  -1 siblings, 0 replies; 18+ messages in thread
From: H. Peter Anvin @ 2007-05-11 20:18 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kexec, linux-kernel, Jan Engelhardt

Pavel Machek wrote:
> 
> I do not think OLPC is using linuxBIOS these days. What they have
> certainly looks like Sun's ROM monitor.
> 

That would be OpenFirmware, then.

	-hpa

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-05-11 20:18         ` H. Peter Anvin
  0 siblings, 0 replies; 18+ messages in thread
From: H. Peter Anvin @ 2007-05-11 20:18 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kexec, linux-kernel, Jan Engelhardt

Pavel Machek wrote:
> 
> I do not think OLPC is using linuxBIOS these days. What they have
> certainly looks like Sun's ROM monitor.
> 

That would be OpenFirmware, then.

	-hpa

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
  2007-05-11 20:18         ` H. Peter Anvin
@ 2007-05-11 21:11           ` yhlu
  -1 siblings, 0 replies; 18+ messages in thread
From: yhlu @ 2007-05-11 21:11 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Pavel Machek, kexec, linux-kernel, Jan Engelhardt

On 5/11/07, H. Peter Anvin <hpa@zytor.com> wrote:
> Pavel Machek wrote:
> >
> > I do not think OLPC is using linuxBIOS these days. What they have
> > certainly looks like Sun's ROM monitor.
> >
>
> That would be OpenFirmware, then.
>
current kernel for x86 support OFW boot patch?

YH

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

* Re: [Fastboot] restoring x86 BIOS state before reboot
@ 2007-05-11 21:11           ` yhlu
  0 siblings, 0 replies; 18+ messages in thread
From: yhlu @ 2007-05-11 21:11 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: kexec, linux-kernel, Pavel Machek, Jan Engelhardt

On 5/11/07, H. Peter Anvin <hpa@zytor.com> wrote:
> Pavel Machek wrote:
> >
> > I do not think OLPC is using linuxBIOS these days. What they have
> > certainly looks like Sun's ROM monitor.
> >
>
> That would be OpenFirmware, then.
>
current kernel for x86 support OFW boot patch?

YH

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2007-05-11 21:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-06 15:46 restoring x86 BIOS state before reboot Bart Trojanowski
2007-04-06 17:48 ` Jan Engelhardt
2007-04-29  6:51 ` [Fastboot] " Eric W. Biederman
2007-04-29  6:51   ` Eric W. Biederman
2007-04-29  9:41   ` Bernhard Walle
2007-04-29  9:41     ` Bernhard Walle
2007-04-29 14:46     ` Eric W. Biederman
2007-04-29 14:46       ` Eric W. Biederman
2007-04-29 16:28     ` David Woodhouse
2007-04-29 16:28       ` David Woodhouse
2007-05-11 18:23     ` Pavel Machek
2007-05-11 18:23       ` Pavel Machek
2007-05-11 19:29       ` Jeremy Fitzhardinge
2007-05-11 19:29         ` Jeremy Fitzhardinge
2007-05-11 20:18       ` H. Peter Anvin
2007-05-11 20:18         ` H. Peter Anvin
2007-05-11 21:11         ` yhlu
2007-05-11 21:11           ` yhlu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.