cleanup and bugfix
This commit is contained in:
parent
9a54aa14f8
commit
7dc7e76a56
3 changed files with 5 additions and 18 deletions
16
kern/main.c
16
kern/main.c
|
@ -149,45 +149,29 @@ grub_load_normal_mode (void)
|
|||
void
|
||||
grub_main (void)
|
||||
{
|
||||
*((grub_uint8_t *)0x140003f8) = '1';
|
||||
|
||||
/* First of all, initialize the machine. */
|
||||
grub_machine_init ();
|
||||
|
||||
*((grub_uint8_t *)0x140003f8) = '2';
|
||||
|
||||
/* Hello. */
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
*((grub_uint8_t *)0x140003f8) = 'a';
|
||||
grub_printf ("Welcome to GRUB!\n\n");
|
||||
*((grub_uint8_t *)0x140003f8) = 'b';
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
|
||||
*((grub_uint8_t *)0x140003f8) = '3';
|
||||
|
||||
/* Load pre-loaded modules and free the space. */
|
||||
grub_register_exported_symbols ();
|
||||
grub_load_modules ();
|
||||
|
||||
*((grub_uint8_t *)0x140003f8) = '4';
|
||||
|
||||
/* It is better to set the root device as soon as possible,
|
||||
for convenience. */
|
||||
grub_machine_set_prefix ();
|
||||
grub_env_export ("prefix");
|
||||
grub_set_root_dev ();
|
||||
|
||||
*((grub_uint8_t *)0x140003f8) = '5';
|
||||
|
||||
grub_register_core_commands ();
|
||||
grub_register_rescue_parser ();
|
||||
grub_register_rescue_reader ();
|
||||
|
||||
*((grub_uint8_t *)0x140003f8) = '6';
|
||||
|
||||
grub_load_config ();
|
||||
*((grub_uint8_t *)0x140003f8) = '7';
|
||||
grub_load_normal_mode ();
|
||||
*((grub_uint8_t *)0x140003f8) = '8';
|
||||
grub_reader_loop (0);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,11 @@ grub_get_rtc (void)
|
|||
void
|
||||
grub_machine_init (void)
|
||||
{
|
||||
void *tst;
|
||||
grub_mm_init_region ((void *) GRUB_MACHINE_MEMORY_STACK_HIGH,
|
||||
RAMSIZE - GRUB_MACHINE_MEMORY_STACK_HIGH);
|
||||
RAMSIZE - (GRUB_MACHINE_MEMORY_STACK_HIGH & 0x7fffffff));
|
||||
tst = grub_malloc (10);
|
||||
grub_free (tst);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -598,7 +598,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
|
|||
if (str)
|
||||
*str++ = ch;
|
||||
else
|
||||
grub_putchar (ch);
|
||||
grub_putchar (ch);
|
||||
|
||||
count++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue