/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
static void
{
}
/*
* BIOS call "INT 10H Function 03h" to get cursor position
* Call with %ah = 0x03
* %bh = page
* Returns %ch = starting scan line
* %cl = ending scan line
* %dh = row (0 is top)
* %dl = column (0 is left)
*/
static grub_uint16_t
{
}
/*
* BIOS call "INT 10H Function 02h" to set cursor position
* Call with %ah = 0x02
* %bh = page
* %dh = row (0 is top)
* %dl = column (0 is left)
*/
static void
grub_uint8_t x, grub_uint8_t y)
{
/* set page to 0 */
}
/*
*
* Put the character C on the console. Because GRUB wants to write a
* character with an attribute, this implementation is a bit tricky.
* If C is a control character (CR, LF, BEL, BS), use INT 10, AH = 0Eh
* (TELETYPE OUTPUT). Otherwise, save the original position, put a space,
* save the current position, restore the original position, write the
* character and the attribute, and restore the current position.
*
* The reason why this is so complicated is that there is no easy way to
* get the height of the screen, and the TELETYPE OUTPUT BIOS call doesn't
* support setting a background attribute.
*/
static void
{
if (c == 7 || c == 8 || c == 0xa || c == 0xd)
{
return;
}
/* get the current position */
/* check the column with the width */
{
grub_console_putchar_real (0x0d);
grub_console_putchar_real (0x0a);
/* get the current position */
}
/* write the character with the attribute */
int10_9 (c, 1);
}
static void
const struct grub_unicode_glyph *c)
{
}
/*
* BIOS call "INT 10H Function 09h" to write character and attribute
* Call with %ah = 0x09
* %al = (character)
* %bh = (page number)
* %bl = (attribute)
* %cx = (number of times)
*/
static void
{
/* move the cursor to the beginning */
grub_console_gotoxy (term, 0, 0);
/* write spaces to the entire screen */
/* move back the cursor */
grub_console_gotoxy (term, 0, 0);
}
/*
* void grub_console_setcursor (int on)
* BIOS call "INT 10H Function 01h" to set cursor type
* Call with %ah = 0x01
* %ch = cursor starting scanline
* %cl = cursor ending scanline
*/
static void
int on)
{
/* check if the standard cursor shape has already been saved */
if (!console_cursor_shape)
{
console_cursor_shape = 0x0d0e;
}
/* set %cx to the designated cursor shape */
}
/*
* if there is a character pending, return it; otherwise return -1
* BIOS call "INT 16H Function 01H" to check whether a character is pending
* Call with %ah = 0x1
* Return:
* If key waiting to be input:
* %ah = keyboard scan code
* %al = ASCII character
* Zero flag = clear
* else
* Zero flag = set
* BIOS call "INT 16H Function 00H" to read character from keyboard
* Call with %ah = 0x0
* Return: %ah = keyboard scan code
* %al = ASCII character
*/
static int
{
0x0100 | '\e', 0x0f00 | '\t', 0x0e00 | '\b', 0x1c00 | '\r', 0x1c00 | '\n'
};
unsigned i;
/*
* Due to a bug in apple's bootcamp implementation, INT 16/AH = 0 would
* cause the machine to hang at the second keystroke. However, we can
* work around this problem by ensuring the presence of keystroke with
* INT 16/AH = 1 before calling INT 16/AH = 0.
*/
return GRUB_TERM_NO_KEY;
for (i = 0; i < ARRAY_SIZE (bypass_table); i++)
}
static int
{
/* conveniently GRUB keystatus is modelled after BIOS one. */
}
{
.name = "console",
};
{
.name = "console",
.cls = grub_console_cls,
};
void
grub_console_init (void)
{
}
void
grub_console_fini (void)
{
}