Changeset 201

Show
Ignore:
Timestamp:
01/26/07 10:55:51 (2 years ago)
Author:
ludo
Message:

small bug fixes. revoboot v1.31 (from r3955)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/client/src_revoboot/bios.c

    r99 r201  
    187187          if (! err) 
    188188            { 
    189               unsigned int t_sect,max_sect,min_sect; 
    190  
    191189              /* Set the LBA flag.  */ 
    192190              geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION; 
     
    203201                 change the type of TOTAL_SECTORS to unsigned long 
    204202                 long.  */ 
    205  
    206               max_sect= drp.sectors * drp.heads * (drp.cylinders+1); 
    207               min_sect= drp.total_sectors; 
    208  
    209 #ifdef DEBUG 
    210               printf("Start with : min = %d , max = %d\n",min_sect,max_sect); 
    211 #endif 
    212  
    213               if (max_sect>min_sect) 
    214               { 
    215               while (min_sect != max_sect) 
    216               { 
    217                         struct disk_address_packet 
    218                               { 
    219                                 unsigned char length; 
    220                                 unsigned char reserved; 
    221                                 unsigned short blocks; 
    222                                 unsigned long buffer; 
    223                                 unsigned long long block; 
    224                               } dap; 
    225  
    226                         t_sect=(max_sect+min_sect)/2; 
    227                         if (t_sect == min_sect) t_sect=max_sect;        // max=min+1 => last test with max 
    228  
    229                         dap.length = sizeof (dap); 
    230                         dap.block = t_sect; 
    231                         dap.blocks = 1; 
    232                         dap.reserved = 0; 
    233                         dap.buffer = SCRATCHSEG << 16; 
    234 #ifdef DEBUG 
    235                         grub_printf("Testing sector %d (%d-%d) : ",t_sect,min_sect,max_sect); 
    236 #endif 
    237                         err = biosdisk_int13_extensions (0x42, drive, &dap); 
    238 #ifdef DEBUG 
    239                         if (err) grub_printf("Failed\n"); 
    240                             else grub_printf("OK\n"); 
    241 #endif 
    242  
    243                         if (err) max_sect=(t_sect-1); 
    244                            else  min_sect=t_sect; 
    245               } 
    246               total_sectors= min_sect+1; 
    247               } 
     203                  
     204              if (drp.total_sectors) 
     205                total_sectors = drp.total_sectors & ~0L; 
    248206              else 
    249                total_sectors= min_sect; 
    250  
    251  
     207                /* Some buggy BIOSes doesn't return the total sectors 
     208                   correctly but returns zero. So if it is zero, compute 
     209                   it by C/H/S returned by the LBA BIOS call.  */ 
     210                total_sectors = drp.cylinders * drp.heads * drp.sectors; 
    252211            } 
    253212        } 
  • trunk/client/src_revoboot/builtins_lbs.c

    r108 r201  
    5555int new_get (char *file, int sect, int *endsect, int table); 
    5656 
     57/* to force a new inventory */ 
     58extern int done_inventory; 
    5759 
    5860void 
     
    273275        continue; 
    274276      /* verify that the disk is readable */ 
    275        
    276277      if (biosdisk (BIOSDISK_READ, current_drive, &geom, 0, 1, SCRATCHADDR)) 
    277278        {                                                        
     
    13471348  udp_close (); 
    13481349 
     1350  done_inventory = 0; 
    13491351  init_bios_info(); 
    13501352 
  • trunk/client/src_revoboot/builtins_lbs.h

    r99 r201  
    2121int identifyauto_func (char *arg, int flags); 
    2222int kbdfr_func (char *arg, int flags); 
     23 
     24/* macros */ 
     25#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) 
    2326 
    2427/* variables */ 
  • trunk/client/src_revoboot/common.c

    r108 r201  
    411411                    lbsname[i] = udp_packet_r[i]; 
    412412                } 
    413                 lbsname[sz] = 0; 
    414                 lbsname[31] = 0;         
     413                lbsname[MIN(sz,31)] = 0; 
    415414        } 
    416415        udp_close(); 
  • trunk/client/src_revoboot/config.h

    r108 r201  
    1010 
    1111#define PACKAGE "LinboxBootLoader" 
    12 #define VERSION "1.30
     12#define VERSION "1.31
  • trunk/client/src_revoboot/pxe.size

    r108 r201  
    1 9583
     19567