grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] move grub_stop() (Re: [PATCH] i386-qemu port)


From: Robert Millan
Subject: Re: [PATCH] move grub_stop() (Re: [PATCH] i386-qemu port)
Date: Mon, 22 Jun 2009 12:10:56 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jun 21, 2009 at 10:14:13PM -0400, Pavel Roskin wrote:
> On Sun, 2009-06-21 at 21:25 +0200, Robert Millan wrote:
> > On Sun, Jun 21, 2009 at 03:05:56PM -0400, Pavel Roskin wrote:
> > > On Sun, 2009-06-21 at 20:54 +0200, Robert Millan wrote:
> > > > Move grub_stop to init.c to ease code sharing with i386-qemu.
> > > 
> > > That's not quite a movement.  grub_cpu_idle() does nothing.
> > 
> > Well, the major problem with grub_cpu_idle() doing nothing on coreboot
> > is CPU consumption during polls.  grub_stop() is quite a corner case,
> > only seen when you hit an error.
> 
> I think this should do the right thing if our goal is to stop:
> 
>       cli
> halt:
>       hlt
>       jmp halt
> 
> The last "jmp" is just in case for non-maskable interrupts.

My aim was to move this to C code so it can be shared between i386-qemu
and i386-coreboot.  However, this code will be the same on other i386
ports, but we don't yet have a generic .S file for i386 code.

How about kern/i386/misc.S ?

> >   grub_stop: Just hang.
> > 
> >   grub_exit: Exit to BIOS/whatever.  On coreboot (and on i386-qemu)
> >   there's really no "proper" thing to do.  Maybe fallback to
> >   grub_halt or grub_fatal.
> > 
> >   grub_halt: Power off.  Theoretically we can have it anywhere,
> >   although in some platforms like coreboot it's not easy; otherwise
> >   it can fallback to grub_stop.
> > 
> > I think grub_stop is intended to have this behaviour in all platforms.
> > But I'm not sure how useful is it.  Perhaps it could be ditched in
> > favour of grub_exit?
> 
> >From the user's standpoint, I think three "stop-like" calls make sense:
> 
> Try to exit so that BIOS can try another media.  Failing that, hang.
> That would be appropriate for installations on disks that may or may not
> be bootable.  That's grub_exit().
> 
> Try for power down the system (that includes telling the emulator to
> stop).  Failing that, hang.  That would be appropriate for data centers
> where we don't want non-functioning systems to consume power.  That's
> grub_halt().
> 
> Just stop.  Appropriate if there is an important message on the screen
> that the user must see.

This seems to be the current behaviour, unless I missed something.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

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