bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub 0.90 prevents Standby in Windows


From: erich
Subject: Re: grub 0.90 prevents Standby in Windows
Date: Fri, 26 Oct 2001 12:09:36 -0700

Thierry Laronde <address@hidden> wrote:

> On Fri, Oct 26, 2001 at 11:37:26PM +0900, Yoshinori K. Okuji wrote:
> 
> > At Fri, 26 Oct 2001 12:35:24 +0200,
> > Thierry Laronde wrote:
> > 
> > > Thanks for the explanations Erich! I think indeed that the `boot' call
> > > should put the machine back in the clean state --- for example, with
> > > extended floppy formats, I have backed-up the INT 1E but at the moment,
> > > even if I change it I haven't put the code to restore it after...
> > 
> > That's right. So I was thinking of adding something like "hook" to
> > restore the system status before booting, to make it easy to extend
> > GRUB features... But that might be difficult to implement in a generic
> > way without real memory management support (which is, of course, one
> > of things I'd like to add into a future version of GRUB).
> 
> Perhaps could we make the policy that everything customized by GRUB for
> GRUB internal must be reverse at the very end before passing relay to
> another OS, and put a `restore_all' function in `boot', and everybody
> having to put in this restore_all the code to 
> reverse the changes he made (this function being mainly arch dependent).

I'm for it.  ;-)

I think Okuji's idea of a "hook", to keep things simple and extensible,
is a good one (that way, each bit of code can be included with no
reference to others and no messy "#define"'s to remove unwanted ones).

I'm presuming this takes the form of a function pointer, perhaps called
"boot_hook", which gets called prior to the final boot stage, after
all the checks have been made.  To take advantage of it, each bit of
code that wanted to do this would replace the value of "boot_hook" with
it's own function, which, at the end, calls the previous value.

If you really want to keep the code simple, you can put the function for
the final part of the boot in that function pointer, so there is no "NULL"
case to check for.  Each bit of code would have it's own global variable
to put the old value of "boot_hook" into, which starts out as NULL, and
if the code can get called more than once (presuming that's OK and it
doesn't corrupt the state somehow), then it can check it's own variable
first to see if it's NULL (i.e. it hasn't been put in the boot_hook
chain yet).

You just call "boot_hook", each one calls the next, until the final one
calls the real boot function it redirected from.

--
    Erich Stefan Boleyn     <address@hidden>     http://www.uruk.org/
"Reality is truly stranger than fiction; Probably why fiction is so popular"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]