[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] move grub_stop() (Re: [PATCH] i386-qemu port)
From: |
Pavel Roskin |
Subject: |
Re: [PATCH] move grub_stop() (Re: [PATCH] i386-qemu port) |
Date: |
Sun, 21 Jun 2009 22:14:13 -0400 |
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.
> > I think we need to have several implementations of grub_stop: hard halt
> > with interrupts disabled, exit from qemu, exit from other emulators if
> > it's different, power off, exit to BIOS. Then different platforms
> > should enable and try whatever is appropriate for them.
>
> Note that we already have:
>
> 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.
--
Regards,
Pavel Roskin
[PATCH] move grub_stop() (Re: [PATCH] i386-qemu port), Robert Millan, 2009/06/21
Re: [PATCH] i386-qemu port, Pavel Roskin, 2009/06/21
[PATCH] rename kernel.elf to kernel.img (Re: [PATCH] i386-qemu port), Robert Millan, 2009/06/21