add a new command, displayapm.

This commit is contained in:
okuji 2000-10-19 22:32:52 +00:00
parent 1f2d29244a
commit f5588d2f41
3 changed files with 52 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2000-10-20 OKUJI Yoshinori <okuji@gnu.org>
* stage2/builtins.c (displayapm_func): New function.
(builtin_displayapm): New variable.
(builtin_table): Added a pointer to BUILTIN_DISPLAYAPM.
2000-10-20 OKUJI Yoshinori <okuji@gnu.org>
APM BIOS table support is added, based on a patch by Matt Yourst

5
NEWS
View file

@ -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".

View file

@ -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,