add geometry command
This commit is contained in:
parent
4d1186c003
commit
d52edd8638
2 changed files with 34 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
1999-08-09 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||
|
||||
* stage2/cmdline.c (commands): Added geometry.
|
||||
(enter_cmdline): If CUR_HEAP has the string "geometry", print
|
||||
out the information about a drive that the argument represents.
|
||||
|
||||
1999-08-09 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||
|
||||
* stage2/stage2.c (run_menu): Terminate the string PASSWORD
|
||||
|
|
|
@ -68,6 +68,7 @@ char commands[] =
|
|||
" Possible commands are: \"pause= ...\", \"uppermem= <kbytes>\", \"root= <device>\",
|
||||
\"rootnoverify= <device>\", \"chainloader= <file>\", \"kernel= <file> ...\",
|
||||
\"testload= <file>\", \"read= <addr>\", \"displaymem\", \"impsprobe\",
|
||||
\"geometry= <drive>\",
|
||||
\"fstest\", \"debug\", \"module= <file> ...\", \"modulenounzip= <file> ...\",
|
||||
\"color= <normal> [<highlight>]\", \"makeactive\", \"boot\", \"quit\" and
|
||||
\"install= <stage1_file> [d] <dest_dev> <file> <addr> [p] [<config_file>]\"\n";
|
||||
|
@ -661,6 +662,33 @@ returnit:
|
|||
grub_printf (" The quit command is ignored in Stage2\n");
|
||||
#endif
|
||||
}
|
||||
else if (substring ("geometry", cur_heap) < 1)
|
||||
{
|
||||
set_device (cur_cmdline);
|
||||
|
||||
if (! errnum)
|
||||
{
|
||||
struct geometry geom;
|
||||
|
||||
if (get_diskinfo (current_drive, &geom))
|
||||
errnum = ERR_NO_DISK;
|
||||
else
|
||||
{
|
||||
char *msg;
|
||||
|
||||
if (geom.flags & BIOSDISK_FLAG_LBA_EXTENSION)
|
||||
msg = "LBA";
|
||||
else
|
||||
msg = "CHS";
|
||||
|
||||
grub_printf ("drive 0x%x: C/H/S = %d/%d/%d, "
|
||||
"The number of sectors = %d, %s\n",
|
||||
current_drive,
|
||||
geom.cylinders, geom.heads, geom.sectors,
|
||||
geom.total_sectors, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (*cur_heap && *cur_heap != ' ')
|
||||
errnum = ERR_UNRECOGNIZED;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue