All of lore.kernel.org
 help / color / mirror / Atom feed
* Sugguestion: separate input and output driver
@ 2008-05-29  8:09 Bean
  2008-05-29  9:46 ` Robert Millan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bean @ 2008-05-29  8:09 UTC (permalink / raw)
  To: The development of GRUB 2

Currently, input and output are bundled together, this make it quite
difficult to extend.

Input:
Keyboard, Serial

Output:
Text mode, Video mode

Now, the binding is fixed using individual module:

Keyboard + Text = console
Keyboard + Video = gfxterm
Serial + Text = serial
Serial + Video = ?

And there are mixing as well.

If we separate them, it would make things much clear. For example, the
grub_term structure can be split into two mutually exclusive parts:

struct grub_term =
{
  .name,
  .init,
  .fini,
  .putchar,
  .getcharwidth,
  .checkkey,
  .getkey,
  .getwh,
  .getxy,
  .gotoxy,
  .cls,
  .setcolorstate,
  .setcursor,
  .flags,
  .next
};

=>

struct grub_input
{
  .name,
  .init,
  .fini,
  .checkkey,
  .getkey
  .flags,
  .next
}

+

struct grub_output
{
  .name,
  .init,
  .fini,
  .putchar,
  .getcharwidth,
  .getxy,
  .gotoxy,
  .cls,
  .setcolorstate,
  .setcursor,
  .flags,
  .next
}

Integration between input and output:

Input driver <=> console driver <=> Output driver

The console driver is the central part. It accepts virtual key from
the input driver, and write to the virtual screen provided by output
driver.

-- 
Bean



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-29 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29  8:09 Sugguestion: separate input and output driver Bean
2008-05-29  9:46 ` Robert Millan
2008-05-29  9:59 ` Robert Millan
2008-05-29 11:45 ` Marco Gerards

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.