Work on multi-out terminal
This commit is contained in:
parent
a2c1332b70
commit
f4c623e170
21 changed files with 707 additions and 570 deletions
|
@ -19,20 +19,15 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
#include <grub/reader.h>
|
||||
#include <grub/parser.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
#define GRUB_RESCUE_BUF_SIZE 256
|
||||
|
||||
static char linebuf[GRUB_RESCUE_BUF_SIZE];
|
||||
|
||||
static grub_err_t
|
||||
grub_rescue_init (void)
|
||||
{
|
||||
grub_printf ("Entering rescue mode...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Prompt to input a command and read the line. */
|
||||
static grub_err_t
|
||||
grub_rescue_read_line (char **line, int cont)
|
||||
|
@ -74,15 +69,24 @@ grub_rescue_read_line (char **line, int cont)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct grub_reader grub_rescue_reader =
|
||||
{
|
||||
.name = "rescue",
|
||||
.init = grub_rescue_init,
|
||||
.read_line = grub_rescue_read_line
|
||||
};
|
||||
|
||||
void
|
||||
grub_register_rescue_reader (void)
|
||||
grub_rescue_run (void)
|
||||
{
|
||||
grub_reader_register ("rescue", &grub_rescue_reader);
|
||||
grub_printf ("Entering rescue mode...\n");
|
||||
|
||||
while (1)
|
||||
{
|
||||
char *line;
|
||||
|
||||
/* Print an error, if any. */
|
||||
grub_print_error ();
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
||||
grub_rescue_read_line (&line, 0);
|
||||
if (! line)
|
||||
continue;
|
||||
|
||||
grub_parser_get_current ()->parse_line (line, grub_rescue_read_line);
|
||||
grub_free (line);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue