All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: at_keyboard flush on i386-qemu
Date: Mon, 29 Jun 2009 00:02:55 -0400	[thread overview]
Message-ID: <1246248175.22661.19.camel@mj> (raw)
In-Reply-To: <20090627112521.GA28637@thorin>

On Sat, 2009-06-27 at 13:25 +0200, Robert Millan wrote:
> Hi,
> 
> Pavel pointed out earlier that sometimes when starting on i386-qemu GRUB
> receives spurious events from AT keyboard.

Yes, it's still happening, but not always.  Approximately half of the
time I'm getting "2" at the prompt.

>   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 would just read and discard the keyboard data from the port at startup
without embedding at_keyboard.

> 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.

I think there is at most one event.  And I suspect it's due to a qemu
bug.  Or at least qemu could do better by starting in the same state
every time.

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2009-06-29  4:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-27 11:25 at_keyboard flush on i386-qemu Robert Millan
2009-06-29  4:02 ` Pavel Roskin [this message]
2009-06-29 13:33   ` Robert Millan
2009-06-30  1:01     ` Pavel Roskin
2009-07-07 19:51 ` [PATCH] use ljmp to reboot (Re: at_keyboard flush on i386-qemu) Robert Millan
2009-07-07 20:51   ` Pavel Roskin
2009-07-10 17:07     ` Robert Millan

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=1246248175.22661.19.camel@mj \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.