[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sugguestion: separate input and output driver
From: |
Bean |
Subject: |
Sugguestion: separate input and output driver |
Date: |
Thu, 29 May 2008 16:09:54 +0800 |
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
- Sugguestion: separate input and output driver,
Bean <=