public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Bart Trojanowski <bart@jukie.net>
Cc: fastboot@lists.osdl.org, linux-kernel@vger.kernel.org,
	Kexec Mailing List <kexec@lists.infradead.org>,
	Jan Engelhardt <jengelh@linux01.gwdg.de>
Subject: Re: [Fastboot] restoring x86 BIOS state before reboot
Date: Sun, 29 Apr 2007 00:51:09 -0600	[thread overview]
Message-ID: <m1zm4rd676.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070406154628.GG12005@jukie.net> (Bart Trojanowski's message of "Fri, 6 Apr 2007 11:46:28 -0400")

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

  parent reply	other threads:[~2007-04-29  6:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2007-04-29  9:41   ` [Fastboot] " Bernhard Walle
2007-04-29 14:46     ` Eric W. Biederman
2007-04-29 16:28     ` David Woodhouse
2007-05-11 18:23     ` Pavel Machek
2007-05-11 19:29       ` Jeremy Fitzhardinge
2007-05-11 20:18       ` H. Peter Anvin
2007-05-11 21:11         ` yhlu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1zm4rd676.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=bart@jukie.net \
    --cc=fastboot@lists.osdl.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox