- Timestamp:
- Mar 7, 2011, 10:44:02 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/os2ahci.def
r82 r83 1 1 library os2ahci 2 Description '$@#thi.guten (www.thiguten.de):1.0 0.20110302#@OS/2 AHCI Adapter Device Driver'2 Description '$@#thi.guten (www.thiguten.de):1.09.0#@##1## 03/07/2011 10:41:38 ECSDEVEL::::00::@@OS/2 AHCI Adapter Device Driver' 3 3 protmode 4 4 -
trunk/src/os2ahci/version.h
r82 r83 2 2 3 3 version.h - define version numbers and strings for OS2AHCI.ADD 4 5 NOTE: this is kept in a separate file for easier parsing by 6 bldlvl.cmd (which creates the bldlevel signature) 4 7 5 8 ******************************************************************************/ … … 8 11 #define VERSION 109 /* driver version (2 implied decimals) */ 9 12 10 /* BLDLEVEL information (in C source modules added via macro11 concatenation) for BuildLevel.cmd to generate BLDLEVEL information */12 13 #define BLDLEVEL_VENDOR "thi.guten (www.thiguten.de)"14 #define BLDLEVEL_VERSION "1.00"15 #define BLDLEVEL_INFO "OS/2 AHCI Adapter Device Driver" -
trunk/tools/bldlvl.cmd
r78 r83 12 12 * Syntax: BuildLevel ModuleDefinitionFile Headerfile * 13 13 * e.g. BuildLevel PC2.def PC2.h * 14 15 16 NOTE: this has been heavily modified to better suit the OS2AHCI 17 environment... 18 19 14 20 * * 15 21 \***********************************************************************/ … … 63 69 Parse Arg DefinitionFile HeaderFile . 64 70 Do While (DefinitionFile\="" & HeaderFile\="") 65 /* We have valid commandline arguments, so first see 66 if the Headerfile contents are ok for us */ 67 ReturnCode=ParseHeaderFile() 68 If ReturnCode\=0 Then Leave 69 /* Parse the definition file (*.DEF) for the module 70 name, to see if we got a valid file */ 71 ReturnCode=ParseDefinitionFile() 72 If ReturnCode\=0 Then Leave 73 /* Copy the definition file, because we're going to 74 change the original */ 75 Command="@copy "||DefinitionFile||" "||DefinitionCopy||" /v >NUL" 71 /* We have valid commandline arguments, so first see 72 if the Headerfile contents are ok for us */ 73 ReturnCode=ParseHeaderFile() 74 If ReturnCode\=0 Then Leave 75 /* Parse the definition file (*.DEF) for the module 76 name, to see if we got a valid file */ 77 ReturnCode=ParseDefinitionFile() 78 If ReturnCode\=0 Then Leave 79 /* Copy the definition file, because we're going to 80 change the original */ 81 Command="@copy "||DefinitionFile||" "||DefinitionCopy||" /v >NUL" 82 Command 83 Command="@del "||DefinitionFile||" >NUL 2>&1" 84 Command 85 If (rc\=0) Then Do 86 ReturnCode=2 87 Leave 88 End 89 90 /* Build DESCRIPTION statement for *.DEF file */ 91 92 /* MT: build date string as expected by bldlevel (26 chars fixed) */ 93 x = date('s') 94 dat = " " || substr(x, 5, 2) || "/" || substr(x, 7, 2) || "/" || substr(x, 1, 4) 95 dat = dat || " " || time() || " " 96 BldLevel=BldLevel_Header||"thi.guten (www.thiguten.de):"||BldLevel_Version||".0#@##1##"||dat||value('hostname',,'OS2ENVIRONMENT')||"::::00::@@OS/2 AHCI Adapter Device Driver" 97 Description=Description_Header||BldLevel||Description_Trailer 98 99 /* Copy the module definition file to be able to change 100 the contents of the original one. In case of an error 101 copy back the original one */ 102 ReturnCode=ModifyDefinitionFile() 103 If ReturnCode\=0 Then Do 104 Command="@copy "||DefinitionCopy||" "||DefinitionFile||" /v >NUL" 76 105 Command 77 Command="@del "||DefinitionFile||" >NUL 2>&1"78 Command79 If (rc\=0) Then Do80 ReturnCode=281 Leave82 End83 /* Build DESCRIPTION statement for *.DEF file */84 dat=DATE('Sorted') /* MT: add date to version */85 BldLevel=BldLevel_Header||BldLevel_Vendor||":"||BldLevel_Version||"."||dat||"#@"||BldLevel_Info86 Description=Description_Header||BldLevel||Description_Trailer87 /* Copy the module definition file to be able to change88 the contents of the original one. In case of an error89 copy back the original one */90 ReturnCode=ModifyDefinitionFile()91 If ReturnCode\=0 Then Do92 Command="@copy "||DefinitionCopy||" "||DefinitionFile||" /v >NUL"93 Command94 Command="@del "||DefinitionCopy||" >NUL 2>&1"95 Command96 Leave97 End98 99 /* Exit with success */100 106 Command="@del "||DefinitionCopy||" >NUL 2>&1" 101 107 Command 102 ReturnCode=0103 108 Leave 104 End 105 /* Exit to commandline */ 109 End 110 111 /* Exit with success */ 112 Command="@del "||DefinitionCopy||" >NUL 2>&1" 113 Command 114 ReturnCode=0 115 Leave 116 End 117 /* Exit to commandline */ 106 118 If (ReturnCode\=0) Then Do 107 108 109 110 End119 Say "" 120 Say "Error "||ReturnCode||" modifying "||DefinitionFile||", no changes made" 121 Say "" 122 End 111 123 Else Do 112 113 End124 Say "Module definition file "||DefinitionFile||" successfully modified" 125 End 114 126 Return ReturnCode 115 127 116 128 /*--------------------------------------------------------------------------------------*\ 117 * Parse a C/C++ header file to test that the macros we build the BLDLEVEL information * 118 * from (BLDLEVEL_VENDOR, BLDLEVEL_VERSION, BLDLEVEL_INFO) are defined. * 119 * Req: * 120 * none * 121 * Returns: * 122 * ReturnCode .... Error code (0 if no error) * 123 \*--------------------------------------------------------------------------------------*/ 129 * Parse a C/C++ header file to for a VERSION (#define VERSION xxx) * 130 \*--------------------------------------------------------------------------------------*/ 124 131 ParseHeaderFile: 125 LinesLeft=2 126 /* Read ahead 1st line */ 127 CurrentLine=LineIn(HeaderFile, 1, 1) 128 /* Do while there are lines in the file */ 129 Do While(LinesLeft>0) 130 /* Parse for constructs of the form: 131 #define BLDLEVEL_Macro "Value" Comment */ 132 /* Kill that ... tabs */ 133 CurrentLine=Translate(CurrentLine, ' ', X2C(9)) 134 Parse Var CurrentLine Define Macro '"' Value '"' . 135 Parse Upper Var Define Define 136 Define=Space(Define, 0) 137 Parse Upper Var Macro Macro 138 Macro=Space(Macro, 0) 139 /* Test for the macros we expect */ 140 If (Define="#DEFINE") Then Do 141 Select 142 When (Macro="BLDLEVEL_VENDOR") Then Do 143 BldLevel_Vendor=Value 144 End 145 When (Macro="BLDLEVEL_VERSION") Then Do 146 BldLevel_Version=Value 147 End 148 When (Macro="BLDLEVEL_INFO") Then Do 149 BldLevel_Info=Value 150 End 151 Otherwise 152 End 132 LinesLeft=2 133 /* Read ahead 1st line */ 134 CurrentLine=LineIn(HeaderFile, 1, 1) 135 /* Do while there are lines in the file */ 136 Do While(LinesLeft>0) 137 /* Parse for constructs of the form: 138 #define BLDLEVEL_Macro "Value" Comment */ 139 /* Kill that ... tabs */ 140 CurrentLine=Translate(CurrentLine, ' ', X2C(9)) 141 Parse Var CurrentLine Define Macro Value . 142 Parse Upper Var Define Define 143 Define=Space(Define, 0) 144 Parse Upper Var Macro Macro 145 Macro=Space(Macro, 0) 146 /* Test for the macros we expect */ 147 /* MT: BLDLEVEL_VERSION is ignored so we do not have to change more than one 148 * symbol for each new version */ 149 If (Define="#DEFINE") Then Do 150 Select 151 When (Macro="VERSION") Then Do 152 /* VERSION is a numeric value with 2 implied decimals */ 153 BldLevel_Version = substr(Value, 1, length(Value) - 2) || "." || substr(Value, length(Value) - 1, 2) 154 End 155 Otherwise 153 156 End 154 CurrentLine=LineIn(HeaderFile) 155 /* As Lines() returns 0 after having read the last line 156 we have to ensure that this last line will be processed too */ 157 If (Lines(HeaderFile)=0) Then 158 LinesLeft=LinesLeft-1 159 End 160 If (BldLevel_Vendor\="" & BldLevel_Version\="" & BldLevel_Info\="") Then 161 Return 0 162 Else 163 Return 10 157 End 158 CurrentLine=LineIn(HeaderFile) 159 /* As Lines() returns 0 after having read the last line 160 we have to ensure that this last line will be processed too */ 161 If (Lines(HeaderFile)=0) Then 162 LinesLeft=LinesLeft-1 163 End 164 If (BldLevel_Version\="") Then 165 Return 0 166 Else 167 Return 10 164 168 165 169 /*--------------------------------------------------------------------------------------*\ … … 170 174 * Returns: * 171 175 * ReturnCode .... Error code (0 if no error) * 172 \*--------------------------------------------------------------------------------------*/176 \*--------------------------------------------------------------------------------------*/ 173 177 ParseDefinitionFile: 174 /* Read ahead 1st line */ 175 Command=Stream(DefinitionFile, 'C', 'OPEN READ') 176 LinesLeft=2 178 /* Read ahead 1st line */ 179 Command=Stream(DefinitionFile, 'C', 'OPEN READ') 180 LinesLeft=2 181 CurrentLine=LineIn(DefinitionFile) 182 /* Do while there are lines in the file */ 183 Do While(LinesLeft>0) 184 /* Parse for constructs of the form: 185 NAME/LIBRARY ModuleName Options */ 186 /* Kill that ... tabs */ 187 CurrentLine=Translate(CurrentLine, ' ', X2C(9)) 188 Parse Var CurrentLine Statement Module Options 189 Parse Upper Var Statement Statement 190 Statement=Space(Statement, 0) 191 Module=Space(Module, 0) 192 If (Module\="") Then Do 193 If (Statement="NAME") Then 194 ModuleName=Module||".exe" 195 If (Statement="LIBRARY") Then 196 ModuleName=Module||".add" /* MT: we're an ADD after all */ 197 End 198 /* See if there is a DESCRIPTION statement */ 199 Parse Var CurrentLine Statement Options 200 Parse Upper Var Statement Statement 201 Statement=Space(Statement, 0) 202 If (Statement="DESCRIPTION") Then 203 DescriptionStatement=Options 177 204 CurrentLine=LineIn(DefinitionFile) 178 /* Do while there are lines in the file */ 179 Do While(LinesLeft>0) 180 /* Parse for constructs of the form: 181 NAME/LIBRARY ModuleName Options */ 182 /* Kill that ... tabs */ 183 CurrentLine=Translate(CurrentLine, ' ', X2C(9)) 184 Parse Var CurrentLine Statement Module Options 185 Parse Upper Var Statement Statement 186 Statement=Space(Statement, 0) 187 Module=Space(Module, 0) 188 If (Module\="") Then Do 189 If (Statement="NAME") Then 190 ModuleName=Module||".exe" 191 If (Statement="LIBRARY") Then 192 ModuleName=Module||".add" /* MT: we're an ADD after all */ 193 End 194 /* See if there is a DESCRIPTION statement */ 195 Parse Var CurrentLine Statement Options 196 Parse Upper Var Statement Statement 197 Statement=Space(Statement, 0) 198 If (Statement="DESCRIPTION") Then 199 DescriptionStatement=Options 200 CurrentLine=LineIn(DefinitionFile) 201 /* As Lines() returns 0 after having read the last line 202 we have to ensure that this last line will be processed too */ 203 If (Lines(DefinitionFile)=0) Then 204 LinesLeft=LinesLeft-1 205 End 206 /* Close the stream */ 207 Command=Stream(DefinitionFile, 'C', 'CLOSE') 208 If (ModuleName\="" & DescriptionStatement\="") Then 209 Return 0 210 Else 211 Return 20 205 /* As Lines() returns 0 after having read the last line 206 we have to ensure that this last line will be processed too */ 207 If (Lines(DefinitionFile)=0) Then 208 LinesLeft=LinesLeft-1 209 End 210 /* Close the stream */ 211 Command=Stream(DefinitionFile, 'C', 'CLOSE') 212 If (ModuleName\="" & DescriptionStatement\="") Then 213 Return 0 214 Else 215 Return 20 212 216 213 217 /*--------------------------------------------------------------------------------------*\ … … 218 222 * Returns: * 219 223 * ReturnCode .... Error code (0 if no error) * 220 \*--------------------------------------------------------------------------------------*/224 \*--------------------------------------------------------------------------------------*/ 221 225 ModifyDefinitionFile: 222 /* Read and write ahead 1st line */ 223 Command=Stream(DefinitionFile, 'C', 'OPEN WRITE') 224 If (Command="ERROR") Then 225 Return 30 226 Command=Stream(DefinitionCopy, 'C', 'OPEN READ') 227 If (Command="ERROR") Then 228 Return 31 229 LinesLeft=2 226 /* Read and write ahead 1st line */ 227 Command=Stream(DefinitionFile, 'C', 'OPEN WRITE') 228 If (Command="ERROR") Then 229 Return 30 230 Command=Stream(DefinitionCopy, 'C', 'OPEN READ') 231 If (Command="ERROR") Then 232 Return 31 233 LinesLeft=2 234 CurrentLine=LineIn(DefinitionCopy) 235 /* Do while there are lines in the file */ 236 Do While(LinesLeft>0) 237 /* Parse for constructs of the form: 238 DESCRIPTION Options */ 239 /* Kill that ... tabs */ 240 CurrentLine=Translate(CurrentLine, ' ', X2C(9)) 241 Parse Var CurrentLine Statement Options 242 Parse Upper Var Statement Statement 243 Statement=Space(Statement, 0) 244 If (Statement="DESCRIPTION") Then Do 245 Command=LineOut(DefinitionFile, Description) 246 End 247 Else Do 248 Command=LineOut(DefinitionFile, CurrentLine) 249 End 230 250 CurrentLine=LineIn(DefinitionCopy) 231 /* Do while there are lines in the file */ 232 Do While(LinesLeft>0) 233 /* Parse for constructs of the form: 234 DESCRIPTION Options */ 235 /* Kill that ... tabs */ 236 CurrentLine=Translate(CurrentLine, ' ', X2C(9)) 237 Parse Var CurrentLine Statement Options 238 Parse Upper Var Statement Statement 239 Statement=Space(Statement, 0) 240 If (Statement="DESCRIPTION") Then Do 241 Command=LineOut(DefinitionFile, Description) 242 End 243 Else Do 244 Command=LineOut(DefinitionFile, CurrentLine) 245 End 246 CurrentLine=LineIn(DefinitionCopy) 247 /* As Lines() returns 0 after having read the last line 248 we have to ensure that this last line will be processed too */ 249 If (Lines(DefinitionCopy)=0) Then 250 LinesLeft=LinesLeft-1 251 End 252 /* Close the streams */ 253 Command=Stream(DefinitionFile, 'C', 'CLOSE') 254 Command=Stream(DefinitionCopy, 'C', 'CLOSE') 255 Return 0 251 /* As Lines() returns 0 after having read the last line 252 we have to ensure that this last line will be processed too */ 253 If (Lines(DefinitionCopy)=0) Then 254 LinesLeft=LinesLeft-1 255 End 256 /* Close the streams */ 257 Command=Stream(DefinitionFile, 'C', 'CLOSE') 258 Command=Stream(DefinitionCopy, 'C', 'CLOSE') 259 Return 0 256 260 257 261 /*--------------------------------------------------------------------------------------*\ … … 262 266 * Returns: * 263 267 * none * 264 \*--------------------------------------------------------------------------------------*/268 \*--------------------------------------------------------------------------------------*/ 265 269 SignalHandler: 266 267 268 269 270 Say " CTRL+BRK currently disabled" 271 Return 0 272 273
Note:
See TracChangeset
for help on using the changeset viewer.