[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] use ljmp to reboot (Re: at_keyboard flush on i386-qemu)
From: |
Robert Millan |
Subject: |
[PATCH] use ljmp to reboot (Re: at_keyboard flush on i386-qemu) |
Date: |
Tue, 7 Jul 2009 21:51:53 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, Jun 27, 2009 at 01:25:21PM +0200, Robert Millan wrote:
>
> Hi,
>
> Pavel pointed out earlier that sometimes when starting on i386-qemu GRUB
> receives spurious events from AT keyboard. It seems that it is the role
> of the firmware to flush this buffer at startup.
>
> Unless someone has a better idea, I would fix this with:
>
> - Moving at_keyboard to kernel on i386-qemu.
>
> - [ifdef GRUB_MACHINE_QEMU]: flush the input buffer at at_keyboard
> startup by reading and discarding events for a fixed amount of time.
>
> I don't like that we have a race here. Suggestions welcome on how to
> improve that, but TTBOMK if there's more than one event you can't tell
> when you're processing the last one.
Actually I diagnosed this completely wrong. The real problem is we're
using the keyboard to reboot the machine, which (at least on QEMU) results
in spurious keys being put in the buffer.
I think we should just jump to 0xffff0 to reboot. I didn't know back when I
wrote reboot.c, but this is supposedly more reliable since we're jumping to
code in ROM which hasn't been overwritten (kern/i386/pc/startup.S uses the
same trick for its own grub_reboot()).
See attached patch.
--
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."
reboot.diff
Description: Text Data
- [PATCH] use ljmp to reboot (Re: at_keyboard flush on i386-qemu),
Robert Millan <=