/[grub]/grub/stage2/disk_io.c
ViewVC logotype

Diff of /grub/stage2/disk_io.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53 by okuji, Wed Jan 15 21:44:19 2003 UTC revision 1.54 by okuji, Sun Oct 19 16:06:24 2003 UTC
# Line 1  Line 1 
1  /* disk_io.c - implement abstract BIOS disk input and output */  /* disk_io.c - implement abstract BIOS disk input and output */
2  /*  /*
3   *  GRUB  --  GRand Unified Bootloader   *  GRUB  --  GRand Unified Bootloader
4   *  Copyright (C) 1999,2000,2001,2002  Free Software Foundation, Inc.   *  Copyright (C) 1999,2000,2001,2002,2003  Free Software Foundation, Inc.
5   *   *
6   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 948  set_device (char *device) Line 948  set_device (char *device)
948        if (*device != ',' && *device != ')')        if (*device != ',' && *device != ')')
949          {          {
950            char ch = *device;            char ch = *device;
951    #ifdef SUPPORT_NETBOOT
952            if (*device == 'f' || *device == 'h' || *device == 'n')            if (*device == 'f' || *device == 'h' ||
953                  (*device == 'n' && network_ready))
954    #else
955              if (*device == 'f' || *device == 'h')
956    #endif /* SUPPORT_NETBOOT */
957              {              {
958                /* user has given '([fhn]', check for resp. add 'd' and                /* user has given '([fhn]', check for resp. add 'd' and
959                   let disk_choice handle what disks we have */                   let disk_choice handle what disks we have */
# Line 964  set_device (char *device) Line 968  set_device (char *device)
968                  return device + 2;                  return device + 2;
969              }              }
970    
971            if ((*device == 'f' || *device == 'h' || *device == 'n')  #ifdef SUPPORT_NETBOOT
972              if ((*device == 'f' || *device == 'h' ||
973                   (*device == 'n' && network_ready))
974    #else
975              if ((*device == 'f' || *device == 'h')
976    #endif /* SUPPORT_NETBOOT */
977                && (device += 2, (*(device - 1) != 'd')))                && (device += 2, (*(device - 1) != 'd')))
978              errnum = ERR_NUMBER_PARSING;              errnum = ERR_NUMBER_PARSING;
979    
980            if (ch == 'n')  #ifdef SUPPORT_NETBOOT
981              if (ch == 'n' && network_ready)
982              current_drive = NETWORK_DRIVE;              current_drive = NETWORK_DRIVE;
983            else            else
984    #endif /* SUPPORT_NETBOOT */
985              {              {
986                safe_parse_maxint (&device, (int *) &current_drive);                safe_parse_maxint (&device, (int *) &current_drive);
987                                
# Line 1326  print_completions (int is_filename, int Line 1337  print_completions (int is_filename, int
1337                if (! is_completion)                if (! is_completion)
1338                  grub_printf (" Possible disks are: ");                  grub_printf (" Possible disks are: ");
1339    
1340                for (i = (ptr && (*(ptr-2) == 'h' && *(ptr-1) == 'd') ? 1 : 0);  #ifdef SUPPORT_NETBOOT
1341                     i < (ptr && (*(ptr-2) == 'f' && *(ptr-1) == 'd') ? 1 : 2);                if (!ptr || *(ptr-1) != 'd' || *(ptr-2) != 'n')
1342                     i++)  #endif /* SUPPORT_NETBOOT */
1343                  {                  {
1344                    for (j = 0; j < 8; j++)                    for (i = (ptr && (*(ptr-1) == 'd' && *(ptr-2) == 'h') ? 1:0);
1345                           i < (ptr && (*(ptr-1) == 'd' && *(ptr-2) == 'f') ? 1:2);
1346                           i++)
1347                      {                      {
1348                        disk_no = (i * 0x80) + j;                        for (j = 0; j < 8; j++)
                       if ((disk_choice || disk_no == current_drive)  
                           && ! get_diskinfo (disk_no, &geom))  
1349                          {                          {
1350                            char dev_name[8];                            disk_no = (i * 0x80) + j;
1351                              if ((disk_choice || disk_no == current_drive)
1352                                  && ! get_diskinfo (disk_no, &geom))
1353                                {
1354                                  char dev_name[8];
1355    
1356                            grub_sprintf (dev_name, "%cd%d", i ? 'h' : 'f', j);                                grub_sprintf (dev_name, "%cd%d", i ? 'h':'f', j);
1357                            print_a_completion (dev_name);                                print_a_completion (dev_name);
1358                                }
1359                          }                          }
1360                      }                      }
1361                  }                  }
   
1362  # ifdef SUPPORT_NETBOOT  # ifdef SUPPORT_NETBOOT
1363                if (network_ready)                if (network_ready &&
1364                      (disk_choice || NETWORK_DRIVE == current_drive) &&
1365                      (!ptr || *(ptr-1) == '(' ||
1366                       (*(ptr-1) == 'd' && *(ptr-2) == 'n')))
1367                  print_a_completion ("nd");                  print_a_completion ("nd");
1368  # endif /* SUPPORT_NETBOOT */  # endif /* SUPPORT_NETBOOT */
1369    

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26