2008-07-02 Bean <bean123ch@gmail.com>

* include/grub/ieee1275.h (grub_ieee1275_flag): New constant
	GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM
	and GRUB_IEEE1275_FLAG_NO_ANSI.

	* kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set flag
	GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM
	and GRUB_IEEE1275_FLAG_NO_ANSI for Open Hackware.

	* kern/ieee1275/ieee1275.c (grub_ieee1275_interpret): Return
	immediately if GRUB_IEEE1275_FLAG_CANNOT_INTERPRET is set.

	* kern/ieee1275/init.c (grub_claim_heap): Claim memory directly if
	GRUB_IEEE1275_FLAG_FORCE_CLAIM is set.

	* term/ieee1275/ofconsole.c (grub_ofconsole_writeesc): Don't output
	esc sequence on non ANSI terminal.
	(grub_ofconsole_gotoxy): Emulate backspace key on non ANSI terminal.

	* util/elf/grub-mkimage.c (add_segments): Move ELF header to the
	beginning of file.
This commit is contained in:
bean 2008-07-02 07:38:46 +00:00
parent 2270f77bea
commit d4156eeedf
7 changed files with 89 additions and 16 deletions

View file

@ -63,6 +63,9 @@ static grub_uint8_t grub_ofconsole_highlight_color = 0x70;
static void
grub_ofconsole_writeesc (const char *str)
{
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI))
return;
while (*str)
{
char chr = *(str++);
@ -284,11 +287,28 @@ static void
grub_ofconsole_gotoxy (grub_uint8_t x, grub_uint8_t y)
{
char s[11]; /* 5 + 3 + 3. */
grub_curr_x = x;
grub_curr_y = y;
grub_sprintf (s, "\e[%d;%dH", y + 1, x + 1);
grub_ofconsole_writeesc (s);
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI))
{
grub_curr_x = x;
grub_curr_y = y;
grub_sprintf (s, "\e[%d;%dH", y + 1, x + 1);
grub_ofconsole_writeesc (s);
}
else
{
if ((y == grub_curr_y) && (x == grub_curr_x - 1))
{
char chr;
chr = '\b';
grub_ieee1275_write (stdout_ihandle, &chr, 1, 0);
}
grub_curr_x = x;
grub_curr_y = y;
}
}
static void