Changeset 47


Ignore:
Timestamp:
Apr 12, 2014, 11:24:51 AM (11 years ago)
Author:
Ben Rietbroek
Message:

Fixed Installer to handle packed hideparttable [2012-04-23]

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 THESE COMMITS!!

Changes

o Installer can now handle packed hideparttable
o Implemented upgrading from v1.06 directly to v1.0.8
o Fixed minor stuff when upgrading from v1.06 to v1.07
o Implemented DOS code in C cross-platform installer

There is now one C source for 4 platforms:
DOS,WIN32,OS2 and LINUX (Linux portion not ready yet)
This obsoletes AIRBOOT.ASM/AIRBOOT.COM.
DOS Installer is now AIRBOOTD.EXE.

o This commit is prepairing for v1.0.8-rc2

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/.build

    r46 r47  
    33export ASM=jwasm
    44make dev
     5make dist
  • trunk/BOOTCODE/AIR-BOOT.ASM

    r46 r47  
    13161316                ;
    13171317                ; Critical end of code marker.
    1318                 ;
    1319                 db  'DEAD'
    1320                 db  'FACE'
     1318                ; Should always be in the image, otherwise something
     1319                ; is very wrong.
     1320                ;
     1321                db      'DEAD'
     1322                db      'FACE'
    13211323
    13221324;
     
    13411343
    13421344; If we are debugging, we overwrite the FX code.
    1343 ; As long as no FX is disabled this will do no harm.
     1345; As long as FX is disabled this will do no harm.
    13441346IFDEF   AUX_DEBUG
    13451347                ORG     06780h
    13461348ENDIF
     1349
    13471350
    13481351bld_level:
     
    13531356                ; It is unique for each release of AiR-BOOT.
    13541357                ;
     1358                ; ?? When AUX_DEBUG is enabled and the above org is active,
     1359                ; the BLDLEVEL gets corrupted eventhough it gets inserted here
     1360                ; explicitly. The effect is almost like an 'OR' or a merge
     1361                ; with the already generated FX code.
     1362                ; Tasm and JWasm produce different results.
     1363                ; ??
     1364                ;
    13551365                InsertBuildLevel
    13561366
     1367                ;bliep <>
     1368
    13571369                ;
    13581370                ; End of code marker.
     1371                ; If this one vanishes in the image, the FX code will not
     1372                ; be operational.
     1373                ; Will happen with debugging enabled.
    13591374                ;
    13601375                db      'BABE'
     
    13711386                ORIGIN  06800h
    13721387
     1388zzz_code_space = $ - code_end
    13731389                ;
    13741390                ; This is the AiR-BOOT MBR-Protection Image.
  • trunk/BOOTCODE/AIR-BOOT.HIS

    r46 r47  
    2323; Rousseau: Fixes and Enhancements
    2424; ---------------------------------
    25 ; v1.0.8-rc2-bld201204??+
    26 ; ---------------------
    27 
    28 
     25;
     26; v1.0.8-rc2-bld2012042?
     27; ----------------------
     28; # Fixed Installer to handle packed hideparttable #
     29;   Hide partition configuration is now preserved when upgrading
     30;   Implemented upgrading from v1.06 to v1.0.8
     31;   Implemented upgrading from v1.07 to v1.0.8
     32;
     33; # Implemented DOS code in C cross-platform installer
     34;   There is now one C source for 4 platforms:
     35;   DOS,WIN32,OS2 and LINUX (Linux portion not ready yet)
     36;   This obsoletes AIRBOOT.ASM/AIRBOOT.COM.
     37;   DOS Installer is now AIRBOOTD.EXE.
     38;
    2939; v1.0.8-pre-rc2-bld20120330
    3040; --------------------------
  • trunk/BOOTCODE/BLDLEVEL.INC

    r46 r47  
    5050
    5151
     52
     53;~ bliep   struct
     54    ;~ db  '@#'
     55    ;~ db  BLDLVL_VENDOR
     56    ;~ db  ':'
     57    ;~ db  BLDLVL_MAJOR_VERSION
     58    ;~ db  '.'
     59    ;~ db  BLDLVL_MIDDLE_VERSION
     60    ;~ db  '.'
     61    ;~ db  BLDLVL_MINOR_VERSION
     62    ;~ db  '#@##1## '
     63;~ bld_level_date_start    db  BLDLVL_YEAR
     64    ;~ db  '/'
     65    ;~ db  BLDLVL_MONTH
     66    ;~ db  '/'
     67    ;~ db  BLDLVL_DAY
     68    ;~ db  ' '
     69    ;~ db  BLDLVL_HOURS
     70    ;~ db  ':'
     71    ;~ db  BLDLVL_MINUTES
     72    ;~ db  ':'
     73    ;~ db  BLDLVL_SECONDS
     74;~ bld_level_date_end    db  '      '
     75    ;~ db  BLDLVL_MACHINE
     76    ;~ db  '::'
     77    ;~ ; Wasm can only process the reference to 'lang' in pass 2 because it comes
     78    ;~ ; from an included file which it has not processed yet at pass 1.
     79    ;~ IFDEF   WASM
     80        ;~ IF2
     81            ;~ db  BLDLVL_LANGUAGE
     82        ;~ ENDIF
     83    ;~ ; The other assemblers process 'lang' correctly in pass 1.
     84    ;~ ELSE
     85        ;~ db  BLDLVL_LANGUAGE
     86    ;~ ENDIF
     87    ;~ db  '::'
     88    ;~ db  BLDLVL_MINOR_VERSION
     89    ;~ db  '::@@'
     90    ;~ db  BLDLVL_DESCRIPTION
     91    ;~ db  0
     92;~ bliep   ends
     93
     94
    5295;
    5396; This macro inserts the BLDLEVEL string at the place where it is invoked.
  • trunk/BOOTCODE/Makefile

    r46 r47  
    105105# will run out-of-space sooner that the other languages.
    106106# If that happens at least the others will be built.
    107 BLD_LANGUAGES=EN DE NL FR IT SW #RU
     107BLD_LANGUAGES=EN DE NL FR IT SW RU
    108108#BLD_LANGUAGES=EN DE NL
    109109
  • trunk/BOOTCODE/REGULAR/DEBUG.ASM

    r46 r47  
    426426db_curlvmsec        db 'Current LVM Sector:',0
    427427
     428
     429drive                   db 'drive                    : ',0
     430before_lvm_adjust       db 'before lvm adjust        : ',0
     431after_lvm_adjust        db 'after lvm adjust         : ',0
     432before_lvm_adjust_log   db 'before lvm logical adjust: ',0
     433after_lvm_adjust_log    db 'after lvm logical adjust : ',0
     434spt_used                db 'spt used                 : ',0
  • trunk/BOOTCODE/REGULAR/DRIVEIO.ASM

    r46 r47  
    248248
    249249            ; Dump drive
    250             mov      si,offset drive
     250            ;mov      si,offset drive
    251251            ;call     AuxIO_Print
    252             xchg     al,dl
     252            ;xchg     al,dl
    253253            ;call     AuxIO_TeletypeHexByte
    254254            ;call     AuxIO_TeletypeNL
    255             xchg     dl,al
     255            ;xchg     dl,al
    256256
    257257            ; Dump SPT
    258             mov      si,offset spt_used
     258            ;mov      si,offset spt_used
    259259            ;call     AuxIO_Print
    260260            push     dx
     
    300300
    301301            ; LBA
    302             mov     si,offset before_lvm_adjust
     302            ;mov     si,offset before_lvm_adjust
    303303            ;call    AuxIO_Print
    304304
    305             xchg    dx,bx
     305            ;xchg    dx,bx
    306306            ;call    AuxIO_TeletypeHexDWord
    307307            ;call    AuxIO_TeletypeNL
    308             xchg    bx,dx
     308            ;xchg    bx,dx
    309309        popa
    310310
     
    317317
    318318
    319         pusha
    320             mov      si,offset before_lvm_adjust_log
     319        ;pusha
     320            ;mov      si,offset before_lvm_adjust_log
    321321            ;call     AuxIO_Print
    322322            ; LBA
    323             xchg     dx,bx
     323            ;xchg     dx,bx
    324324            ;call     AuxIO_TeletypeHexDWord
    325325            ;call     AuxIO_TeletypeNL
    326             xchg     bx,dx
    327         popa
     326            ;xchg     bx,dx
     327        ;popa
    328328
    329329
     
    346346
    347347
    348         pusha
    349             mov     si,offset after_lvm_adjust_log
     348        ;pusha
     349            ;mov     si,offset after_lvm_adjust_log
    350350            ;call    AuxIO_Print
    351351            ; LBA
    352             xchg    dx,bx
     352            ;xchg    dx,bx
    353353            ;call    AuxIO_TeletypeHexDWord
    354354            ;call    AuxIO_TeletypeNL
    355             xchg    bx,dx
    356         popa
     355            ;xchg    bx,dx
     356        ;popa
    357357
    358358        jmp      done
     
    427427    done:
    428428
    429         pusha
    430             mov     si,offset after_lvm_adjust
     429        ;pusha
     430            ;mov     si,offset after_lvm_adjust
    431431            ;~ call    AuxIO_Print
    432432            ; LBA
    433             xchg    dx,bx
     433            ;xchg    dx,bx
    434434            ;~ call    AuxIO_TeletypeHexDWord
    435435            ;~ call    AuxIO_TeletypeNL
    436             xchg    bx,dx
    437         popa
     436            ;xchg    bx,dx
     437        ;popa
    438438
    439439        ;~ pusha
     
    466466
    467467
    468 drive                   db 'drive                    : ',0
    469 before_lvm_adjust       db 'before lvm adjust        : ',0
    470 after_lvm_adjust        db 'after lvm adjust         : ',0
    471 before_lvm_adjust_log   db 'before lvm logical adjust: ',0
    472 after_lvm_adjust_log    db 'after lvm logical adjust : ',0
    473 spt_used                db 'spt used                 : ',0
    474468
    475469
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r46 r47  
    5555             db BLDLVL_MINOR_VERSION,' - (c) '
    5656             db BLDLVL_YEAR
    57              db ' M. Kiewitz  <<Internal Release 2p>> (bld: '
     57             db ' M. Kiewitz  <<Internal Release 2q>> (bld: '
    5858             db BLDLVL_YEAR
    5959             db BLDLVL_MONTH
  • trunk/BOOTCODE/VERSION.INC

    r46 r47  
    1717AB_YEAR             EQU     2012h
    1818AB_MONTH            EQU     04h
    19 AB_DAY              EQU     14h
     19AB_DAY              EQU     21h
    2020
    2121; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
    22 AB_HOURS            EQU     01h
    23 AB_MINUTES          EQU     30h
     22AB_HOURS            EQU     08h
     23AB_MINUTES          EQU     35h
    2424AB_SECONDS          EQU     00h
    2525
  • trunk/BOOTCODE/_build.cmd

    r46 r47  
    11@SET ASM=tasm
    22@wmake dev
     3@wmake dist
  • trunk/INSTALL/C/.build

    r46 r47  
    33make clean
    44make
     5make dist
  • trunk/INSTALL/C/INSTALL.C

    r46 r47  
    2929
    3030
    31 //CHAR     Track0[SECTOR_COUNT * BYTES_PER_SECTOR];                                  // current track 0 from harddrive
    32 //CHAR     Bootcode[SECTOR_COUNT * BYTES_PER_SECTOR];                                // bootcode image from airboot.bin
     31//CHAR     Track0[SECTOR_COUNT * BYTES_PER_SECTOR];     // current track 0 from harddrive
     32//CHAR     Bootcode[SECTOR_COUNT * BYTES_PER_SECTOR];   // bootcode image from airboot.bin
    3333
    3434/*
    3535// With the addition of the C DOS-version, a static buffer for both
    36 // Track0 and Bootcode would overflow the DGROUP segment.
    37 // Placing the buffers in another segment would increase the executable
    38 // image on disk, so we would like it to be (FAR) BSS data.
     36// Track0 and Bootcode would overflow the DGROUP segment. (>64kB)
     37// Placing the buffers in another segment does not work with Open Watcom v1.9.
     38// While the buffers are BSS and should be in segments like FAR_BSS,
     39// Open Watcom places the buffers in FAR_DATA and produces a bloated DOS
     40// executable. Using the same source and then building an OS/2 v1.x
     41// executable does not produce a bloated .EXE, eventhough the segments are
     42// called FAR_DATA and in the middle of the image.
     43// Microsoft C v6.0 displays the same behavior; DOS bloated, OS/2 v1.x ok.
     44// An interesting feat is that when building an OS/2 v1.x executable and then
     45// binding that to produce a FAPI executable does not produce a bloated .EXE
    3946//
    40 // When experimenting with segments and #pragma data_seg(), some
     47// Also, when experimenting with segments and #pragma data_seg(), some
    4148// strange behavior was observed.
    4249// WCC:
    4350// Explicitly naming a segment and class for the static buffers caused
    44 // wcc to generate it's default SS: based addressing.
    45 // Only the -zu flag corrects this.
     51// wcc to keep generating it's default SS: based addressing, eventhough
     52// the segments are not part of DGROUP.
     53// Only the -zu flag corrects this. (DS!=SS)
    4654// WPP:
    4755// C++ wpp used correct addressing but the segment class in the #pragma
     
    4957//
    5058// In both cases the volatile (transient) data would occupy space in the
    51 // disk-image because.
     59// disk-image.
    5260// The only way seems to be putting the buffers in a separate segment using
    5361// pragma's, using wcc with the -zu flag and use the wlink ORDER directive
    5462// to place the FAR BSS data above the stack acompanied by a NOEMIT modifier.
    5563// For this all the class names of the previous segments must be included
    56 // in the wlink ORDER directive which would make the link phase dependent
     64// in the wlink ORDER directive which would make the link phase dependend
    5765// on segment names. This solution does not work for wpp because it mangles
    5866// the segment name and overrides the custom class name to FAR_DATA.
    5967//
    6068// So, these buffers are now dynamically allocated.
    61 // Currently they are only freed after succesful program termination,
    62 // but the RTS should free them in other situations.
    63 // This will be corrected later.
    6469*/
    6570PCHAR   Track0      = NULL;     // Buffer for Track0 from harddisk.
     
    8994PSZ     ImpossibleCause         = NULL;
    9095
    91 
     96CHAR    TempHidPartTable[45 * 34];
    9297
    9398
     
    198203// hideparttable. A 'record' in the hideparttable is 34 bytes long and it
    199204// can store 45 partition numbers using 6-bits per partition number.
    200 // Bitfield widths from 1 to 8 are supported and the maxumum buffersize is
     205// Bitfield widths from 1 to 8 are supported and the maximum buffersize is
    201206// 256 bytes.
    202207*/
    203208char    get_bitfield(char* buffer, char index, char fieldwidth) {
     209    char    rv = 0;
    204210    // These are used to break-up the far pointer in large-data model 16-bit
    205211    // code so the buffer can be addressed correctly.
     
    285291        mov     ah,ch       ; Get mask in AH.
    286292        and     al,ah       ; Mask value.
    287         ;ret
    288293    }
    289294
     
    291296    // Epilog code.
    292297    // Restore caller's DS.
     298    // Store return value.
    293299    _asm {
    294300        pop     ds
    295     }
    296 
    297     return;
     301        mov     [rv],al
     302    }
     303
     304    return rv;
    298305}
    299306
     
    306313// hideparttable. A 'record' in the hideparttable is 34 bytes long and it
    307314// can store 45 partition numbers using 6-bits per partition number.
    308 // Bitfield widths from 1 to 8 are supported and the maxumum buffersize is
     315// Bitfield widths from 1 to 8 are supported and the maximum buffersize is
    309316// 256 bytes.
    310317*/
     
    439446        mov     ah,ch       ; Get mask in AH.
    440447        and     al,ah       ; Mask value.
    441         ;ret
    442448    }
    443449
     
    469475    USHORT CountHarddrives (void) {
    470476        USHORT NumDrives = 0;
    471         // Implement !
     477        /* Return the byte at 0040:0075 that contains the nr. of harddisks */
     478        _asm {
     479            push    es              ; We use ES to address the 40h segment.
     480            mov     ax,40h          ; Segment address of DOS BIOS DATA.
     481            mov     es,ax           ; Make ES address it.
     482            xor     ax,ax           ; Clear AX to receive return value.
     483            mov     al,es:[0075h]   ; Nr. of harddisks in AL.
     484            pop     es              ; Restore ES.
     485            mov     [NumDrives],ax  ; Return this value.
     486        }
    472487        return NumDrives;
    473488    }
    474489
    475     USHORT OS2_GetIOCTLHandle () {
    476         USHORT IOCTLHandle = 0;
    477         // Implement !
    478         return IOCTLHandle;
    479     }
    480 
    481     void OS2_FreeIOCTLHandle (USHORT IOCTLHandle) {
    482         // Implement !
     490    BOOL HarddriveCheckGeometry (void) {
     491        BOOL    rv = FALSE;
     492        _asm {
     493            ; According to Ralf Brown ES:DI=0000:0000 to avoid BIOS quirks.
     494            push    es
     495            push    di
     496            xor     di,di
     497            mov     es,di
     498
     499            ; Get the disk parameters using normal (non-I13X) access.
     500            mov     ah,08h          ; Get Disk Parameters.
     501            mov     dl,80h          ; Boot Disk.
     502            int     13h             ; Transfer to BIOS.
     503
     504            ; Check for errors
     505            mov     dx,0            ; Assume error.
     506            jc      end             ; CY if error.
     507            test    ah,ah           ; Double check for return-status.
     508            jnz     end             ; AH non-zero if error.
     509
     510            ; Check sectors per track to be above 62
     511            and     cl,00111111b    ; Mask sectors.
     512            cmp     cl,SECTOR_COUNT ; Compare with max. AiR-BOOT sectors.
     513            jbe     end             ; SECTOR_COUNT or less is not enough.
     514
     515            inc     dx              ; Set to no error.
     516
     517        end:
     518            mov     ax,dx           ; Status to AX.
     519            xor     dx,dx           ; High word to zero.
     520
     521            ; Store in return value (OS/2 BOOL is 32-bits).
     522            mov     word ptr [rv],ax
     523            mov     word ptr [rv+2],dx
     524
     525            ; Restore ES:DI
     526            pop     di
     527            pop     es
     528        }
     529
     530        return rv;
     531    }
     532
     533
     534
     535    BOOL Track0Load (void) {
     536        BOOL        Success = FALSE;
     537
     538        _asm {
     539
     540            push    es              ; ES is used to point to loadbuffer.
     541
     542            ; Load the complete AiR-BOOT image from Track0.
     543            mov     ah,02h          ; Read sectors from disk.
     544            mov     al,SECTOR_COUNT ; Number of sectors to read.
     545            mov     cx,1            ; Cyl 0, Sector 1.
     546            mov     dh,0            ; Head 0.
     547            mov     dl,80h          ; Boot Disk.
     548            les     bx,[Track0]     ; Buffer in ES:BX.
     549            int     13h             ; Transfer to BIOS.
     550
     551            ; Check for errors
     552            mov     dx,0            ; Assume error.
     553            jc      end             ; CY if error.
     554            test    ah,ah           ; Double check status in AH.
     555            jnz     end             ; AH non-zero if error.
     556
     557            inc     dx              ; Set to no error.
     558
     559        end:
     560            mov     ax,dx           ; Status to AX.
     561            xor     dx,dx           ; High word to zero.
     562
     563            ; Store in return value (OS/2 BOOL is 32-bits).
     564            mov     word ptr [Success],ax
     565            mov     word ptr [Success+2],dx
     566
     567            ; Restore ES.
     568            pop     es
     569        }
     570
     571        return Success;
     572    }
     573
     574    BOOL Track0Write (void) {
     575        BOOL        Success = FALSE;
     576
     577        _asm {
     578
     579            push    es              ; ES is used to point to savebuffer.
     580
     581            ; Save the complete AiR-BOOT image to Track0.
     582            mov     ah,03h          ; Write sectors to disk.
     583            mov     al,SECTOR_COUNT ; Number of sectors to write.
     584            mov     cx,1            ; Cyl 0, Sector 1.
     585            mov     dh,0            ; Head 0.
     586            mov     dl,80h          ; Boot Disk.
     587            les     bx,[Track0]     ; Buffer in ES:BX.
     588            int     13h             ; Transfer to BIOS.
     589
     590            ; Check for errors
     591            mov     dx,0            ; Assume error.
     592            jc      end             ; CY if error.
     593            test    ah,ah           ; Double check status in AH.
     594            jnz     end             ; AH non-zero if error.
     595
     596            inc     dx              ; Set to no error.
     597
     598        end:
     599            mov     ax,dx           ; Status to AX.
     600            xor     dx,dx           ; High word to zero.
     601
     602            ; Store in return value (OS/2 BOOL is 32-bits).
     603            mov     word ptr [Success],ax
     604            mov     word ptr [Success+2],dx
     605
     606            ; Restore ES.
     607            pop     es
     608        }
     609
     610        return Success;
     611    }
     612
     613    void RebootSystem (void) {
     614        _asm {
     615            ; 65 * 65536 = 4259840 us = 4.2 sec.
     616            mov     ax,8600h        ; BIOS Wait.
     617            xor     dx,dx           ; Micro seconds Low.
     618            mov     cx,65           ; Micro seconds High.
     619            int     15h             ; Transfer to BIOS.
     620
     621            //~ ; Try reboot via keyboard.
     622            //~ mov     al,0feh
     623            //~ out     64h,al
     624
     625            ; Otherwise jump to F000:FFF0.
     626            db      0EAh
     627            dw      0FFF0h
     628            dw      0F000h
     629        }
    483630        return;
    484     }
    485 
    486 
    487     BOOL HarddriveCheckGeometry (void) {
    488         USHORT               IOCTLHandle;
    489 
    490         IOCTLHandle = OS2_GetIOCTLHandle();
    491         // Implement !
    492         return FALSE;
    493     }
    494 
    495     BOOL Track0Load (void) {
    496         USHORT      IOCTLHandle;
    497         BOOL        Success = FALSE;
    498 
    499         IOCTLHandle = OS2_GetIOCTLHandle();
    500         // Implement !
    501         return Success;
    502     }
    503 
    504     BOOL Track0Write (void) {
    505         USHORT      IOCTLHandle;
    506         BOOL        Success = FALSE;
    507 
    508         IOCTLHandle = OS2_GetIOCTLHandle();
    509         // Implement !
    510         return Success;
    511     }
    512 
    513     void RebootSystem (void) {
    514 
    515         // Implement !
    516631    }
    517632
     
    577692            SectorsPerTrack = DeviceParmBlock.cSectorsPerTrack;
    578693        OS2_FreeIOCTLHandle (IOCTLHandle);
    579         //if (SectorsPerTrack > 61) return TRUE;              // >60 should also be ok for normal image (60 for image 1 for lvm)
    580         if (SectorsPerTrack > SECTOR_COUNT) return TRUE;      // Note: This is 1 sector smaller than above !!
     694        //if (SectorsPerTrack > 61) return TRUE;
     695        if (SectorsPerTrack > SECTOR_COUNT) return TRUE;
    581696        // OS/2 is only able to support 512-byte/sector media, so we dont need to check this
    582697        return FALSE;
     
    762877    }
    763878
    764     USHORT OS2_GetIOCTLHandle () {
    765         USHORT IOCTLHandle = 0;
    766         // Implement !
    767         return IOCTLHandle;
    768     }
    769 
    770     void OS2_FreeIOCTLHandle (USHORT IOCTLHandle) {
    771         // Implement !
    772         return;
    773     }
    774 
    775 
    776879    BOOL HarddriveCheckGeometry (void) {
    777         USHORT               IOCTLHandle;
    778 
    779         IOCTLHandle = OS2_GetIOCTLHandle();
     880
    780881        // Implement !
    781882        return FALSE;
     
    783884
    784885    BOOL Track0Load (void) {
    785         USHORT      IOCTLHandle;
    786886        BOOL        Success = FALSE;
    787887
    788         IOCTLHandle = OS2_GetIOCTLHandle();
    789888        // Implement !
    790889        return Success;
     
    792891
    793892    BOOL Track0Write (void) {
    794         USHORT      IOCTLHandle;
    795893        BOOL        Success = FALSE;
    796894
    797         IOCTLHandle = OS2_GetIOCTLHandle();
    798895        // Implement !
    799896        return Success;
     
    846943    fseek (FileHandle, 0, SEEK_END);
    847944    BootcodeSize = ftell(FileHandle);
    848     if (BootcodeSize!=IMAGE_SIZE) {
     945    if (BootcodeSize!=IMAGE_SIZE && BootcodeSize!=IMAGE_SIZE_60SECS) {
    849946        fclose (FileHandle);
    850947        if (!Option_CID) {
     
    9961093
    9971094
    998         /*
    999         // HIER AANPASSEN VOOR 1.06 -> 1.07, 1.07/1.0.8-rc1 -> 1.0.8-rc2+ !
    1000         // MBR-ProtImg, DriveLetters, Packed hideparttable
    1001         */
    1002 
    1003         // UPGRADE all later versions
    1004         //  We don't need to "upgrade" the configuration, we simply copy it over.
    1005         //   From Sector 55, 6 sectors in total but never header/version
     1095        // UPGRADE to v1.06 format.
     1096        // We don't need to "upgrade" the configuration to move to v1.06, we simply copy it over.
     1097        // From Sector 55, 6 sectors in total but never header/version.
    10061098        // Rousseau: We copy two more sectors (8 in total) in the extended (45 partition) version.
    10071099        switch (IMAGE_SIZE) {
     
    10151107            }
    10161108        }
     1109
     1110        /*
     1111        // Convert v1.06 hideparttable (30x30) to the v1.07 (30x45) format.
     1112        */
     1113        if ((Installed_ConfigVersion == 0x102) && (Bootcode_ConfigVersion >= 0x107)) {
     1114            int     i,j;
     1115            char    c;
     1116            //printf("Converting 1.06 -> 1.07 hidepart");
     1117            memcpy(&Bootcode[0x7400], &Track0[0x7200], 900);
     1118            memset(TempHidPartTable, 0xff, 45 * 34);
     1119            for (i=0; i<30; i++) {
     1120                for (j=0; j<30; j++) {
     1121                    c = Bootcode[0x7400+i*30+j];
     1122                    TempHidPartTable[i*45+j] = c;
     1123                }
     1124            }
     1125            memcpy(&Bootcode[0x7400], TempHidPartTable, 30 * 45);
     1126        }
     1127
     1128        /*
     1129        // Convert v1.07 hideparttable (30x45) to a packed v1.0.8+ (45x45) format.
     1130        */
     1131        if ((Installed_ConfigVersion < 0x108) && (Bootcode_ConfigVersion >= 0x108)) {
     1132            int     i,j;
     1133            char    c;
     1134            //printf("Converting to 1.08 packed hidepart");
     1135            memset(TempHidPartTable, 0xff, 45 * 34);
     1136            // Unpacked table is 30 rows with 45 columns per row.
     1137            // Packed table is 45 rows with 45 columns per row packed in 34 bytes.
     1138            for (i=0; i<30; i++) {
     1139                for (j=0; j<45; j++) {
     1140                    c = Bootcode[0x7400+i*45+j];                            // Get unpacked value
     1141                    c = set_bitfield(&TempHidPartTable[i*34], j, 6, c);     // Store 6-bit packed value
     1142                }
     1143            }
     1144            memcpy(&Bootcode[0x7400], TempHidPartTable, 45 * 34);
     1145        }
     1146
    10171147        return;
    10181148    }
     1149    // MKW:
    10191150    // Check for prior v0.26 signature
    10201151    // not supported in C version anymore
    1021     //  Don't have this version here for testing and I can't risk breaking
    1022     //  configuration
     1152    // Don't have this version here for testing and I can't risk breaking
     1153    // configuration
    10231154    return;
    10241155}
     
    11601291                if (!Option_CID) {
    11611292                printf(", but may be updated");
     1293                }
     1294            if (!Option_CID) {
    11621295                printf("\n");
    1163                 }
     1296            }
    11641297            break;
     1298
    11651299        case STATUS_IMPOSSIBLE:
    11661300            if (!Option_CID) {
    1167             printf(ImpossibleCause);
     1301                printf(ImpossibleCause);
    11681302            }
    11691303            break;
     
    12641398
    12651399
    1266 
     1400void    DoDebug() {
     1401    USHORT  t0codv  = 0;
     1402    USHORT  t0cfgv  = 0;
     1403    USHORT  bccodv  = 0;
     1404    USHORT  bccfgv  = 0;
     1405
     1406    //do_bf_test();
     1407
     1408    printf("\nHardisks : %d\n", CountHarddrives());
     1409    printf("\nGEO      : %d\n", HarddriveCheckGeometry());
     1410    printf("\nTrack0   : %d\n", Track0Load());
     1411    printf("\nBootcode : %d\n", LoadBootcodeFromFile());
     1412
     1413
     1414    // Dump Track0
     1415    {
     1416        int i;
     1417        for (i=0; i<512; i++) {
     1418            printf("%02X",Track0[i]);
     1419        }
     1420    }
     1421    printf("\n\n");
     1422    // Dump Bootcode
     1423    {
     1424        int i;
     1425        for (i=0; i<512; i++) {
     1426            printf("%02X",Bootcode[i]);
     1427        }
     1428    }
     1429    printf("\n\n");
     1430
     1431    t0codv = Track0[13] << 8 | Track0[14];
     1432    printf("t0codv : %04X\n", t0codv);
     1433
     1434    t0cfgv = Track0[0x6c00+13] << 8 | Track0[0x6c00+14];
     1435    printf("t0cfgv : %04X\n", t0cfgv);
     1436
     1437    bccodv = Bootcode[13] << 8 | Bootcode[14];
     1438    printf("bccodv : %04X\n", bccodv);
     1439
     1440    bccfgv = Bootcode[0x6c00+13] << 8 | Bootcode[0x6c00+14];
     1441    printf("bccfgv : %04X\n", bccfgv);
     1442
     1443    return;
     1444
     1445}
    12671446
    12681447
     
    12831462    CHAR    TempSpace[MAXCMDPARMLEN+1];
    12841463
    1285     char* p = NULL;
    1286 
    1287 
    1288     do_bf_test();
    1289     exit(0);
    1290 
    1291 
    1292 //   printf("AiR-BOOT Installer v1.07\n");
    1293 //   printf(" - (c) Copyright 1998-2011 by Martin Kiewitz.\n");
    1294 //   printf("\n-> ...Please wait... <-\n");
     1464
     1465    // Show header.
     1466    if (!Option_CID) {
     1467        printf("AiR-BOOT Installer v%s.%s.%s for %s\n",
     1468            BLDLVL_MAJOR_VERSION,
     1469            BLDLVL_MIDDLE_VERSION,
     1470            BLDLVL_MINOR_VERSION,
     1471            PLATFORM_NAME);
     1472        printf(" - (c) Copyright 1998-2012 by Martin Kiewitz.\n");
     1473        printf("\n-> ...Please wait... <-\n");
     1474    }
    12951475
    12961476    // Allocate buffers for Track0 and AIRBOOT.BIN.
     
    13071487
    13081488
    1309     p = (PCHAR) &Track0;
    1310     p = (PCHAR) Track0;
    1311     p[0] = 'A';
    1312 
    1313     {
    1314         int i=0;
    1315         for (i=0; i<sizeof(Track0); i++) {
    1316             Track0[i]='X';
    1317         }
    1318         for (i=0; i<sizeof(Bootcode); i++) {
    1319             Bootcode[i]='Y';
    1320         }
    1321         //~ for (i=0; i<sizeof(Bootcode2); i++) {
    1322             //~ Bootcode2[i]='Z';
    1323         //~ }
    1324     }
     1489    //~ DoDebug();
     1490    //~ exit(0);
    13251491
    13261492
  • trunk/INSTALL/C/INSTALL.H

    r46 r47  
    1515#define     BLDLVL_YEAR             "2012"
    1616#define     BLDLVL_MONTH            "04"
    17 #define     BLDLVL_DAY              "14"
     17#define     BLDLVL_DAY              "21"
    1818// Build time
    19 #define     BLDLVL_HOURS            "01"
    20 #define     BLDLVL_MINUTES          "30"
     19#define     BLDLVL_HOURS            "08"
     20#define     BLDLVL_MINUTES          "35"
    2121#define     BLDLVL_SECONDS          "00"
    2222// Build machine
     
    4949#if defined(__DOS__)
    5050    // DOS platform
     51    #define PLATFORM_DOS
     52    #define PLATFORM_NAME   "DOS"
    5153    #include    <os2def.h>      // We use the OS/2 definitions like CHAR etc.
    52     #define PLATFORM_DOS
    5354#elif defined(__OS2__) && !defined(OS2)
    5455    // OS/2 platform
     56    #define     PLATFORM_OS2
     57    #define     PLATFORM_NAME   "OS/2"
    5558    #define     INCL_NOPMAPI
    5659    #define     INCL_BASE
     
    5962    #include    <os2.h>
    6063    #include    <malloc.h>                                                      // Rousseau: added to use getenv()
    61     #define     PLATFORM_OS2
    6264#elif defined(__NT__)
    6365    // Win32 platform
     66    #define     PLATFORM_WINNT
     67    #define     PLATFORM_NAME   "Windows NT/2K/XP/Vista/7"
    6468    #include    <windows.h>
    65     #define     PLATFORM_WINNT
     69
    6670#elif defined(__LINUX__)
    6771    // Linux platform
     72    #define     PLATFORM_LINUX
     73    #define     PLATFORM_NAME   "Linux"
    6874    #include    <os2def.h>      // We use the OS/2 definitions like CHAR etc.
    69     #define     PLATFORM_LINUX
    7075#else
    7176    #error Unsupported platform
  • trunk/INSTALL/C/Makefile

    r46 r47  
    327327#
    328328
     329
     330# -----------------------------------------------------------------------------
     331# DISTRIBUTE TO RELEASE SPACE
     332# -----------------------------------------------------------------------------
     333# This distributes all .BIN files to BOOTCODE.
     334# Then it installs the English version to RELEASES as AIRBOOT.BIN.
     335# -----------------------------------------------------------------------------
     336dist:   .SYMBOLIC
     337        @if exist *.EXE $(CP) *.EXE ..$(DS)..$(DS)RELEASE$(DS)BOOTCODE
     338
     339
    329340#
    330341# Rebuild all targets.
  • trunk/INSTALL/INST_X86/INSTALL.INC

    r46 r47  
    371371
    372372
    373 ;       Out: Carry Flag SET if Harddisc failed 62-sectors test
     373;       Out: Carry Flag SET if Harddisc failed 63-sectors test
    374374Init_CheckHarddisc             Proc Near
    375375   mov     ah, 08h
     
    378378   and     cl, 111111b
    379379   cmp     cl, 62
    380    jae     INITCH_Success
     380   ja      INITCH_Success
    381381   stc
    382382   ret
  • trunk/TOOLS/INTERNAL/FIXCODE.C

    r46 r47  
    2222//  It is a quick-and-dirty translation of the original DOS-only ASM file.
    2323//  Of course it's not as small but it's much easier to maintain across
    24 //  multiple platforms.
     24//  multiple platforms. A small change with regard to the old ASM version is
     25//  that it directly writes AIRBOOT.BIN instead of writing AIR-BOOT.COM.
     26//  This way the pre and post situations are kept valid.
    2527*/
    2628
     
    4951#define     IN_FILE     "AIR-BOOT.COM"              // Target from assembly.
    5052#ifdef      PLATFORM_LINUX
    51 #define     MERGE_FILE  "MBR-PROT/MBR-PROT.BIN"     // MBR protection TSR.
     53#define     MERGE_FILE  "MBR-PROT/MBR-PROT.BIN"     // MBR Protection Image.
    5254#else
    53 #define     MERGE_FILE  "MBR-PROT\\MBR-PROT.BIN"    // MBR protection TSR.
     55#define     MERGE_FILE  "MBR-PROT\\MBR-PROT.BIN"    // MBR Protection Image.
    5456#endif
    5557#define     OUT_FILE    "AIRBOOT.BIN"               // Generated loader image.
     
    158160    /*
    159161    // Find Protection Image Signature.
    160     // Note that this signature must reside on a sector boundary.
     162    // Note that this signature must reside on a sector boundary in the
     163    // AIR-BOOT.COM image.
    161164    */
    162165    for (i=0; i<55; i++) {
     
    168171
    169172    /*
    170     // Merge Protection Image.
     173    // Abort if not found.
    171174    */
    172175    printf("%s",MergeMBR);
     
    175178        exit(2);
    176179    }
     180
     181    /*
     182    // Merge Protection Image.
     183    */
    177184    memcpy(&BootCode[i*SECSIZE], MBRProtection, MBRPROT_SIZE);
    178185    printf("%s", Okay);
     
    181188    /*
    182189    // Count Code Sectors.
    183     // Obsolete now since the Protection Image has moved just below the
    184     // Configuration and the code is always max. size.
     190    // Obsolete now because since v1.0.8 the Protection Image has moved just
     191    // below the Configuration and the code is always max. size.
    185192    // Overlap checking is done while assembling AIR-BOOT.ASM.
     193    // So we just write the max. code sectors here.
    186194    */
    187195    printf("%s", CountCode);
  • trunk/TOOLS/OS2/SETABOOT/SETABOOT.H

    r46 r47  
    1616#define     BLDLVL_YEAR             "2012"
    1717#define     BLDLVL_MONTH            "04"
    18 #define     BLDLVL_DAY              "14"
     18#define     BLDLVL_DAY              "21"
    1919// Build time
    20 #define     BLDLVL_HOURS            "01"
    21 #define     BLDLVL_MINUTES          "30"
     20#define     BLDLVL_HOURS            "08"
     21#define     BLDLVL_MINUTES          "35"
    2222#define     BLDLVL_SECONDS          "00"
    2323// Build machine
Note: See TracChangeset for help on using the changeset viewer.