void grub_machine_init (void) { char args[256]; grub_ssize_t actual; grub_ieee1275_init (); grub_console_init_early (); #ifdef __i386__ grub_get_extended_memory (); #endif grub_claim_heap (); grub_console_init_lately (); grub_ofdisk_init (); /* Process commandline. */ if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args, sizeof args, &actual) == 0 && actual > 1) { int i = 0; while (i < actual) { char *command = &args[i]; char *end; char *val; end = grub_strchr (command, ';'); if (end == 0) i = actual; /* No more commands after this one. */ else { *end = '\0'; i += end - command + 1; while (grub_isspace(args[i])) i++; } /* Process command. */ val = grub_strchr (command, '='); if (val) { *val = '\0'; grub_env_set (command, val + 1); } } } grub_install_get_time_ms (ieee1275_get_time_ms); }
void grub_machine_init (void) { grub_modbase = ALIGN_UP((grub_addr_t) _end + GRUB_KERNEL_MACHINE_MOD_GAP, GRUB_KERNEL_MACHINE_MOD_ALIGN); grub_ieee1275_init (); grub_console_init_early (); grub_claim_heap (); grub_console_init_lately (); grub_ofdisk_init (); grub_parse_cmdline (); #ifdef __i386__ grub_tsc_init (); #else grub_install_get_time_ms (grub_rtc_get_time_ms); #endif }