1 | // AiR-BOOT (c) Copyright 1998-2009 M. Kiewitz
|
---|
2 | //
|
---|
3 | // This file is part of AiR-BOOT
|
---|
4 | //
|
---|
5 | // AiR-BOOT is free software: you can redistribute it and/or modify it under
|
---|
6 | // the terms of the GNU General Public License as published by the Free
|
---|
7 | // Software Foundation, either version 3 of the License, or (at your option)
|
---|
8 | // any later version.
|
---|
9 | //
|
---|
10 | // AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
11 | // WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
12 | // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
---|
13 | // details.
|
---|
14 | //
|
---|
15 | // You should have received a copy of the GNU General Public License along with
|
---|
16 | // AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
|
---|
17 | //
|
---|
18 |
|
---|
19 |
|
---|
20 | /*
|
---|
21 | // OS/2 BLDLEVEL Information.
|
---|
22 | */
|
---|
23 | // Vendor
|
---|
24 | //~ #define BLDLVL_VENDOR "KIEWITZ"
|
---|
25 | //~ #define BLDLVL_VENDOR "RDPe"
|
---|
26 | #define BLDLVL_VENDOR "*UNKNOWN*"
|
---|
27 | // Version
|
---|
28 | #define BLDLVL_MAJOR_VERSION "1"
|
---|
29 | #define BLDLVL_MIDDLE_VERSION "1"
|
---|
30 | #define BLDLVL_MINOR_VERSION "1"
|
---|
31 | // Build date
|
---|
32 | #define BLDLVL_YEAR "2016"
|
---|
33 | #define BLDLVL_MONTH "10"
|
---|
34 | #define BLDLVL_DAY "10"
|
---|
35 | // Build time
|
---|
36 | //~ #define BLDLVL_HOURS "01"
|
---|
37 | //~ #define BLDLVL_MINUTES "01"
|
---|
38 | //~ #define BLDLVL_SECONDS "00"
|
---|
39 | #define BLDLVL_HOURS "99"
|
---|
40 | #define BLDLVL_MINUTES "99"
|
---|
41 | #define BLDLVL_SECONDS "99"
|
---|
42 | // Build machine
|
---|
43 | //~ #define BLDLVL_MACHINE "OS2BLDBOX"
|
---|
44 | #define BLDLVL_MACHINE "*UNKNOWN*"
|
---|
45 | // Build language
|
---|
46 | #define BLDLVL_LANGUAGE "EN"
|
---|
47 |
|
---|
48 | //char bldlevel[] = "@#KIEWITZ:1.0.8#@##1## 2011/01/17 21:10:00 ecs-devbox:ASD123:L:C:8::99@@ Adapter Driver for PATA/SATA DASD";
|
---|
49 | char bldlevel[] = "@#"\
|
---|
50 | BLDLVL_VENDOR":"\
|
---|
51 | BLDLVL_MAJOR_VERSION"."\
|
---|
52 | BLDLVL_MIDDLE_VERSION"."\
|
---|
53 | BLDLVL_MINOR_VERSION"#@##1## "\
|
---|
54 | BLDLVL_YEAR"/"\
|
---|
55 | BLDLVL_MONTH"/"\
|
---|
56 | BLDLVL_DAY" "\
|
---|
57 | BLDLVL_HOURS":"\
|
---|
58 | BLDLVL_MINUTES":"\
|
---|
59 | BLDLVL_SECONDS" "\
|
---|
60 | BLDLVL_MACHINE"::"\
|
---|
61 | BLDLVL_LANGUAGE"::"\
|
---|
62 | BLDLVL_MINOR_VERSION"::@@"\
|
---|
63 | "Installer for the AiR-BOOT Boot Manager";
|
---|
64 |
|
---|
65 |
|
---|
66 | /*
|
---|
67 | // Platform dependent defines and includes.
|
---|
68 | */
|
---|
69 | #if defined(__DOS__)
|
---|
70 | // DOS platform
|
---|
71 | #define PLATFORM_DOS
|
---|
72 | #define PLATFORM_NAME "DOS"
|
---|
73 | // We use the OS/2 v1.x definitions like CHAR etc.
|
---|
74 | #include <os2def.h>
|
---|
75 | #elif defined(__OS2__) && !defined(OS2)
|
---|
76 | // OS/2 platform
|
---|
77 | #define PLATFORM_OS2
|
---|
78 | #define PLATFORM_NAME "OS/2"
|
---|
79 | #define INCL_NOPMAPI
|
---|
80 | #define INCL_BASE
|
---|
81 | #define INCL_DOS
|
---|
82 | #define INCL_DOSDEVIOCTL
|
---|
83 | #include <os2.h>
|
---|
84 | #include <malloc.h>
|
---|
85 | #elif defined(__NT__)
|
---|
86 | // Win32 platform
|
---|
87 | #define PLATFORM_WINNT
|
---|
88 | #define PLATFORM_NAME "Windows NT/2K/XP/Vista/7"
|
---|
89 | #include <windows.h>
|
---|
90 |
|
---|
91 | #elif defined(__LINUX__)
|
---|
92 | // Linux platform
|
---|
93 | #define PLATFORM_LINUX
|
---|
94 | #define PLATFORM_NAME "Linux"
|
---|
95 | // We use the OS/2 v2.x definitions like CHAR etc.
|
---|
96 | #include <os2def.h>
|
---|
97 | #else
|
---|
98 | #error Unsupported platform
|
---|
99 | #endif
|
---|
100 |
|
---|
101 |
|
---|
102 | /*
|
---|
103 | // Standard header files.
|
---|
104 | */
|
---|
105 | #include <stdlib.h>
|
---|
106 | #include <ctype.h>
|
---|
107 | #include <stdio.h>
|
---|
108 | #include <conio.h>
|
---|
109 | #include <string.h>
|
---|
110 | #include <i86.h>
|
---|
111 |
|
---|
112 |
|
---|
113 | #define STATUS_NOTINSTALLED 0 // No ID found
|
---|
114 | #define STATUS_CORRUPT 1 // ID found, Checksum failure
|
---|
115 | #define STATUS_INSTALLED 2 // ID found, Checksum valid
|
---|
116 | #define STATUS_INSTALLEDMGU 3 // ID found, Checksum valid, may get updated
|
---|
117 | #define STATUS_IMPOSSIBLE 4 // Unable/Not willing to install
|
---|
118 |
|
---|
119 | /* Rousseau: added */
|
---|
120 | #define IMAGE_NAME "airboot.bin"
|
---|
121 | #define GPT 0xEE // GPT Disk, AiR-BOOT will abort
|
---|
122 | #define BYTES_PER_SECTOR 512 // This could be higher in the future
|
---|
123 | #define IMAGE_SIZE_60SECS 30720 // Normal image-size (max. 30 partitions)
|
---|
124 | #define IMAGE_SIZE_62SECS 31744 // Extended image-size (max. 45 partitions)
|
---|
125 | //#define IMAGE_SIZE IMAGE_SIZE_60SECS // Use the normal image
|
---|
126 | #define IMAGE_SIZE IMAGE_SIZE_62SECS // Use the extended image
|
---|
127 | #define SECTOR_COUNT IMAGE_SIZE / BYTES_PER_SECTOR // Size of the image in sectors
|
---|
128 | #define CONFIG_OFFSET 0x6C00 // Byte offset of config-sector
|
---|
129 | #define SECTORS_BEFORE_CONFIG CONFIG_OFFSET / BYTES_PER_SECTOR // Nr of sectors before config-sector
|
---|