From f5588d2f411405c7ac87a58545484101136ea157 Mon Sep 17 00:00:00 2001 From: okuji Date: Thu, 19 Oct 2000 22:32:52 +0000 Subject: [PATCH] add a new command, displayapm. --- ChangeLog | 6 ++++++ NEWS | 5 +++-- stage2/builtins.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61b3cedc3..3a339117d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-10-20 OKUJI Yoshinori + + * stage2/builtins.c (displayapm_func): New function. + (builtin_displayapm): New variable. + (builtin_table): Added a pointer to BUILTIN_DISPLAYAPM. + 2000-10-20 OKUJI Yoshinori APM BIOS table support is added, based on a patch by Matt Yourst diff --git a/NEWS b/NEWS index a452d6e51..b89628bdb 100644 --- a/NEWS +++ b/NEWS @@ -7,9 +7,10 @@ New in 1.0 - XXXX-XX-XX: * The utility ``grub-install'' accepts a new option, `--recheck'. If this option is specified, probe a device map, even if it already exists. You should use this option whenever you add/remove a disk. -* The command "password" supports md5 passwords if the option `--md5' +* The command "password" supports a md5 password if the option `--md5' is given. This command can now also be used to protect specific menu - items with their own password. + items with their own passwords. +* New command, "displayapm". New in 0.5.96 - 2000-10-04: * New commands, "reboot" and "halt". diff --git a/stage2/builtins.c b/stage2/builtins.c index a2fb187be..44720778c 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -826,6 +826,48 @@ static struct builtin builtin_dhcp = }; #endif /* SUPPORT_NETBOOT */ + +/* displayapm */ +static int +displayapm_func (char *arg, int flags) +{ + if (mbi.flags & MB_INFO_APM_TABLE) + { + grub_printf ("APM BIOS information: + Version: 0x%x + 32-bit CS: 0x%x + Offset: 0x%x + 16-bit CS: 0x%x + 16-bit DS: 0x%x + 32-bit CS length: 0x%x + 16-bit CS length: 0x%x + 16-bit DS length: 0x%x\n", + (unsigned) apm_bios_info.version, + (unsigned) apm_bios_info.cseg, + apm_bios_info.offset, + (unsigned) apm_bios_info.cseg_16, + (unsigned) apm_bios_info.dseg_16, + (unsigned) apm_bios_info.cseg_len, + (unsigned) apm_bios_info.cseg_16_len, + (unsigned) apm_bios_info.dseg_16_len); + } + else + { + grub_printf ("No APM BIOS found or probe failed\n"); + } + + return 0; +} + +static struct builtin builtin_displayapm = +{ + "displayapm", + displayapm_func, + BUILTIN_CMDLINE, + "displayapm", + "Display APM BIOS information." +}; + /* displaymem */ static int @@ -4057,6 +4099,7 @@ struct builtin *builtin_table[] = #ifdef SUPPORT_NETBOOT &builtin_dhcp, #endif /* SUPPORT_NETBOOT */ + &builtin_displayapm, &builtin_displaymem, &builtin_embed, &builtin_fallback,