Changeset 32 for trunk/TOOLS/OS2


Ignore:
Timestamp:
Jan 13, 2013, 8:46:36 AM (13 years ago)
Author:
Ben Rietbroek
Message:

Fixed Win7 boot from FAT32 and HPFS zero-drive ussue [2011-11-20]

Fixes

o Fixed booting Windows 7 from FAT32

Booting Windows (NT/2K/XP/Vista/7) from FAT32 when the actual system
resides on an NTFS partition actually chainload the Windows
boot-loader in the FAT32 partition.
A bug in the handling of such a FAT32 partition with the Windows
boot-loader caused it not to find NTLDR is some cases.

o Fixed HPFS zero-drive issue

The BPB contains a field that indicates the boot-drive to the
OS2BOOT and OS2LDR programs. When creating an HPFS partition and
then restoring a system from archive (i.e. a zip-file) of course
does not set this field, since only files are restored.
This causes the boot process to halt with "...cannot operate..."
or even boot another HPFS partition. This field is now derived from
the LVM drive-letter if it contains an incorrect value.

o Corrected CRC calculations on AiR-BOOT configuration

V1.07 expanded the number of partitions from 30 to 45.
However, this was not done correctly and the configuration CRC was
still caclulated over 5 sectors. Initial v1.0.8 code corrected this
but this results in the v1.07 installer and setaboot programs
breaking on v1.0.8 code. So, for the time being the CRC caclucation
is reverted back to 5 sectors for the sake of v1.07 compatibility.
Save and restore of the configuration use 7 sectors of course.

o Corrected contact information

V1.07 shipped with the wrong contact information, causing issues
to be reported on sourceforge instead of netlabs.

Changes

o Renamed original README.TXT to README.MKW
o Added 1README.TXT
o Added COPYING (GNU License)

Note

This commit and all following commits upto and including the RC3
commit [2012-09-09] are delayed commits from a local repository.
Also, the RC (Release Candidate) naming of the corresponding commits
is a bit misleading. One would label a revision with RC when near to
a final release. Since many things have changed between RC1,RC2 & RC3,
these RC's should be interpreted as mile-stones.

WARNING!!

All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can destroy the MBR on all attached disks!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE ABOVE COMMITS!!

Location:
trunk/TOOLS/OS2/SETABOOT
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/TOOLS/OS2/SETABOOT/SETABOOT.C

    r30 r32  
    143143#define AiRBOOTIPENTRY_Flags_BootAble       0x01
    144144
    145 CHAR            Track0[60*512];      // Space for Track-0
     145CHAR            Track0[62*512];      // Space for Track-0
    146146PAiRBOOTCODESIG AiRBOOT_CodeSig = 0;
    147147PAiRBOOTCONFIG  AiRBOOT_Config = 0;
     
    189189   BOOL Track0Load (void) {
    190190      USHORT      IOCTLHandle;
    191       ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(60-1);
     191      ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(62-1);
    192192      TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen);
    193193      ULONG       cbParms = sizeof(TrackLayoutPtr);
     
    202202      TrackLayoutPtr->usCylinder    = 0;
    203203      TrackLayoutPtr->usFirstSector = 0;
    204       TrackLayoutPtr->cSectors      = 60;
    205 
    206       for (i=0; i<60; i++) {
     204      TrackLayoutPtr->cSectors      = 62;
     205
     206      for (i=0; i<62; i++) {
    207207         TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1;
    208208         TrackLayoutPtr->TrackTable[i].usSectorSize   = 512;
     
    219219   BOOL Track0Write (void) {
    220220      USHORT      IOCTLHandle;
    221       ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(60-1);
     221      ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(62-1);
    222222      TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen);
    223223      ULONG       cbParms = sizeof(TrackLayoutPtr);
     
    233233      TrackLayoutPtr->usCylinder    = 0;
    234234      TrackLayoutPtr->usFirstSector = 0;
    235       TrackLayoutPtr->cSectors      = 60;
    236 
    237       for (i=0; i<60; i++) {
     235      TrackLayoutPtr->cSectors      = 62;
     236
     237      for (i=0; i<62; i++) {
    238238         TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1;
    239239         TrackLayoutPtr->TrackTable[i].usSectorSize   = 512;
     
    311311// If AiR-BOOT is not installed, the user probably meant to control OS/2 BM with this utility.
    312312// Since the functionality of this utility is for AiR-BOOT only, we will pass the request to
    313 // the OS/2 BM SETBOOT utility which is called SETBM.EXE as of eCS 2.01.
     313// the OS/2 BM SETBOOT utility which is called SETBM.EXE as of eCS 2.1.
    314314// Since the objective here is to supply OS/2 BM SETBOOT compatibility, if SETBM.EXE is not found,
    315315// some other system locations are searched for the OS/2 version of SETBOOT.EXE.
     
    321321   APIRET      rc             = -1;
    322322   RESULTCODES  crc                        = {-1,-1};
    323    PTIB        ptib           = NULL;
    324    PPIB        ppib           = NULL;
     323//   PTIB        ptib           = NULL;
     324//   PPIB        ppib           = NULL;
    325325   char        buffer[256]    = "\0";
    326326   char        cmdline[256]   = "\0";
     
    453453   BOOL            XWPEntryFound    = FALSE;
    454454   BOOL            CDBoot           = FALSE;                                     // TRUE if booted from CD; New System will be added when using /4:"LABEL"
    455    BOOL            Track0Loaded     = FALSE;                                     // Assume track0 did not load correctly.
     455//   BOOL            Track0Loaded     = FALSE;                                     // Assume track0 did not load correctly.
    456456   BOOL            AiRBOOTBad       = FALSE;
    457457
     
    472472   */
    473473   //puts ("SETABOOT - AiR-BOOT Configuration Utility (OS/2) - (c) 2004-2009 by M. Kiewitz");
    474    puts ("SETABOOT v1.07 - AiR-BOOT Configuration Utility - (c) 2004-2011 by M. Kiewitz");
     474   puts ("SETABOOT v1.07a - AiR-BOOT Configuration Utility - (c) 2004-2011 by M. Kiewitz");
    475475
    476476
     
    942942   // Calculate CheckSum...
    943943   ResultCheck = 0; CurSectorNo = 55;
    944    while (CurSectorNo<60) {
     944   while (CurSectorNo<62) {
    945945      ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo);
    946946      CurSectorNo++;
     
    965965   // Calculate CheckSum...
    966966   ResultCheck = 0; CurSectorNo = 55;
     967
     968   /*
     969   // Rousseau: # Keep compatible with v1.07 CRC #
     970   // AB v1.07 had bugs in writing the wrong number of AB config sectors.
     971   // This is fixed in v1.0.8 but the CRC has to be calculated the "v1.07 way"
     972   // otherwise v1.07 SET(A)BOOT and INSTALL2.EXE will think the AB config
     973   // is corrupted.
     974   // So the CRC is calculated over 5 sectors instead of 7.
     975   */
    967976   while (CurSectorNo<60) {
    968977      ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo);
  • trunk/TOOLS/OS2/SETABOOT/_build.cmd

    r30 r32  
    55
    66'ide2make '||debug||' -p SETABOOT.WPJ';
    7 'wmake -f SETABOOT.MK';
     7'wmake -h -f SETABOOT.MK';
Note: See TracChangeset for help on using the changeset viewer.