diff --git a/ChangeLog b/ChangeLog index adac95218..4aa8c9dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-08-09 OKUJI Yoshinori + + * 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 * stage2/stage2.c (run_menu): Terminate the string PASSWORD diff --git a/stage2/cmdline.c b/stage2/cmdline.c index 97a61a381..5e0517cf1 100644 --- a/stage2/cmdline.c +++ b/stage2/cmdline.c @@ -68,6 +68,7 @@ char commands[] = " Possible commands are: \"pause= ...\", \"uppermem= \", \"root= \", \"rootnoverify= \", \"chainloader= \", \"kernel= ...\", \"testload= \", \"read= \", \"displaymem\", \"impsprobe\", + \"geometry= \", \"fstest\", \"debug\", \"module= ...\", \"modulenounzip= ...\", \"color= []\", \"makeactive\", \"boot\", \"quit\" and \"install= [d] [p] []\"\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;