Changeset 37 for trunk/TOOLS
- Timestamp:
- Apr 11, 2014, 8:39:07 PM (11 years ago)
- Location:
- trunk/TOOLS
- Files:
-
- 9 added
- 1 deleted
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/TOOLS/DOS/INITHDD/INITHDD.ASM
r30 r37 17 17 ; 18 18 19 JUMPS19 ;JUMPS 20 20 21 Include ..\..\..\include\asm.inc 22 ;include ..\..\..\include\dos\airboot.inc 21 Include ../../../INCLUDE/ASM.INC 23 22 24 23 .386p 25 model large, basic24 .model large, basic 26 25 27 26 code_seg segment public use16 … … 30 29 air_boot_setup: jmp INITHDD_Start 31 30 32 Introduction :db 'INITHDD - AiR-BOOT Initialize HDD Utility (DOS) - (c) 2004 by M. Kiewitz',13,1031 Introduction db 'INITHDD - AiR-BOOT Initialize HDD Utility (DOS) - (c) 2004 by M. Kiewitz',13,10 33 32 db 0 34 33 … … 69 68 dw 00000h, 00000h, 00000h, 0AA55h 70 69 71 ; Include .. \..\..\include\DOS\Const.asm70 ; Include ../../../INCLUDE\DOS\CONST.ASM 72 71 73 72 INITHDD_Start: mov ax, cs -
trunk/TOOLS/DOS/INITHDD/MAKE.BAT
r30 r37 8 8 %exe2bin% inithdd.exe inithdd.com >nul 9 9 if errorlevel 1 goto Failed 10 copy inithdd.com ..\..\..\RELEASE\DOS\inithdd.com 10 copy inithdd.com ..\..\..\RELEASE\DOS\INITHDD.COM 11 12 @ren inithdd.LST inithdd.TSL 13 @ren inithdd.TSL INITHDD.LST 11 14 12 15 rem Cleanup -
trunk/TOOLS/DOS/INITHDD/MAKE.CMD
r36 r37 1 1 @echo off 2 2 rem Do actual build... 3 call ..\..\..\env\ dos.bat3 call ..\..\..\env\os2.cmd 4 4 %assembler% inithdd.asm 5 5 if errorlevel 1 goto Failed 6 %linker% inithdd.obj >nul6 %linker% inithdd.obj; >nul 7 7 if errorlevel 1 goto Failed 8 8 %exe2bin% inithdd.exe inithdd.com >nul 9 9 if errorlevel 1 goto Failed 10 copy inithdd.com ..\..\..\RELEASE\DOS\inithdd.com 10 copy inithdd.com ..\..\..\RELEASE\DOS\INITHDD.COM 11 12 @ren inithdd.LST inithdd.TSL 13 @ren inithdd.TSL INITHDD.LST 11 14 12 15 rem Cleanup -
trunk/TOOLS/DOS/SETABOOT/SETABOOT.ASM
r29 r37 19 19 JUMPS 20 20 21 Include .. \..\..\Include\asm.inc22 include .. \..\..\include\dos\airboot.inc21 Include ../../../INCLUDE/ASM.INC 22 include ../../../INCLUDE/DOS/AIRBOOT.INC 23 23 24 24 .386p … … 60 60 db ' detected.', 13, 10, 0 61 61 62 Include .. \..\..\include\dos\Const.asm62 Include ../../../INCLUDE/DOS/CONST.ASM 63 63 64 64 AiRBOOTdetected db 0 … … 343 343 ; DL holds total IPT entries to go 344 344 ; DH holds current partition number (base 0) 345 push cx es di 345 push cx 346 push es 347 push di 346 348 mov ax, ds 347 349 mov es, ax ; ES == DS for now … … 351 353 mov di, offset TrackZero+6E00h ; Starting at sector 56 352 354 CmdLine_RebootToSearchLoop: 353 push si di 355 push si 356 push di 354 357 add di, 4 ; Seek to "PartitionName" item 355 358 mov cx, bx 356 359 rep cmpsb 357 pop di si 360 pop di 361 pop si 358 362 je CmdLine_RebootToSearchDone 359 363 add di, 34 ; Length of IPT entry … … 363 367 CmdLine_RebootToSearchDone: 364 368 mov bl, ds:[di+17] ; Get "Flags" 365 pop di es cx 369 pop di 370 pop es 371 pop cx 366 372 or dl, dl ; If no partitions left -> not found 367 373 jz CmdLine_RebootToNotFound -
trunk/TOOLS/INTERNAL/FIXCODE.ASM
r31 r37 21 21 ; b) it writes totally used sectors to byte at offset 10h in the image 22 22 23 JUMPS 24 25 Include ..\..\include\asm.inc 26 ; include ..\..\include\dos\airboot.inc 27 28 .386p 29 model large, basic 30 31 code_seg segment public use16 32 assume cs:code_seg, ds:code_seg, es:nothing, ss:nothing 23 ;JUMPS 24 25 Include ../../INCLUDE/ASM.INC 26 27 .286p 28 .model small, basic 29 30 fixcode group code_seg,bss_data 31 32 code_seg segment use16 public 'CODE' 33 ;assume cs:code_seg, ds:code_seg, es:nothing, ss:nothing 34 assume cs:fixcode, ds:fixcode, es:nothing, ss:nothing 33 35 org 100h 34 36 COM_StartUp: jmp COM_Init … … 63 65 ShowMessage EndP 64 66 65 ShowError Proc Near Uses67 ShowError Proc Near 66 68 mov ah, 09h 67 69 int 21h ; DOS: WRITE STRING DS:DX TO CONSOLE 68 EndProgram: 69 mov ax, 4C00h 70 int 21h ; DOS: TERMINATE PROGRAM 70 jmp EndProgram 71 ret 71 72 ShowError EndP 72 73 73 COM_Init: mov ax, cs 74 COM_Init: 75 ; Setup and Copyright. 76 mov ax, cs 74 77 mov ds, ax 75 78 mov es, ax ; CS==DS==ES … … 77 80 call ShowMessage 78 81 79 ; =========================================== Load air-boot.bin82 ; Open AIR-BOOT.COM 80 83 mov dx, offset COM_LoadCode 81 84 call ShowMessage … … 90 93 DoneOpenCode: mov bx, ax ; BX = Filehandle 91 94 95 ; Load AIR-BOOT.COM 92 96 mov ah, 3Fh 93 97 mov cx, image_size ; Image size … … 98 102 call ShowError 99 103 100 DoneReadCode: cmp ax, image_size 104 105 DoneReadCode: 106 ; See if at least 'image-size' is loaded. 107 cmp ax, image_size 101 108 je DoneReadCode2 102 109 InvalidCode: mov dx, offset COM_FailedInvalidCode 103 110 call ShowError 104 111 112 ; Try to read again which is expected to fail. 113 ; Otherwise image is too large. 105 114 DoneReadCode2: mov ah, 3Fh 106 115 mov cx, 1 … … 112 121 jmp InvalidCode 113 122 123 ; It's loaded now, close it. 114 124 DoneReadCode3: mov ah, 3Eh 115 125 int 21h ; DOS: CLOSE FILE … … 118 128 call ShowMessage 119 129 120 ; =================================== Load MBR-protection image130 ; Open MBR_PROT.COM 121 131 mov dx, offset COM_LoadMBR 122 132 call ShowMessage … … 131 141 DoneOpenMBR: mov bx, ax ; BX = Filehandle 132 142 143 ; Load MBR_PROT.COM 133 144 mov ah, 3Fh 134 145 mov cx, 1024 ; Image size … … 139 150 call ShowError 140 151 141 DoneReadMBR: cmp ax, 1024 152 DoneReadMBR: 153 ; See if at least 1kB is loaded. 154 cmp ax, 1024 142 155 je DoneReadMBR2 143 156 InvalidMBR: mov dx, offset COM_FailedInvalidMBR 144 157 call ShowError 145 158 159 ; Try to read again which is expected to fail. 160 ; Otherwise image is too large. 146 161 DoneReadMBR2: mov ah, 3Fh 147 162 mov cx, 1 … … 153 168 jmp InvalidMBR 154 169 170 ; It's loaded now, close file. 155 171 DoneReadMBR3: mov ah, 3Eh 156 172 int 21h ; DOS: CLOSE FILE … … 159 175 call ShowMessage 160 176 177 178 161 179 ; ========================== Merge MBR-Protection into Bootcode 162 180 mov dx, offset COM_MergeMBR … … 164 182 165 183 ; Search for signature in Bootcode 184 ; Note the search is with sector granularity. 185 ; This means the signature must be 512 bytes aligned. 166 186 mov si, offset BootCode 167 187 mov di, offset MBRProtectionSignature 168 188 mov cx, MBRProtectionSignatureLen 169 mov dx, 54 ; 54 sectors where signature may be (all sectors preceding config sector) 189 ; 54 sectors where signature may be. 190 ; (all sectors preceding config sector) 191 mov dx, 54 170 192 COM_SignatureLoop: 171 push cx si di 193 push cx 194 push si 195 push di 172 196 repe cmpsb 173 pop di si cx 197 pop di 198 pop si 199 pop cx 174 200 je COM_GotSignature 175 201 add si, 512 … … 197 223 mov cx, 256 198 224 mov dx, 53 199 COM_CodeEndLoop:push cx si di 225 COM_CodeEndLoop:push cx 226 push si 227 push di 200 228 COM_CodeEndLoop2: 201 229 cmp wptr ds:[si], 0 … … 205 233 jnz COM_CodeEndLoop2 206 234 COM_ExitCodeEndLoop: 207 pop di si cx 235 pop di 236 pop si 237 pop cx 208 238 jne COM_FoundCodeEnd 209 239 sub si, 512 … … 249 279 jmp EndProgram 250 280 281 282 EndProgram: 283 ; DOS: TERMINATE PROGRAM 284 mov ax, 4C00h 285 int 21h 286 287 288 289 COM_EndOfSegment: 290 291 code_seg ends 292 293 bss_data segment use16 public 'BSS' 251 294 ; Buffers for files 252 295 BootCode db image_size dup (?) 253 296 MBRProtection db 1024 dup (?) 254 255 COM_EndOfSegment: 256 257 code_seg ends 297 bss_data ends 298 258 299 end COM_StartUp
Note:
See TracChangeset
for help on using the changeset viewer.