Changeset 30 for trunk/BOOTCODE/REGULAR
- Timestamp:
- May 6, 2011, 4:25:19 AM (15 years ago)
- Location:
- trunk/BOOTCODE/REGULAR
- Files:
-
- 4 added
- 9 edited
-
AUXIO.ASM (added)
-
BOOTMENU.ASM (modified) (27 diffs)
-
CONV.ASM (added)
-
DEBUG.ASM (added)
-
DRIVEIO.ASM (modified) (14 diffs)
-
MATH.ASM (added)
-
OTHER.ASM (modified) (9 diffs)
-
PARTMAIN.ASM (modified) (25 diffs)
-
PARTSCAN.ASM (modified) (21 diffs)
-
PASSWORD.ASM (modified) (2 diffs)
-
STD_TEXT.ASM (modified) (2 diffs)
-
TIMER.ASM (modified) (5 diffs)
-
VIDEOIO.ASM (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'BOOTMENU',0 24 ENDIF 25 22 26 BOOTMENU_BuildBackground Proc Near Uses es di 23 27 call VideoIO_CursorOff … … 32 36 BOOTMENU_BuildBackground EndP 33 37 38 CLR_COPYRIGHT_CLASSIC = 0f00h 39 CLR_COPYRIGHT_BM = 0700h 40 34 41 BOOTMENU_BuildMain Proc Near Uses es di 35 42 ; 1st line with Copyright information... 36 43 mov cx, 0101h 37 44 call VideoIO_Locate 38 mov cx, 0F00h45 mov cx, CLR_COPYRIGHT_BM 39 46 call VideoIO_Color 40 47 mov si, offset Copyright … … 42 49 43 50 ; Boot-Window... 44 mov cx, 0901h 51 CLR_BOOT_WINDOW_CLASSIC = 0901h 52 CLR_BOOT_WINDOW_BM = 0701h 53 54 mov cx, CLR_BOOT_WINDOW_BM 45 55 call VideoIO_Color 46 56 mov bx, 0201h … … 53 63 mov al, TextChar_WinLineRight 54 64 mov cl, 78 55 call VideoIO_Internal_MakeWinRight 65 call VideoIO_Internal_MakeWinRight 56 66 57 67 mov dl, 18h … … 63 73 64 74 ; Display Top-Infos in Boot-Window 65 mov cx, 0B01h 75 76 CLR_TOP_INFOS_CLASSIC = 0b01h 77 CLR_TOP_INFOS_BM = 0301h 78 79 mov cx, CLR_TOP_INFOS_BM 66 80 call VideoIO_Color 67 81 mov ch, 03h … … 91 105 92 106 ; Now make the separating vertical lines... 93 mov cx, 0901h 107 CLR_SEP_VERT_LINES_CLASSIC = 0901h 108 CLR_SEP_VERT_LINES_BM = 0701h 109 110 mov cx, CLR_SEP_VERT_LINES_BM 94 111 call VideoIO_Color 95 112 mov ch, 03h … … 157 174 ; Boot-Window is DONE 158 175 159 mov cx, 0C04h 160 call VideoIO_Color 176 ; Rousseau: = Colors = 177 ; FG 178 ; BG 179 ; 7 = grey 180 ; 6 = brown 181 ; 5 = magenta 182 ; 4 = red 183 ; 3 = cyan 184 ; 2 = green 185 ; 1 = blue 186 187 CLR_INFO_WINDOW_CLASSIC = 0c04h 188 CLR_INFO_WINDOW_BM = 0701h 189 190 mov cx, CLR_INFO_WINDOW_BM 191 ;mov cx, 0C06h ; brown, main background 192 call VideoIO_Color ; Rousseau: color info window 193 161 194 mov bx, 1401h 162 195 mov dx, 1950h … … 173 206 mov cx, 1703h 174 207 call VideoIO_Locate 175 mov cx, 0F04h 176 call VideoIO_Color 208 209 CLR_INFO_TEXT_CLASSIC = 0f04h 210 CLR_INFO_TEXT_BM = 0701h 211 212 mov cx, CLR_INFO_TEXT_BM ; Info text 213 call VideoIO_Color ; Rousseau: color info text 214 177 215 mov si, offset TXT_BootMenuHelpText1 178 216 call VideoIO_Print … … 182 220 call VideoIO_Print 183 221 184 mov cx, 0C04h 222 223 CLR_F10_SETUP_CLASSIC = 0c04h 224 CLR_F10_SETUP_BM = 0901h 225 226 mov cx, CLR_F10_SETUP_BM ; background F10 enter Setup 185 227 call VideoIO_Color 186 228 … … 198 240 call VideoIO_PrintSingleChar 199 241 ; HelpWindow done... 242 243 244 ; Rousseau: Debug Stuff, put here after building Main Menu 245 ;call VideoIO_DBG_WriteString 246 ;call VideoIO_DBG_WriteString2 247 200 248 ret 201 249 BOOTMENU_BuildMain EndP 250 251 202 252 203 253 BOOTMENU_BuildGoodBye Proc Near Uses es di … … 209 259 rep stosw 210 260 ; ------------------------------------------- 211 mov cx, 0D05h 261 262 CLR_GOODBYE_WINDOW_CLASSIC = 0d05h 263 CLR_GOODBYE_WINDOW_BM = 0f01h 264 265 mov cx, CLR_GOODBYE_WINDOW_BM 212 266 call VideoIO_Color 213 267 mov bx, 0101h … … 221 275 mov cx, 9 222 276 mov al, WinCharRight 223 mov ah, 05Dh 277 278 ; Little part before version in goodbye-window 279 ; Does not use color-function 280 ;mov ah, 05Dh 281 mov ah, 01fh 224 282 rep stosw 283 225 284 mov cx, 010Bh 226 285 call VideoIO_Locate … … 240 299 mov al, TextChar_WinRep4 241 300 call VideoIO_PrintSingleChar 242 mov cx, 0E01h 301 302 CLR_GOODBYE_AB_VERSION_CLASSIC = 0e01h 303 CLR_GOODBYE_AB_VERSION_BM = 0e03h 304 305 mov cx, CLR_GOODBYE_AB_VERSION_BM 243 306 call VideoIO_Color 244 307 mov si, offset Copyright 245 308 mov cl, 11+CopyrightVersionLen 246 309 call VideoIO_FixedPrint 247 mov cx, 0D05h 310 311 mov cx, CLR_GOODBYE_WINDOW_BM 312 248 313 call VideoIO_Color 249 314 mov al, TextChar_WinRep5 … … 251 316 mov cx, 020Dh 252 317 call VideoIO_Locate 253 mov cx, 0F05h 318 319 CLR_GOODBYE_WINDOW_CLASSIC_2 = 0f05h 320 CLR_GOODBYE_WINDOW_BM_2 = 0701h 321 322 mov cx, CLR_GOODBYE_WINDOW_BM_2 254 323 call VideoIO_Color 255 324 inc si … … 272 341 BOOTMENU_BuildGoodBye EndP 273 342 343 344 274 345 ; Must preserve AX! 275 346 BOOTMENU_BuildTimedBootText Proc Near Uses ax cx si es di 276 mov cx, 1503h 277 call VideoIO_Locate 278 mov cx, 0E04h 347 mov cx, 1503h ; 348 call VideoIO_Locate 349 350 CLR_NON_TIMED_BAR_CLASSIC = 0e04h 351 CLR_NON_TIMED_BAR_BM = 0701h 352 353 mov cx, CLR_NON_TIMED_BAR_BM ; non-timed time bar 279 354 call VideoIO_Color 280 355 call VideoIO_Internal_SetRegs … … 294 369 mov cx, 1503h 295 370 call VideoIO_Locate 296 mov cx, 0E04h 371 372 CLR_TIMED_BAR_CLASSIC = 0e04h 373 CLR_TIMED_BAR_BM = 0e04h 374 375 mov cx, CLR_TIMED_BAR_BM ; timed time bar, yellow on red 297 376 call VideoIO_Color 298 377 mov si, offset TXT_TimedBootLine ; will print TimedBootEntryName too … … 325 404 BOOTMENU_RefreshPartitionText EndP 326 405 406 407 CLR_VOLUME_INDEX_CLASSIC = 0f01h 408 CLR_VOLUME_INDEX_BM = 0f01h 409 327 410 ; Writes Partition-Information to Screen (Boot-Menu) 328 411 ; In: CH - Line to print info … … 339 422 mov dh, cl 340 423 call VideoIO_Locate 341 mov cx, 0F01h; Bwhite, blue424 mov cx, CLR_VOLUME_INDEX_BM ; Bwhite, blue 342 425 call VideoIO_Color 343 426 mov al, dl … … 347 430 ; === Display Drive-Number and Size (Size only in detailed view) === 348 431 add dh, 5 349 movzx cx, dh 350 call VideoIO_Locate 351 mov cx, 0D01h 432 ;movzx cx, dh 433 mov cl,dh 434 mov ch,0 435 436 call VideoIO_Locate 437 438 CLR_HD_INDEX_CLASSIC = 0d01h 439 CLR_HD_INDEX_BM = 0701h 440 441 mov cx, CLR_HD_INDEX_BM 352 442 call VideoIO_Color ; Violet, blue 353 443 mov si, PartPointer … … 367 457 BMBPT_IsHarddrive: 368 458 ; Now display Size-Element... 369 mov cx, 0501h 459 460 CLR_HD_SIZE_CLASSIC = 0501h 461 CLR_HD_SIZE_BM = 0701h 462 463 mov cx, CLR_HD_SIZE_BM 370 464 call VideoIO_Color ; Dark-Violet, Blue 371 465 mov al, '/' 372 466 call VideoIO_PrintSingleChar 373 mov cx, 0D01h467 mov cx, CLR_HD_SIZE_BM 374 468 call VideoIO_Color ; Violet, Blue 375 469 mov ax, PartPointer ; Get Size-Element from PartPtr (AX) … … 383 477 384 478 ; === Display Label === 385 movzx cx, dh 386 call VideoIO_Locate 387 mov cx, 0E01h 479 ;movzx cx, dh 480 mov cl,dh 481 mov ch,0 482 483 call VideoIO_Locate 484 485 CLR_LABEL_CLASSIC = 0e01h 486 CLR_LABEL_BM = 0f01h 487 488 mov cx, CLR_LABEL_BM 388 489 call VideoIO_Color ; Yellow, blue 389 490 mov si, PartPointer … … 394 495 ; === Display Type === 395 496 add dh, 14 396 movzx cx, dh 497 ;movzx cx, dh 498 mov cl,dh 499 mov ch,0 500 397 501 call VideoIO_Locate 398 502 mov si, PartPointer 399 503 mov al, [si+LocIPT_SystemID] 400 504 call PART_SearchFileSysName 401 mov cx, 0C01h 505 506 CLR_FS_NAME_CLASSIC = 0c01h 507 CLR_FS_NAME_BM = 0701h 508 509 mov cx, CLR_FS_NAME_BM 402 510 call VideoIO_Color ; Hrot, Blau 403 511 mov cl, 8 … … 410 518 ; Out: DX - will get returned (fixed, if needed) 411 519 BOOTMENU_BuildChoiceBar Proc near Uses ax es di 520 521 ;call SOUND_Beep 522 412 523 call VideoIO_WaitRetrace 524 525 526 ;call SOUND_Beep 527 413 528 mov cl, 10h ; Color BLUE, Partition DL 414 529 call BOOTMENU_ReColorPart 530 531 ;call SOUND_Beep 415 532 416 533 ; Check, if clipping needed... … … 448 565 call BOOTMENU_RefreshPartitionText 449 566 567 568 ; Keuze bar 569 ; 00h black 570 ; 10h blue 571 ; 20h green (also nice) 572 ; 30h cyan (also nice) 573 ; 40h red 574 ; 50h magenta 575 ; 60h brown (nice) 576 ; 70h white 577 ; 80h grey 578 ; 90h light blue (nice) 579 ; 0a0h bright green 580 ; 0b0h bright cyan 581 ; 0c0h bright red 582 ; 0d0h bright magenta 583 ; 0e0h bright yellow 584 ; 0f0h bright white 585 586 587 CLR_SELECTION_BAR_CLASSIC = 50h 588 CLR_SELECTION_BAR_BM = 090h 589 590 591 450 592 BMBCB_AfterScrolling: 451 mov cl, 50h; Color PINK, Partition DL593 mov cl, CLR_SELECTION_BAR_BM ; Color PINK, Partition DL 452 594 call BOOTMENU_ReColorPart 453 595 ret … … 457 599 ; Destroyed: None, but Locate-Pointer gets set 458 600 BOOTMENU_ReColorPart Proc Near Uses bx cx es di 601 602 ; call SOUND_Beep 603 459 604 mov bh, cl ; Color to BH 460 605 ; First calculate location of bar … … 475 620 and al, 0Fh 476 621 or al, bh ; Adds background color (from BH) 622 623 ;mov al,97h 624 477 625 mov es:[di], al 478 626 add di, 2 … … 615 763 ; Got it, so display bar... 616 764 mov dh, dl 765 766 ;call SOUND_Beep 767 617 768 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active 769 770 ;call SOUND_Beep 771 618 772 call SOUND_PreBootMenu 619 773 774 620 775 BME_MainLoop: 776 777 ;call VideoIO_DBG_WriteString2 ; Rousseau 778 621 779 test TimedBootEnable, 1 622 780 jz BME_NoTimedBoot -
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r29 r30 19 19 ; AiR-BOOT / DRIVE I/O 20 20 ;--------------------------------------------------------------------------- 21 22 23 24 IFDEF ModuleNames 25 DB 'DRIVEIO',0 26 ENDIF 21 27 22 28 ; Note: Some routines set DS/ES to CS or even address via CS, even if its not … … 141 147 ; This is calculated by Sector*Heads. Comparing will get done with Bit 25-10 142 148 ; on LBA sectors, so we actually divide sector number by 1024. 143 DriveIO_InitLBASwitchTable Proc Near Uses es di 149 DriveIO_InitLBASwitchTable Proc Near Uses es di ; Rousseau: LBA ! 144 150 mov di, offset LBASwitchTable 145 151 mov dh, TotalHarddiscs … … 152 158 jc DIOILUT_Error 153 159 and cl, 111111b ; Isolate lower 6 bits of CL -> sector count 154 movzx ax, cl 155 mov bl, dh ; DH -> head count 160 161 ; huge disk 127 sec/track on <1TB using DANI 162 ; mov cl, 07Fh 163 164 ;movzx ax, cl 165 mov al,cl 166 mov ah,0 167 168 mov bl, dh ; DH -> head count ; Rousseau: nope, it's max head number ! 156 169 mul bl ; AX = Sectors*Heads 157 170 shl ah, 1 … … 168 181 DriveIO_InitLBASwitchTable EndP 169 182 183 184 185 170 186 ; Adjusts BX:AX / CX:DX to meet LVM sector location 171 187 ; Destroys SI 172 DriveIO_LVMAdjustToInfoSector Proc Near Uses 173 push cx 174 xor ch, ch 175 and cl, 63 ; Isolate lower bits, because upper 176 mov si, 63 ; ones may be used for cylinder 177 sub si, cx 178 pop cx 179 add ax, si 180 adc bx, 0 ; Adjust LBA Sector (BX:AX) 181 or cl, 63 ; Set Sector to 63 182 ret 188 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 189 ; Ugly, need to cleanup. 190 DriveIO_LVMAdjustToInfoSector Proc Near Uses ; Rousseau: LVM stuff ! 191 192 193 194 ; pusha 195 ; call AuxIO_TeletypeNL 196 197 ; LBA 198 ; xchg dx,bx 199 ; call AuxIO_TeletypeHexDWord 200 ; call AuxIO_TeletypeNL 201 ; xchg bx,dx 202 203 ; CYL 204 ; mov al,ch 205 ; call AuxIO_TeletypeHexByte 206 ; call AuxIO_TeletypeNL 207 208 ; HEAD 209 ; mov al,dh 210 ; call AuxIO_TeletypeHexByte 211 ; call AuxIO_TeletypeNL 212 213 ; SEC 214 ; mov al,cl 215 ; call AuxIO_TeletypeHexByte 216 ; call AuxIO_TeletypeNL 217 218 ; DRIVE 219 ; mov al,dl 220 ; call AuxIO_TeletypeHexByte 221 ; call AuxIO_TeletypeNL 222 223 ; popa 224 225 226 ;local ts:word 227 ;local ts2:word 228 229 pusha 230 231 ; Dump drive 232 mov si,offset drive 233 call AuxIO_Print 234 xchg al,dl 235 call AuxIO_TeletypeHexByte 236 call AuxIO_TeletypeNL 237 xchg dl,al 238 239 ; Dump SPT 240 mov si,offset spt_used 241 call AuxIO_Print 242 push dx 243 push bx 244 xor dh,dh 245 and dl,01111111b 246 shl dx,1 247 shl dx,1 248 mov bx, offset TrueSecs 249 add bx,dx 250 mov ax,word ptr [bx] 251 252 ;mov [ts],ax 253 254 call AuxIO_TeletypeHexWord 255 call AuxIO_TeletypeNL 256 pop bx 257 pop dx 258 259 pusha 260 push dx 261 ; Location of extended position 262 mov dx,word ptr [ExtendedAbsPos+02] 263 mov ax,word ptr [ExtendedAbsPos+00] 264 call AuxIO_TeletypeHexDWord 265 call AuxIO_TeletypeNL 266 pop dx 267 268 xor dh,dh 269 and dl,01111111b 270 shl dx,1 271 shl dx,1 272 mov bx, offset TrueSecs 273 add bx,dx 274 275 mov ax, word ptr[bx] 276 call AuxIO_TeletypeHexWord 277 call AuxIO_TeletypeNL 278 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 279 call AuxIO_TeletypeHexByte 280 call AuxIO_TeletypeNL 281 ; mov si,offset PartitionSector 282 ; call AuxIO_DumpSector 283 popa 284 285 ; LBA 286 mov si,offset before_lvm_adjust 287 call AuxIO_Print 288 289 xchg dx,bx 290 call AuxIO_TeletypeHexDWord 291 call AuxIO_TeletypeNL 292 xchg bx,dx 293 popa 294 295 296 ;or bx,ax 297 test [ExtendedAbsPosSet],1 298 jz pri 299 300 301 302 303 pusha 304 mov si,offset before_lvm_adjust_log 305 call AuxIO_Print 306 ; LBA 307 xchg dx,bx 308 call AuxIO_TeletypeHexDWord 309 call AuxIO_TeletypeNL 310 xchg bx,dx 311 popa 312 313 314 push dx 315 push bx 316 xor dh,dh 317 and dl,01111111b 318 shl dx,1 319 shl dx,1 320 mov bx,offset TrueSecs 321 add bx,dx 322 mov dx,[bx] 323 dec dx 324 add ax,dx 325 pop bx 326 pop dx 327 adc bx,0 328 329 330 pusha 331 mov si,offset after_lvm_adjust_log 332 call AuxIO_Print 333 ; LBA 334 xchg dx,bx 335 call AuxIO_TeletypeHexDWord 336 call AuxIO_TeletypeNL 337 xchg bx,dx 338 popa 339 340 jmp done 341 342 343 344 345 pri: 346 347 348 push ax 349 push cx 350 xor ch, ch ; Zero out upper-byte 351 352 push dx 353 xor dh,dh 354 and dl,01111111b 355 shl dx,1 356 shl dx,1 357 push bx 358 mov bx,offset TrueSecs 359 add bx,dx 360 mov ax,[bx] 361 ;mov [ts2],ax 362 pop bx 363 pop dx 364 365 366 367 ;mov al, 63 368 ;call VideoIO_PrintByteDynamicNumber 369 ;self: jmp self 370 371 372 373 ; DEZE WERKT SOMS NIET GOED 374 ; ROMMELT MET CYLINDERS 375 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 376 377 and cl, al ; Isolate lower bits, because upper 378 mov ah, 0 379 mov si, ax ; ones may be used for cylinder 380 sub si, cx 381 382 pop cx 383 pop ax 384 385 or cl, al ; Set sector to last sector 386 387 add ax, si ; Adjust lower LBA 388 adc bx, 0 ; Adjust LBA Sector (BX:AX) 389 390 391 392 ;push ax 393 ;call AuxIO_TeletypeHexWord 394 ;call AuxIO_TeletypeNL 395 ;mov ax,[ts] 396 ;call AuxIO_TeletypeHexWord 397 ;call AuxIO_TeletypeNL 398 ;mov ax,[ts2] 399 ;call AuxIO_TeletypeHexWord 400 ;call AuxIO_TeletypeNL 401 ;pop ax 402 403 ;and ax,[ts] 404 405 jmp done 406 407 408 409 done: 410 411 412 413 pusha 414 mov si,offset after_lvm_adjust 415 call AuxIO_Print 416 ; LBA 417 xchg dx,bx 418 call AuxIO_TeletypeHexDWord 419 call AuxIO_TeletypeNL 420 xchg bx,dx 421 popa 422 423 424 425 ; pusha 426 ; call AuxIO_TeletypeNL 427 428 ; CYL 429 ; mov al,ch 430 ; call AuxIO_TeletypeHexByte 431 ; call AuxIO_TeletypeNL 432 433 ; HEAD 434 ; mov al,dh 435 ; call AuxIO_TeletypeHexByte 436 ; call AuxIO_TeletypeNL 437 438 ; SEC 439 ; mov al,cl 440 ; call AuxIO_TeletypeHexByte 441 ; call AuxIO_TeletypeNL 442 443 ; DRIVE 444 ; mov al,dl 445 ; call AuxIO_TeletypeHexByte 446 ; call AuxIO_TeletypeNL 447 448 ; popa 449 450 451 452 ret 183 453 DriveIO_LVMAdjustToInfoSector EndP 184 454 185 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 186 Routine: Loads partition to ExecBase and checks for validity 187 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 188 Calling : bx:ax - Absolute sector 189 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 190 Returns : Carry Set if invalid partition encountered 191 Preserve: all registers 192 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 455 drive: db 'drive : ',0 456 before_lvm_adjust: db 'before lvm adjust : ',0 457 after_lvm_adjust: db 'after lvm adjust : ',0 458 before_lvm_adjust_log: db 'before lvm logical adjust: ',0 459 after_lvm_adjust_log: db 'after lvm logical adjust : ',0 460 spt_used: db 'spt used : ',0 461 462 463 464 ; ######################################################################### 465 ; Routine: Loads partition to ExecBase and checks for validity 466 ; ######################################################################### 467 ; Calling : bx:ax - Absolute sector 468 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 469 ; Returns : Carry Set if invalid partition encountered 470 ; Preserve: all registers 471 ; ######################################################################### 193 472 DriveIO_LoadPartition Proc Near Uses si 194 473 mov wptr cs:[CurPartition_Location+0], ax … … 209 488 stc ; Set carry, so no partition table 210 489 DIOLP_Success: 490 491 IFDEF AuxDebug 492 ; show current partition location 493 pushf 494 pusha 495 call AuxIO_TeletypeNL 496 mov si,offset db_curpartloc 497 call AuxIO_Print 498 mov dx,word ptr [CurPartition_Location+02] 499 mov ax,word ptr [CurPartition_Location+00] 500 call AuxIO_TeletypeHexDWord 501 call AuxIO_TeletypeNL 502 mov si,offset PartitionSector 503 call AuxIO_DumpSector 504 call AuxIO_TeletypeNL 505 popa 506 popf 507 ENDIF 508 211 509 ret 212 510 DIOLP_Failed: … … 214 512 DriveIO_LoadPartition EndP 215 513 216 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 217 Routine: Writes a partition from ExecBase to its original sector218 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 219 Calling : none220 Returns : none221 Preserve: all registers222 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 514 ; ######################################################################### 515 ; Routine: Writes a partition from ExecBase to its original sector 516 ; ######################################################################### 517 ; Calling : none 518 ; Returns : none 519 ; Preserve: all registers 520 ; ######################################################################### 223 521 DriveIO_SavePartition Proc Near Uses ax bx cx dx si 224 522 mov ax, wptr cs:[CurPartition_Location+0] … … 237 535 DriveIO_LoadTmpSector Proc Near Uses 238 536 mov si, offset TmpSector 239 call DriveIO_LoadSector 537 call DriveIO_LoadSector ; Uses INT13X if needed 240 538 ret 241 539 DriveIO_LoadTmpSector EndP … … 256 554 mov dx, wptr cs:[CurPartition_Location+4] 257 555 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 258 call DriveIO_LVMAdjustToInfoSector 556 557 call DriveIO_LVMAdjustToInfoSector ; Rousseau: LVM stuff ! 558 259 559 mov si, offset LVMSector 260 560 call DriveIO_LoadSector 261 call LVM_CheckSectorSignature 561 562 IFDEF AuxDebug 563 ; show current partition location 564 pushf 565 pusha 566 call AuxIO_TeletypeNL 567 mov si,offset db_curlvmsec 568 call AuxIO_Print 569 mov dx,bx 570 call AuxIO_TeletypeHexDWord 571 call AuxIO_TeletypeNL 572 mov si,offset LVMSector 573 call AuxIO_DumpSector 574 call AuxIO_TeletypeNL 575 popa 576 popf 577 ENDIF 578 579 ; Rousseau 580 ;pushf 581 ;pusha 582 ;mov si, offset MyText4 583 ;call VideoIO_Print 584 ;mov si, offset LVMSector 585 ;mov al, [si+LocLVM_VolumeLetter2] 586 ;call VideoIO_PrintByteDynamicNumber 587 ;mov al, [si+LocLVM_Startable] 588 ;call VideoIO_PrintByteDynamicNumber 589 ;mov al, [si+LocLVM_OnBootMenu] 590 ;call VideoIO_PrintByteDynamicNumber 591 ;;self: jmp self 592 ;popa 593 ;popf 594 595 call LVM_CheckSectorSignature ; Rousseau: LVM stuff ! 262 596 jnc DIOLLVMS_NoLVMSector 263 call LVM_CheckSectorCRC 597 call LVM_CheckSectorCRC ; Rousseau: LVM stuff ! 264 598 jnc DIOLLVMS_NoLVMSector 265 599 ret … … 303 637 jnz InScanMode 304 638 jmp MBR_LoadError 305 InScanMode: 639 InScanMode: 306 640 mov si, offset TXT_BrokenPartitionTable 307 641 push cs … … 319 653 DriveIO_GotLoadError EndP 320 654 321 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 322 Routine: Loads a specified sector to DS:DI323 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 324 Calling : bx:ax - Absolute sector325 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)326 ds:si - Destination-Adress327 Returns : none328 Preserve: all registers329 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 330 DriveIO_LoadSector Proc Near Uses ax bx ds si es di 655 ; ######################################################################### 656 ; Routine: Loads a specified sector to DS:DI 657 ; ######################################################################### 658 ; Calling : bx:ax - Absolute sector 659 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 660 ; ds:si - Destination-Adress 661 ; Returns : none 662 ; Preserve: all registers 663 ; ######################################################################### 664 DriveIO_LoadSector Proc Near Uses ax bx ds si es di ; Rousseau: Disk IO 331 665 test cs:[CurIO_UseExtension], 1 332 666 jz DIOLS_UseNormal 333 667 ; Are we forced do use LBA via Setting? 334 test cs:[CFG_ForceLBAUsage], 1 668 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 335 669 jnz DIOLS_UseExtension 336 670 ; Is the drive not a harddrive? … … 351 685 pop es 352 686 mov bx, si ; ES:BX - Destination 353 mov ax, 0201h ; Function 2 - Load Sector 687 mov ax, 0201h ; Function 2 - Load Sector ; Rousseau: Disk IO -- legacy BIOS call 354 688 int 13h 355 689 jnc DIOLS_Success … … 370 704 pop ds 371 705 mov si, offset DriveIO_DAP 372 mov ah, 42h ; Extended Read 706 mov ah, 42h ; Extended Read ; Rousseau: Disk IO -- extended BIOS call 373 707 int 13h 374 708 pop cx … … 381 715 DriveIO_LoadSector EndP 382 716 383 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 384 Routine: Writes DS:SI to a specified sector385 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 386 Calling : bx:ax - Absolute sector387 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)388 ds:si - Source-Adress389 Returns : none390 Preserve: all registers391 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 717 ; ######################################################################### 718 ; Routine: Writes DS:SI to a specified sector 719 ; ######################################################################### 720 ; Calling : bx:ax - Absolute sector 721 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 722 ; ds:si - Source-Adress 723 ; Returns : none 724 ; Preserve: all registers 725 ; ######################################################################### 392 726 DriveIO_SaveSector Proc Near Uses ax bx cx ds si es di 393 727 test cs:[CurIO_UseExtension], 1 394 728 jz DIOSS_UseNormal 395 729 ; Are we forced do use LBA via Setting? 396 test cs:[CFG_ForceLBAUsage], 1 730 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 397 731 jnz DIOSS_UseExtension 398 732 ; Is the drive not a harddrive? … … 440 774 ret 441 775 DriveIO_SaveSector EndP 776 777 778 ; See if a LVM-sector is valid. 779 ; In : si, pointer to sector 780 ; Out : ZF=true, not valid; ZF=false, valid 781 DriveIO_LVMSectorValid Proc Near 782 pusha 783 784 call LVM_CheckSectorSignature 785 mov al,0 786 rcl al,1 ; Move CY to AL.0 787 call AuxIO_TeletypeHexByte 788 call AuxIO_TeletypeNL 789 or al,al ; Zero if not a valid sector 790 jz DriveIO_LVMSectorValid_End ; Not a valid sector 791 792 call LVM_CheckSectorCRC 793 stc 794 mov al,0 795 rcl al,1 ; Move CY to AL.0 796 call AuxIO_TeletypeHexByte 797 call AuxIO_TeletypeNL 798 or al,al ; Zero if not a valid sector 799 800 DriveIO_LVMSectorValid_End: 801 802 popa 803 ret 804 DriveIO_LVMSectorValid EndP 805 806 ; ------------------------------------------------------ 807 ; Rousseau: # Load the master LVM-sector is one exists # 808 ; ------------------------------------------------------ 809 ; Load the master LVM-sector to get the number of sectors per track as eCS views the drive. 810 ; If no master LVM-sector is found it is assumed eCS is not installed. 811 ; The master LVM-sector can be located at three different places according to drive size 812 ; and partitioning scheme and driver used. 813 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for drives >502GiB but <1TiB. 814 ; Then the location will be sector 127 which is LBA 126 (7Eh). 815 ; IBM1S506.ADD will always use 255/255 for the extended eCS geometry. 816 ; DANIS506.ADD will use 255/255 for drives >1TiB. 817 ; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh). 818 ; When eCS is installed on a huge drive that alread had a system on it, eCS will be confined to the 819 ; lower 502GiB of the drive. In this case the normal geometry from Int13X will be used. 820 ; This is also the case when no valid master LVM-sector can be found. 821 ; 822 ; Return ZF=true if not found, ZF=false when valid master LVM-sector found. 823 DriveIO_LoadMasterLVMSector Proc Near 824 pusha 825 826 mov si,offset db_lmlvm 827 ;call AuxIO_Print 828 829 mov al,dl 830 ;call AuxIO_TeletypeHexByte 831 ;call AuxIO_TeletypeNL 832 833 834 ; Loop over the sector-translation table, 835 ; process the first three values from high (255) to low (bios spt, most likely 63) 836 mov cx,3 837 DriveIO_LoadMasterLVMSector_NextTry: 838 mov bx,offset secs_per_track_table ; sector translation table that corresponds with IsHugeDrive 839 mov si, offset LVMSector ; space to load the master LVM-sector 840 mov [DriveIO_DAP_NumBlocks],1 ; number of sectors to read 841 mov wptr [DriveIO_DAP_Transfer+0],si ; low part of transfer address 842 mov ax, ds 843 mov wptr [DriveIO_DAP_Transfer+2],ax ; high part of transfer address 844 mov ax,cx ; use the counter... 845 dec ax ; as an index into the table 846 xlatb ; translate to number of sectors 847 dec al ; LBA is zero-based, so adjust 848 849 IFDEF AuxDebug 850 ; Dump the value 851 ;call AuxIO_TeletypeHexByte 852 ;call AuxIO_TeletypeNL 853 ENDIF 854 855 mov wptr [DriveIO_DAP_Absolute+0],ax ; LBA low ; 856 mov wptr [DriveIO_DAP_Absolute+2],00h ; LBA high 857 mov si, offset DriveIO_DAP ; address request packet 858 mov ah, 42h 859 int 13h ; do the i/o 860 jc DriveIO_LoadMasterLVMSector_NotFound ; oops, there was an error 861 862 IFDEF AuxDebug 863 ; Dump title 864 mov si,offset db_masterlvm 865 ;call AuxIO_Print 866 867 ; Dum sector 868 mov si, offset LVMSector 869 ;call AuxIO_DumpSector 870 ;call AuxIO_TeletypeNL 871 ENDIF 872 ; See is this is a valid LVM-sector 873 call DriveIO_LVMSectorValid 874 875 IFDEF AuxDebug 876 pushf 877 ;call AuxIO_TeletypeNL 878 popf 879 ENDIF 880 ; Yep, we found the master LVM-sector 881 jnz DriveIO_LoadMasterLVMSector_Found 882 ; Try next location 883 loop DriveIO_LoadMasterLVMSector_NextTry 884 885 ; No master LVM-sector found, set ZF=true 886 DriveIO_LoadMasterLVMSector_NotFound: 887 xor ax,ax 888 889 ; Jump here with ZF=false if found 890 DriveIO_LoadMasterLVMSector_Found: 891 892 popa 893 ret 894 DriveIO_LoadMasterLVMSector Endp 895 896 897 898 899 ; --------------------------------------------------- 900 ; Rousseau ## Large drives, (eCS) geometry and LBA ## 901 ; --------------------------------------------------- 902 ; A sector size of 512 bytes is assumed in the below calculations. 903 ; Note that this scheme changes when the sector size will be 4096 or larger, 904 ; like with modern drives that do not translate to 512 bytes per sector anymore. 905 ; These drives will have a capacity above the 2TiB LBA32 boundary. 906 ; For now, we assume drives <=2TiB with a sector size of 512 bytes. 907 908 ; There are a few boundaries that are of importance. 909 ; Note that these are disk-boundaries and not partition boundaries. 910 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on an 911 ; empty huge disk. 912 ; These boundaries are (from high to low): 913 914 ; (code 5) 915 ; 2^32 = 4294967296 = 100000000 sectors = 2048 GiB 916 ; This is the LBA32 2TiB boundary. 917 ; Everything above it must be addressed using LBA48. 918 ; OS/2 can currently not address this space above. 919 920 ; (code4) 921 ; 65536*255*255 = 4261478400 = FE010000 sectors ~ 2032 GiB 922 ; This is the max OS/2 boundary using 255/255 extended geometry. 923 ; OS/2 can currently not address this space above. 924 925 ; (code 3) 926 ; 2^31 = 2147483648 = 80000000 sectors = 1024 GiB 927 ; This is the LBA32 1TiB boundary. 928 ; OS/2 can address this space and will use 255/255 extended geometry. 929 930 ; (code 2) 931 ; 65536*255*127 = 2122383360 = 7E810000 sectors ~ 1012 GiB 932 ; This is the DANI 1TiB boundary. 933 ; OS/2 can address this space and will use 255/255 extended geometry. 934 ; Below this DANI will use 255/127 extended geometry. 935 ; This matters on where the LVM-sectors are located ! 936 937 ; (code 1) 938 ; 65536*255*63 = 1052835840 = 3EC10000 sectors ~ 502 GiB 939 ; This is the current OS/2 limit using this geometry because OS/2 can currently 940 ; not address more than 65536 cylinders. 941 ; DANI will address space above with 255/127 extended geometry up until the DANI 1TiB boundary (code 2) 942 943 ; (code 0) 944 ; Everything below 65536*255*63 will be addressed using standard geometry. 945 946 947 ; 948 ; This function will return the following values: 949 ; 950 951 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more than 4294967296 sectors. 952 ; LBA48 addressing is needed to access the complete capacity of the drive. 953 ; OS/2 is currently unable to do so. 954 955 ; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32. 956 ; This is an OS/2 boundary and OS/2 is not able to access the drive above this boundary. 957 958 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 2147483648 sectors. 959 ; OS/2 is able to access the drive using it's extended geometry. 960 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 961 962 ; 2 = This drive is above the 65536*255*127 (2122383360) boundary but below 2^31. 963 ; OS/2 is able to access the drive using it's extended geometry. 964 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 965 966 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but below 65536*255*127. 967 ; OS/2 is able to access the drive using it's extended geometry. 968 ; Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry ! 969 ; Using DANI or IBM influences the location of the LVM info-sectors ! 970 971 ; 0 = This drive is below the 65536*255*63 (1052835840) boundary. 972 ; OS/2 is able to access this drive using the standard 255/63 geometry. 973 974 ; So, any return value >0 means OS/2 extended geometry will be used. 975 ; Value 1 will use 255/127 with DANIS506 but 255/255 with IBM1S506. 976 ; Values 2 and 3 will use 255/255 on both drivers. 977 ; You can or with 0x01 and check for 3 in this case. 978 ; Any value above 3 will be a drive who's capacity cannot be fully used by OS/2 979 ; The upper limit of 65536*255*255 will be in effect here. 980 981 ; Note this function currently handles the boot-drive only ! 982 ; It should be extended and use dl for the drive-number as a parameter. 983 ; Because we use this function to get this info in a number of places, 984 ; all regs and flags except AX are saved and restored. 985 986 ; DL contains BIOS disk-number; 80h for first, 81h for second, etc. 987 DriveIO_GatherDiskInfo Proc Near 988 pushf 989 push bx 990 push cx 991 push dx 992 push si 993 push di 994 push es 995 996 ; Set ES to CS for buffer clearing 997 push cs 998 pop es 999 1000 ; Clear the buffer 1001 ; Don't overwrite the word of the buffersize at index 0 ! 1002 ; Old Phoenix BIOSses require word (flags) at 02 to be zero, 1003 ; so we clear the whole buffer to be sure. 1004 mov cx, i13xbuf_size 1005 mov di, offset i13xbuf 1006 mov [di],cx 1007 inc di 1008 inc di 1009 xor ah,ah 1010 cld 1011 rep stosb 1012 1013 ; Get the drive parameters 1014 mov ah, 48h ; Get Drive Parameters (extended version) 1015 ;mov dl, 80h ; Drive number 1016 mov si, offset i13xbuf ; Buffer for result-info 1017 push dx 1018 int 13h ; Call the BIOS-function 1019 pop dx 1020 1021 ; Do some error-checking 1022 or ah,ah ; AH is zero if no error (ZF=1 if no error) 1023 mov ax,0 ; Setup code for non-huge drive (does not influence ZF) 1024 jz DriveIO_GatherDiskInfo_ok ; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive 1025 jnc DriveIO_GatherDiskInfo_ok ; Return if error (CY=1), assuming non-huge drive 1026 jmp DriveIO_GatherDiskInfo_ret 1027 1028 1029 DriveIO_GatherDiskInfo_ok: 1030 1031 ; 1032 ; Store the drive geometry 1033 ; 1034 1035 mov si, offset i13xbuf 1036 1037 xor dh,dh 1038 and dl,01111111b 1039 shl dx,1 1040 shl dx,1 1041 1042 ; Store number of cylinders on disk 1043 mov bx, offset BIOS_Cyls 1044 add bx,dx 1045 mov ax,[si+04h] 1046 1047 mov word ptr [bx+00],ax 1048 mov ax,[si+06] 1049 mov word ptr [bx+02],ax 1050 1051 ; Store number of heads per cylinder 1052 mov bx, offset BIOS_Heads 1053 add bx,dx 1054 mov ax,[si+08h] 1055 mov word ptr [bx+00],ax 1056 mov ax,[si+0ah] 1057 mov word ptr [bx+02],ax 1058 1059 ; Store number of sectors per track 1060 mov bx, offset BIOS_Secs 1061 add bx,dx 1062 mov ax,[si+0ch] 1063 mov word ptr [bx+00],ax 1064 1065 ; Update first byte of translation-table to conform to BIOS SPT 1066 mov byte ptr [secs_per_track_table], al 1067 1068 mov ax,[si+0eh] 1069 mov word ptr [bx+02],ax 1070 1071 ; Store total secs 1072 mov bx, offset BIOS_TotalSecs 1073 add bx,dx 1074 add bx,dx 1075 mov ax,[si+10h] 1076 1077 mov word ptr [bx+00],ax 1078 mov ax,[si+12h] 1079 mov word ptr [bx+02],ax 1080 mov ax,[si+14h] 1081 mov word ptr [bx+04],ax 1082 mov ax,[si+18h] 1083 mov word ptr [bx+06],ax 1084 1085 ; Store number of bytes per sector 1086 mov bx, offset BIOS_Bytes 1087 add bx,dx 1088 mov ax,[si+18h] 1089 mov [bx],ax 1090 1091 1092 ; 1093 ; See of it's a huge drive of not 1094 ; 1095 1096 ; Drive is larger than 2TiB 1097 mov ax,5 ; Drive code (5) 1098 mov bx, [si+14h] ; Low word of high dword of sector-count 1099 or bx, [si+16h] ; High word of high dword of sector-count 1100 jnz DriveIO_GatherDiskInfo_ret ; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing 1101 1102 ; Drive is larger than max OS/2 capacity 1103 dec ax ; Drive code (4) 1104 mov bx, [si+12h] ; High word of low dword of sector-count 1105 cmp bx, 0fe01h ; Boundary 1106 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1107 ; we have a drive larger than to 65536*255*255 = FE010000 sectors 1108 1109 ; Drive can be completely utilized by OS/2 1110 dec ax ; Drive code (3) 1111 cmp bx, 8000h ; Boundary 1112 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1113 ; we have a drive larger than 2^31 sectors but smaller than 65536*255*255 1114 1115 ; This is the small area between DANI 1TiB and LBA 1TiB 1116 dec ax ; Drive code (2) 1117 cmp bx, 7e81h ; Boundary 1118 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1119 ; we have a drive larger than 65536*255*127 but <65536*255*255 1120 ; DANIS506.ADD will use 255/255 extended geometry 1121 1122 ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track) 1123 dec ax ; Drive code (1) 1124 cmp bx, 3ec1h ; Boundary 1125 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1126 ; we have a drive larger than 65536*255*63 sectors (OS/2 502GiB Limit!) 1127 ; DANIS506.ADD will use 255/127 extended geometry ! 1128 ; IBM1S506.ADD will use 255/255 extended geometry ! 1129 1130 ; We have a drive that can be addressed using standard 255/63 geometry 1131 dec ax ; Drive code (0) 1132 ; We have a drive smaller than 65536*255*63 = 3EC10000 sectors 1133 1134 DriveIO_GatherDiskInfo_ret: 1135 pop es 1136 pop di 1137 pop si 1138 pop dx 1139 pop cx 1140 pop bx 1141 1142 mov [CurIO_UseExtension],1 1143 1144 popf 1145 ret 1146 DriveIO_GatherDiskInfo EndP 1147 1148 1149 1150 ; Values for sectors per track table corresponding to DriveIO_IsHugeDrive return value. 1151 secs_per_track_table: db 63,127,255,255,255,255 1152 1153 db_lmlvm: db 'Load Master LVM -- disk: ',0 -
trunk/BOOTCODE/REGULAR/OTHER.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'OTHER',0 24 ENDIF 25 22 26 ; In: DS:SI - Pointer to begin of string 23 27 ; CX - Len of string … … 72 76 dec dh 73 77 jnz GLOSS_StringsLoop 74 movzx cx, dl 78 ;movzx cx, dl 79 mov cl,dl 80 mov ch,0 81 75 82 ret 76 83 GetLenOfStrings EndP … … 87 94 mov VideoIO_Segment, VideoIO_Page0 88 95 96 ; Don't use blinking attribute 97 call VideoIO_NoBlinking 98 99 ; Get HardDriveCount 100 call DriveIO_GetHardDriveCount 101 102 103 ; Rousseau: added 104 call VideoIO_ClearScreen 105 106 ; Cursor to upper-left 107 mov TextPosX, 0 108 mov TextPosY, 0 109 call VideoIO_CursorSet 110 111 ;mov ax, VideoIO_Page1 112 ;call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 113 114 ; Copyright 115 mov si, offset Copyright 116 call MBR_Teletype 117 xor si,si 118 call MBR_TeletypeNL 119 120 121 ;call SOUND_Beep 122 123 ; Build Date 124 mov si, offset BUILD_DATE 125 call MBR_TeletypeNL 126 127 ; Initialize the com-port for debugging 128 call AuxIO_Init 129 130 xor si,si 131 call MBR_TeletypeNL 132 133 xor cx,cx 134 PRECRAP_Main_next_disk: 135 136 mov dl,cl 137 or dl,80h 138 139 call DriveIO_GatherDiskInfo ; Also used to fill the geo, should be separate function 140 141 mov bx,offset HugeDisk 142 add bx,cx 143 mov [bx], al 144 145 call DriveIO_LoadMasterLVMSector ; returns ZF=1 if no valid LVM record found 146 147 pushf 148 mov bx, offset TrueSecs 149 add bx,cx 150 add bx,cx 151 add bx,cx 152 add bx,cx 153 popf 154 155 ; bx now contains pointer to truesecs for this drive 156 157 jz NoValidMasterLVM 158 159 mov si,offset LVMSector 160 mov ax,[si+LocLVM_Secs] 161 mov word ptr [bx],ax 162 jmp SkipUseBiosSecs 163 164 165 NoValidMasterLVM: 166 push bx ; push truesecs pointer 167 mov bx, offset BIOS_Secs 168 add bx,cx 169 add bx,cx 170 add bx,cx 171 add bx,cx 172 173 mov ax,[bx] ; get biossecs 174 pop bx 175 mov word ptr [bx],ax ; store bios secs in truesecs 176 177 178 SkipUseBiosSecs: 179 inc cx 180 cmp cl,[TotalHarddiscs] 181 jb PRECRAP_Main_next_disk 182 183 184 185 IFDEF AuxDebug 186 ; Write some debug-info to the com-port 187 call DEBUG_Dump1 188 ENDIF 189 190 ; jz NoValidMasterLVM 191 192 193 ; A valid Master LVM has been found. 194 ; We use the values in here to determine the number of sectors per track, 195 ; since this could be OS/2 extended geometry. 196 197 ; jmp Continue1 198 199 200 ;mov word ptr [LOG_Secs],63 201 202 mov al,[HugeDisk] ;; fout, moet nog index bij 203 call AuxIO_TeletypeHexByte 204 call AuxIO_TeletypeNL 205 206 mov ax,word ptr [TrueSecs] ;; fout, moet nog index bij 207 call AuxIO_TeletypeHexWord 208 call AuxIO_TeletypeNL 209 210 211 212 ; Huge Disk indicator 213 mov si, offset HugeBootDisk 214 call MBR_Teletype 215 mov al,[HugeDisk] 216 mov si, offset No 217 test al,al 218 jz MBR_HugeDriveIndicator 219 mov si, offset Yes 220 221 MBR_HugeDriveIndicator: 222 call MBR_Teletype 223 xor si,si 224 call MBR_TeletypeNL 225 226 227 228 229 230 ; 231 ; Phase 1 Indicator 232 ; 233 mov si, offset Phase1 234 call MBR_Teletype 235 236 mov si, offset eCS_InstallVolume 237 mov al, [si] 238 test al,al ; See if phase 1 is active 239 jnz MBR_Main_BootThrough 240 mov si, offset NotActive 241 242 MBR_Main_BootThrough: 243 call MBR_TeleType 244 xor si,si 245 call MBR_TeletypeNL ; ALP barks undefined symbol; must use prototypes ? 246 247 89 248 ; Calculate Cooper-Bar Tables 90 249 call FX_CalculateTables … … 108 267 109 268 call PRECRAP_CheckFor13extensions 269 110 270 IFNDEF ReleaseCode 111 271 ret 112 272 ENDIF 273 113 274 call PRECRAP_CheckConfiguration 275 114 276 ; ======================================= 115 277 ; Checks for MBR Virii :) I love that job … … 123 285 call VIRUS_CheckForVirus 124 286 PCM_NoVirusDetection: 287 288 125 289 ; ============================================ 126 290 ; Delay for some time and get Strg/Alt State … … 132 296 jz PCM_LongDelay 133 297 PCM_ShortDelay: 298 134 299 mov al, 13 ; shorten delay,if floppy gets accessed 135 300 PCM_LongDelay: 301 136 302 call TIMER_WaitTicCount 303 137 304 ; First check, if any normal key got pressed... 138 305 mov ah, 1 … … 143 310 call MBR_Teletype 144 311 mov al, 54 ; about 3 seconds, delay again 312 145 313 call TIMER_WaitTicCount 314 146 315 PCM_NoNormalKeyPressed: 147 316 ; Now get keyboard Strg/Alt State … … 156 325 ret 157 326 PRECRAP_Main EndP 327 328 158 329 159 330 AFTERCRAP_Main Proc Near Uses … … 209 380 jmp MBR_HaltSystem 210 381 PRECRAP_CheckConfiguration EndP 382 383 384 ; Rousseau: added 385 ; In: SI - Pointer to begin of string (EOS is 0) 386 ; Destroyed: SI 387 ; Fixme: Uses double writes to use attribute with teletype-function. 388 MBR_TeletypeBold Proc Near Uses ax bx cx 389 MBRT_LoopBold: 390 lodsb 391 or al, al 392 jz MBRT_EndBold 393 push ax 394 mov ah,09h 395 mov bx,15 396 mov cx,1 397 int 10h 398 pop ax 399 mov ah,0eh 400 mov bx,7 ; Does not do anything in text-modus 401 mov cx,1 402 int 10h 403 jmp MBRT_LoopBold 404 MBRT_EndBold: 405 ret 406 MBR_TeletypeBold EndP 407 408 ; In: SI - Pointer to begin of string (EOS is 0) 409 ; Destroyed: SI 410 ; Fixme: Uses double writes to use attribute with teletype-function. 411 MBR_TeletypeVolName Proc Near Uses ax bx cx 412 mov cx, 11 413 MBRT_LoopVolName: 414 mov dx,cx ; Backup counter 415 lodsb 416 or al, al 417 jz MBRT_EndVolName 418 push ax 419 mov ah,09h 420 mov bx,15 421 mov cx,1 422 int 10h ; DX is preserved 423 pop ax 424 mov ah,0eh 425 mov bx,7 ; Does not do anything in text-modus 426 mov cx,1 427 int 10h ; DX is preserved 428 mov cx,dx ; Restore counter 429 loop MBRT_LoopVolName 430 MBRT_EndVolName: 431 ret 432 MBR_TeletypeVolName EndP 433 434 ; Rousseau: added 435 ; Move cursor to next line 436 ; Just do a new-line if SI==0 437 MBR_TeletypeNL Proc Near Uses ax bx cx 438 test si,si 439 jz MBR_TeletypeNL_NL 440 call MBR_Teletype 441 MBR_TeletypeNL_NL: 442 push si 443 mov si, offset NL 444 call MBR_Teletype 445 pop si 446 ret 447 MBR_TeletypeNL EndP 448 449 ; Sync teletype position to VideoIO 450 MBR_TeletypeSyncPos Proc Near Uses ax bx cx dx 451 pushf 452 mov bh, 0 453 mov ah, 02h 454 mov dh,[TextPosY] 455 mov dl,[TextPosX] 456 int 10h 457 popf 458 ret 459 MBR_TeletypeSyncPos EndP -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'PARTMAIN',0 24 ENDIF 25 22 26 PART_FixUpDefaultPartitionValues Proc Near Uses dx si di 23 27 ; Fix-Up Default and Last Partition - If lost, search for Bootable … … 140 144 ; Copies the device-name to the Resume-BIOS IPT entry 141 145 PART_UpdateResumeBIOSName Proc Near Uses ax bx cx si di 142 movzx bx, CFG_ResumeBIOSbootSeq 146 ;movzx bx, CFG_ResumeBIOSbootSeq 147 mov bl,CFG_ResumeBIOSbootSeq 148 mov bh,0 149 143 150 dec bx 144 151 shl bx, 1 … … 213 220 ; PCMPP_NoLinuxKernels: 214 221 215 movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 222 ;movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 223 mov cl,CFG_Partitions ; LocIPT_MaxPartitions 224 mov ch,0 225 216 226 or cx, cx 217 227 jz PCMPP_NoPartitions … … 240 250 je PGPP_IsBIOSbootSeq ; FEh -> Resume BIOS boot Sequence 241 251 ja PGPP_IsFloppy ; FFh -> Floppy 242 movzx bx, dl 252 ;movzx bx, dl 253 mov bl,dl 254 mov bh,0 255 243 256 shl bx, 1 244 257 mov si, wptr [PartitionPointers+bx] … … 278 291 ; Out: DL - Number of partition in straight view 279 292 PART_ConvertToStraight Proc Near Uses 280 movzx bx, dl 281 shl bx, 1 282 mov ax, wptr cs:[PartitionPointers+bx] 293 ;movzx bx, dl 294 mov bl,dl ; partition number to bl 295 mov bh,0 ; zero extend to word 296 297 shl bx, 1 ; convert to word index 298 mov ax, wptr cs:[PartitionPointers+bx] ; get the partition pointer 283 299 cmp ax, offset FloppyIPTentry 284 300 jb PCTS_IsBIOSbootSeq … … 315 331 PCFS_IsPartition: 316 332 ; First we get Partition-Offset in AX 317 movzx ax, dl 333 ;movzx ax, dl 334 mov al,dl 335 mov ah,0 336 318 337 mov bl, LocIPT_LenOfIPT 319 338 mul bl … … 354 373 mov bl, LocIPT_LenOfIPT 355 374 div bl ; Divide with IPTlength 356 movzx bx, al 375 ;movzx bx, al 376 mov bl,al 377 mov bh,0 378 357 379 shl ax, 1 358 380 shl bx, 2 … … 409 431 dec di ; Go to previous char 410 432 jmp PFOSE_DigitLoop 411 433 412 434 PFOSE_EndOfDigitLoop: 413 435 ret 414 436 PART_FillOutSizeElement EndP 437 438 439 440 441 ; ################### 442 ; # START PARTITION # 443 ; ################### 415 444 416 445 ; Starts Partition DL from Internal Partition Table. … … 454 483 mov di, offset TXT_BootingNowPartName 455 484 jz PSP_NoName 456 rep movsb 485 rep movsb ; Copy label-name to boot 457 486 PSP_NoName: 458 487 xor al, al 459 488 stosb ; Ending Zero 460 mov si, offset TXT_BootingNow1 489 mov si, offset TXT_BootingNow1 ; "Booting the system using " 461 490 call MBR_Teletype 462 491 ; [Linux support removed since v1.02] … … 484 513 IFDEF ReleaseCode 485 514 ; Save configuration on HDD boots (save CFG_PartLast) 486 call DriveIO_SaveConfiguration 515 call DriveIO_SaveConfiguration ; Rouaaseu: SAVE CONFIGURATION ! 487 516 ENDIF 488 517 call MBR_Teletype ; Prints out BootingNow2 including PartitionName … … 496 525 mov dh, bptr [si+LocIPT_LocationPartTable+0] 497 526 mov dl, [si+LocIPT_Drive] 498 call DriveIO_LoadPartition ; Load Table... 527 call DriveIO_LoadPartition ; Load Table... ; Rousseau: LOAD PARTITION ! 499 528 ; --------------------------------------------------- MODIFY PARTITION TABLE 500 529 push cs … … 536 565 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 537 566 IFDEF ReleaseCode 538 call DriveIO_SavePartition ; Saves the Partition-Table 567 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE PARTITION ! 539 568 ENDIF 540 569 … … 549 578 ; BX:AX -> Absolute End-Position of Partition 550 579 551 test CFG_ForceLBAUsage, 1 580 test CFG_ForceLBAUsage, 1 ; Rousseau: LBA 552 581 jnz PSP_ForceI13X 553 ; LBA-boundary at 16450560 (FB0400h) 582 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) 554 583 cmp bx, 00FBh 555 584 jb PSP_NoI13X 556 585 PSP_ForceI13X: 557 push es di 586 push es di si 558 587 mov ax, 3000h 559 588 mov es, ax 560 589 xor di, di 590 ; Blokkeert starten van IBM BM !! 561 591 mov wptr es:[di], '1I' 562 592 mov wptr es:[di+2], 'X3' 563 pop di es 593 594 ;mov si,3000h 595 ;call AuxIO_DumpSector 596 597 pop si di es 564 598 PSP_NoI13X: 565 599 … … 607 641 mov cx, 0001h ; Cylinder 0, Sector 1 608 642 mov dx, 0080h ; First HD, Head 0 609 call DriveIO_LoadPartition ; Load Primary Partition Table 643 call DriveIO_LoadPartition ; Load Primary Partition Table ; Rousseau: LOAD MBR ! 610 644 call PART_MarkFirstGoodPrimary 611 645 IFDEF ReleaseCode 612 call DriveIO_SavePartition ; Saves the Partition-Table 646 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE MBR ! 613 647 ENDIF 614 648 PSP_NoHideAdjustPrimaryMark: … … 622 656 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 623 657 jz PSP_NoLVMReassignment 624 movzx bx, BootPartNo ; EntryNumber is straight view 658 ;movzx bx, BootPartNo ; EntryNumber is straight view 659 mov bl,BootPartNo ; EntryNumber is straight view 660 mov bh,0 661 625 662 mov al, bptr [DriveLetters+bx] 626 663 sub al, 3Dh ; Convert e.g. 80h -> 'C' … … 679 716 mov dh, [si+LocIPT_LocationBegin+0] 680 717 mov dl, [si+LocIPT_Drive] 681 call DriveIO_LoadPartition ; Loads boot-sector... 718 call DriveIO_LoadPartition ; Loads boot-sector... ; Rousseau: LOAD PART BOOT-SECTOR !! 682 719 683 720 test CFG_DetectVIBR, 1 … … 734 771 mov si, 10h*4 735 772 xor di, di ; INT 10h Vector to MBR Protection 736 movsd 773 ;movsd 774 movsw 775 movsw 776 737 777 mov si, 13h*4 ; INT 13h Vector to MBR Protection 738 movsd 778 ;movsd 779 movsw 780 movsw 781 739 782 mov al, CFG_IgnoreWriteToMBR ; Option to MBR Protection 740 783 stosb … … 753 796 PSP_NoMBRprotect: 754 797 cmp bptr [si+LocIPT_SystemID], 08 ; I hate Microsuck NTFS check 755 je PSP_NoSpecialSupport 798 799 ;je PSP_NoSpecialSupport 756 800 757 801 mov di, offset PartitionSector ; ES:DI - Actual Boot-Record … … 759 803 mov ax, wptr es:[di+24] 760 804 cmp ax, 003Fh ; Physical Layout-Sectors... Safety check 761 ja PSP_NoSpecialSupport 805 806 807 ; Rousseau: # Boot Logical Partitions) 808 ; FreeDOS and eCS on extpart on non-huge needs special support. (old ja jump) 809 ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. (also when offset at 20MiB) 810 ; PCD7 bonkt vast als in 2GiB log at start of space. "Starting PC DOS..." verschijnt. PCD Loader probleem. 811 ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken. 812 ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk. 813 ; FreeDOS 20G PRI SOD op 400G start niet met special. 814 ; Heeft drive-id op 26h (36d) van 0dh ! 815 ; WinXP werkt met special en not-special op 400G normal geo. 816 ; eCS op PRI op 2G met os2 ext geo werkt ook met beide. 817 ; eCS LOG werkt niet zonder special op 400G. 818 ; (hidden secs op 3F en moet 3F00 zijn; BM staat ervoor, 3F00=255*63+63) 819 ; Laatste 63 is MBR. 820 ; 821 ; It seems PRI's already get special treatment in that they get their hidden secs updated. 822 ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, but AiR-BOOT corrects it before booting) 823 824 ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!! 825 826 ; PC-DOS7 wil vaak niet starten als er meerdere pri's actief zijn. 827 ; Logo verschijnt wel maar start niet door. 828 829 830 ; Display volume-name 831 pushf 832 push si 833 add si, LocIPT_Name 834 call MBR_TeletypeVolName 835 xor si,si 836 call MBR_TeletypeNL ; Rousseau: Just before booting the selected partition 837 pop si 838 popf 839 840 841 842 jmp special ; Rousseau: GOT IT !!! (LOG-BOOT) (alleen op huge disks !) 843 ;jmp PSP_NoSpecialSupport 844 ;ja PSP_NoSpecialSupport ; Rousseau: original M. Kiewitz... 845 ;jbe PSP_NoSpecialSupport ; had to change to opposite ! 846 847 762 848 mov ax, wptr es:[di+26] 763 849 cmp ax, 00FFh ; Physical Layout-Heads... Safety check 764 850 ja PSP_NoSpecialSupport 765 851 mov al, bptr es:[di+36] 766 cmp al, 80h ; Drive Letter 852 cmp al, 80h ; Drive Letter (ID) 767 853 jne PSP_NoSpecialSupport 854 768 855 ; Special Support needed 856 special: 857 ; Write actual drive-letter to partition boot-record. 858 ; This is according to BPB. 769 859 mov al, bptr [si+LocIPT_Drive] 770 mov bptr es:[di+36], al ; Write Actual Drive-Letter 860 ; Also an influence with FreeDOS ! 861 ; Generates JFS ERROR when not set correctly !!! 862 mov bptr es:[di+36], al ; Write Actual Drive-Letter (80h id first drive) !!!!!!!!!!!!!!!!!!!!!!! 863 864 ; This could be incorrect when a partition is moved, 865 ; or the system installer puts the wrong value here. 866 ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not a the start of the disk. 867 ; This fixing is done by OS/2 BM as well, according to Martin. 771 868 mov ax, [si+LocIPT_AbsoluteBegin] 772 mov wptr es:[di+28], ax ; Fixing Hidden Sectors count869 mov wptr es:[di+28], ax ; low word of hidden sectors 773 870 mov ax, [si+LocIPT_AbsoluteBegin+2] 774 mov wptr es:[di+30], ax ; Done by OS/2 BootMan as well...871 mov wptr es:[di+30], ax ; high word of hidden sectors 775 872 776 873 ; ------------------------------------------------ LOGICAL PARTITION SUPPORT 777 874 PSP_NoSpecialSupport: 875 876 ;jmp PSP_NoLogicalSupport 877 778 878 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 779 879 jz PSP_NoLogicalSupport 780 880 781 movzx bx, BootPartNo ; EntryNumber is straight view 881 ;movzx bx, BootPartNo ; EntryNumber is straight view 882 mov bl,BootPartNo ; EntryNumber is straight view 883 mov bh,0 884 782 885 mov al, bptr [DriveLetters+bx] 783 886 mov bptr es:[di+37], al ; Write Drive Letter (OS/2 only) … … 793 896 rep movsw 794 897 pop si 795 ; ---------------------------------------------------- NOW START BOOT-RECORD 898 ; ---------------------------------------------------- NOW START BOOT-RECORD ; Rousseau: START PARTITION BOOT-RECORD !! 899 900 901 IFDEF AuxDebug 902 ; call DEBUG_Dump2 903 ENDIF 904 905 ; 906 ; ########################### WAIT FOR KEY ################################ 907 ; 908 909 ; Rousseau: 910 ; Wait for key so we can see which volume is going to be started. 911 ;xor ax, ax 912 ;int 16h 913 ;cmp al, 1bh ; is escape-key ? 914 ;jne skip_reenter 915 916 ;jmp MBR_Main_ReEnterBootMenuPre ; yep, re-enter boot-menu 917 918 skip_reenter: 919 920 921 922 923 924 925 926 927 ; 928 ; BYE BYE 929 ; 796 930 xor ax, ax 797 931 xor bx, bx … … 801 935 xor dh, dh ; Drive supported by BIOS 802 936 mov dl, cs:[si+LocIPT_Drive] ; Drive Physical No 937 803 938 IFDEF ReleaseCode 804 db 0EAh ; JUMP TO Entry Point...Bye Bye939 db 0EAh ; JUMP TO Entry Point...Bye Bye 805 940 dw StartBasePtr 806 941 dw StartBaseSeg 807 942 ENDIF 808 943 PART_StartPartition EndP 944 945 946 947 948 949 950 951 952 953 809 954 810 955 ; This routine is called to hide a partition … … 923 1068 ; Destroyed: *none* 924 1069 PART_SearchFileSysName Proc Near Uses bx dx 925 movzx bx, al 1070 ;movzx bx, al 1071 mov bl,al 1072 mov bh,0 1073 926 1074 mov si, offset FileSysIDs 927 1075 PSFSN_SearchLoop: … … 943 1091 mov ah, dl 944 1092 ; AH is now the FileSystem-Flag 945 movzx bx, bh 1093 ;movzx bx, bh 1094 mov bl,bh 1095 mov bh,0 1096 946 1097 shl bx, 3 ; Offsets * 8 947 1098 mov si, offset FileSysNames 948 1099 add si, bx 949 ret 1100 ret 950 1101 PART_SearchFileSysName EndP 951 1102 … … 954 1105 ; Out: AL - Hidden File-System-ID 955 1106 PART_SearchFileSysHiddenID Proc Near Uses bx 956 movzx bx, al 1107 ;movzx bx, al 1108 mov bl,al 1109 mov bh,0 1110 957 1111 mov si, offset FileSysIDs 958 1112 PSFSHI_SearchLoop: … … 1019 1173 ret 1020 1174 PART_CheckForValidPartName EndP 1175 1176 1177 ; Rousseau: added 1178 ; Compare a volume-label in the IPT to the install-volume 1179 ; SI holds pointer to entry in IPT 1180 ; CY set if this entry is also the install-volume 1181 PART_IsInstallVolume Proc Near Uses ax cx dx si di 1182 cld ; Advance upwards with lodsb 1183 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars) 1184 1185 mov cx, 11 ; Maximum length of label 1186 xor dl, dl ; Not found yet 1187 1188 ; Compare next character 1189 PART_IsInstallVolumeNext: 1190 lodsb ; Load byte from SI (IPT-entry) 1191 ;cmp al,' ' ; If space then use zero 1192 ;jne PART_IsInstallVolume_skip1 1193 ;xor al,al 1194 PART_IsInstallVolume_skip1: 1195 xchg ah,al ; Save char to AH 1196 xchg si,di ; Exchange pointers 1197 lodsb ; Load byte from SI (install-volume label) 1198 ;cmp al,' ' ; If space then use zero 1199 ;jne PART_IsInstallVolume_skip2 1200 ;xor al,al 1201 PART_IsInstallVolume_skip2: 1202 xchg si,di ; Reexchange pointers 1203 call AuxIO_Teletype 1204 call CONV_ToUpper 1205 call AuxIO_Teletype 1206 xchg al,ah 1207 call AuxIO_Teletype 1208 call CONV_ToUpper 1209 call AuxIO_Teletype 1210 call AuxIO_TeletypeNL 1211 1212 ; Are both of them zero ? 1213 ; Then the names could be the same, but cx must not equal 11 1214 ; because that would indicate a null-string. 1215 mov dh,al 1216 or dh,ah 1217 jz PART_IsInstallVolumeFound 1218 1219 cmp ah,al ; Are the the same ? 1220 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended 1221 loop PART_IsInstallVolumeNext ; Yep, Compare next character 1222 1223 PART_IsInstallVolumeFound: 1224 ; If CX is still 11 this was a zero string 1225 ; and thus not a valid volume-name. 1226 ; This should not occur as this function is only called when the first 1227 ; byte is non-zero. 1228 cmp cx,11 1229 je PART_IsInstallVolumeNotFound 1230 ; Found ! 1231 mov dl,1 ; Found 1232 jmp PART_IsInstallVolumeEnd 1233 1234 1235 PART_IsInstallVolumeNotFound: 1236 mov dl,0 1237 jmp PART_IsInstallVolumeEnd 1238 1239 1240 PART_IsInstallVolumeEnd: 1241 ; Set the status in CY 1242 mov al,dl 1243 add al,'0' 1244 call AuxIO_TeletypeHexByte 1245 call AuxIO_TeletypeNL 1246 rcr dl,1 ; Put found-flag in CY 1247 ret 1248 PART_IsInstallVolume EndP -
trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 23 IFDEF ModuleNames 24 DB 'PARTSCAN',0 25 ENDIF 26 22 27 ; Note: This is complex code. So make sure that you know what you are doing in 23 28 ; here. … … 48 53 mov si, offset NewPartTable 49 54 mov di, offset PartitionTable 50 movzx ax, NewPartitions 55 ;movzx ax, NewPartitions 56 mov al,NewPartitions 57 mov ah,0 58 51 59 mov CFG_Partitions, al 52 60 mov bl, LocIPT_LenOfIPT … … 58 66 mov si, offset NewDriveLetters 59 67 mov di, offset DriveLetters 60 mov cx, LocIPT_MaxPartitions /261 rep movs w68 mov cx, LocIPT_MaxPartitions 69 rep movsb 62 70 63 71 ; [Linux support removed since v1.02] … … 82 90 or dl, dl 83 91 jz PSSFP_NoAutoDriveLetter 84 movzx cx, CFG_Partitions 92 ;movzx cx, CFG_Partitions 93 mov cl,CFG_Partitions 94 mov ch,0 95 85 96 or cx, cx 86 97 jz PSSFP_NoAutoDriveLetter … … 118 129 mov wptr [ExtendedAbsPos+2], ax 119 130 PSSDFP_LoadThisPartition: 120 call DriveIO_LoadPartition 131 132 call DriveIO_LoadPartition ; Rousseau: load a partition record 133 121 134 jc PSSDFP_InvalidPartition 135 122 136 ; LVM Support - Reads LVM Information Sector 123 call DriveIO_LoadLVMSector 137 call DriveIO_LoadLVMSector ; Rousseau: load LVM sector 138 124 139 call PARTSCAN_ScanPartition 125 140 IFDEF ReleaseCode … … 223 238 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 224 239 adc bx, wptr [CurPartition_Location+2] ; sectors 225 call DriveIO_LoadTmpSector ; Loads Boot record 240 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !! 226 241 ; Sets up DS:SI - TmpSector 227 242 … … 249 264 cmp PartSystemID, 07h ; We got IFS here? 250 265 jne PCCTP_IFSdone 251 ; Check, if 'JFS ' is at DWORD offset 36h 266 ; Check, if 'JFS ' is at DWORD offset 36h ; Rousseau: JFS check (LVM / IPT?) 252 267 cmp wptr [si+36h], 'FJ' 253 268 jne PCCTP_IFSnoJFS … … 284 299 PCCTP_HasVolumeLetter: 285 300 ; Save VolumeLetter in separate table 286 movzx bx, NewPartitions ; NewPartitions is one behind here, so 301 ;movzx bx, NewPartitions ; NewPartitions is one behind here, so 302 mov bl,NewPartitions ; NewPartitions is one behind here, so 303 mov bh,0 304 287 305 mov [PartitionVolumeLetters+bx], al ; it's already a zero-based offset 288 306 ; Now copy VolumeID and VolumeName to temporary space … … 291 309 stosw 292 310 mov ax, [si+LocLVM_PartitionID+2] 293 stosw ; Set Serial-Field to LVM-VolumeID 311 stosw 312 ; Set Serial-Field to LVM-VolumeID 313 push di 294 314 add si, LocLVM_PartitionName 315 295 316 mov cx, 5 296 317 rep movsw ; Copy LVM-PartitionName to Temp Space 297 movsb ; (11 bytes in total) 318 movsb ; (11 bytes in total) 319 320 pop di 321 cmp PartSystemID, 0ah 322 323 jne PCCTP_NoIbmBm 324 mov si, offset ibm_bm_name 325 mov cx,5 326 rep movsw 327 movsb 328 329 330 331 PCCTP_NoIbmBm: 332 333 298 334 pop di si dx ax 299 335 mov si, offset MBR_NoName_Patched … … 304 340 pop di si dx ax 305 341 test ah, FileSysFlags_NoName ; No-Name-Flag ? -> No Partition Name 306 jnz PCCTP_ThereIsNoName ; available 342 343 jz PCCTP_ThereIsAName 344 jmp PCCTP_ThereIsNoName ; available 345 346 PCCTP_ThereIsAName: 347 307 348 ; We check for NTFS (got detected a little bit earlier in this routine) 308 349 cmp PartSystemID, 08h ; We got IFS/NTFS here? … … 312 353 add si, 2Bh ; DS:SI - Partition-Name 313 354 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting ? 355 314 356 jz PCCTP_ResumeNormal 357 315 358 add si, 1Ch ; Fix for FAT 32, shiat 316 359 PCCTP_ResumeNormal: 317 360 mov cx, 11 ; 11 bytes length 318 361 call PART_CheckForValidPartName 319 jnc PCCTP_ThereIsNoName 362 jc PCCTP_ThereIsAName2 363 364 jmp PCCTP_ThereIsNoName 365 366 PCCTP_ThereIsAName2: 367 320 368 sub si, 4 ; DS:SI -> Serial&Name (15-Bytes) 321 369 xor ah, ah ; no Flags_NoPartName … … 343 391 repz cmpsb 344 392 pop di si 345 je PCCTP_Match 393 394 jne PCCTP_NoMatchYet 395 396 jmp PCCTP_Match 397 398 PCCTP_NoMatchYet: 399 346 400 PCCTP_SerialNameAlreadyFound: 347 401 add di, LocIPT_LenOfIPT … … 477 531 PCCTP_LocCompFailed: 478 532 jmp PCCTP_CompareFailed 479 533 480 534 ; ================================== 481 535 ; =MATCH=, found partition in IPT... … … 557 611 ; Calculate Pointer to IPT 558 612 mov di, offset NewPartTable ; ES:DI - NewPartTable 559 movzx ax, NewPartitions 613 ;movzx ax, NewPartitions 614 mov al,NewPartitions 615 mov ah,0 616 560 617 mov bl, LocIPT_LenOfIPT 561 618 mul bl … … 575 632 stosb 576 633 mov al, cl ; Partition-Flags from register... 577 stosb 634 stosb 578 635 mov ax, PartCRC ; BootRecordCRC... 579 636 stosw … … 620 677 621 678 ; Calculate Size of this partition and put it into separate table... 622 movzx ax, NewPartitions 679 ;movzx ax, NewPartitions 680 mov al,NewPartitions 681 mov ah,0 682 623 683 dec ax 624 684 mov bx, ax … … 658 718 ; Destroyed: None 659 719 PARTSCAN_DefXref Proc Near Uses ax bx cx dx si di 660 movzx bx, dl 720 ;movzx bx, dl 721 mov bl,dl 722 mov bh,0 723 661 724 mov bptr [PartitionXref+bx], dh ; X-Reference 662 725 ; Copy Hide-Config of IPT partition to new location in new table … … 673 736 rep movsb ; Copy Hide-Config to NewHideTable 674 737 ; Process Logical-Drive-Letter table as well... 675 movzx bx, dl 738 ;movzx bx, dl 739 mov bl,dl 740 mov bh,0 741 676 742 mov al, bptr [DriveLetters+bx] ; Get Drv-Letter from org. pos 677 movzx bx, dh 743 ;movzx bx, dh 744 mov bl,dl 745 mov bh,0 746 678 747 mov bptr [NewDriveLetters+bx], al ; Put Drv-Letter to new pos 679 748 ret … … 684 753 ; Destroyed: None 685 754 PARTSCAN_GetXref Proc Near Uses bx 686 movzx bx, dl 755 ;movzx bx, dl 756 mov bl,dl 757 mov bh,0 758 687 759 mov dh, bptr [PartitionXref+bx] ; X-Reference 688 760 ret … … 702 774 cmp al, 0FFh 703 775 je PSSHCWX_SyncEmpty 704 movzx bx, al 776 ;movzx bx, al 777 mov bl,al 778 mov bh,0 779 705 780 mov al, [PartitionXref+bx] ; Translate it 706 781 cmp al, 0FFh … … 729 804 ret 730 805 PARTSCAN_SyncHideConfigWithXref EndP 806 807 ibm_bm_name: db 'IBM BootMan',0 -
trunk/BOOTCODE/REGULAR/PASSWORD.ASM
r29 r30 19 19 ; AiR-BOOT / PASSWORD 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'PASSWORD',0 24 ENDIF 25 21 26 22 27 ; Don't ask me, what I'm doing in here to encode the passwords. I don't even … … 164 169 PE_ContinueLoop: 165 170 mov al, ds:[si] 166 movzx bx, ds:[si+8] 171 ;movzx bx, ds:[si+8] 172 mov bl,ds:[si+8] 173 mov bh,0 174 167 175 add bl, 16 168 176 mov ah, ds:[si+bx] -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'STD_TEXT',0 24 ENDIF 25 22 26 ; If you modify this Copyright and release this under your own name, 23 27 ; I'm going to sue your cheap ass, rape your dog and blow up your house. =) 24 28 25 CopyrightVersionLen equ 5 26 Copyright db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 27 BootEndMsg db 'Free usage allowed, as long as you dont or have not worked for US government', 0 28 BootEndMsg2 db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0 29 CopyrightVersionLen equ 6 30 ;Copyright db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 31 Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 32 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0 33 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Release Candidate 1 - (build: #25)', 0 34 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc2-b27)', 0 35 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc3-b31)', 0 36 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0 37 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0 38 39 ;BootEndMsg db 'Free usage allowed, as long as you dont or have not worked for US government', 0 40 41 ; Rousseau: switch around 42 BootEndMsg db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0 43 BootEndMsg2 db 'http://www.gnu.org/licenses/gpl.txt', 0 44 45 AuxInitMsg db 'Initializing Serial Communications on COM',0 29 46 30 47 CheckID_MBR db 'AiRBOOT' … … 33 50 ; Colors for special words hard-coded. Keep all 0s. 34 51 TXT_SETUP_LowerMessage db 'This software is released under ', 0, 'GPLv3+.', 0 35 db 'It may not be used by US government', 0 52 ; db 'It may not be used by US government', 0 53 db 'http://www.gnu.org/licenses/gpl.txt', 0 36 54 db 'For more information and source, please visit', 0 37 55 db 'http://AiR-BOOT.sourceforge.net', 0 38 db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 56 ; db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 57 db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0 39 58 40 59 ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM -
trunk/BOOTCODE/REGULAR/TIMER.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'TIMER',0 24 ENDIF 25 22 26 ; This here is one of the rare cases that I'm using DIV and MUL opcodes. I 23 27 ; could have coded around them in here as well, but I was too lazy. Most of … … 39 43 ; Out: Nothing 40 44 TIMER_WaitTicCount Proc Near Uses ax bx dx 41 movzx bx, al 45 ;movzx bx, al 46 mov bl,al 47 mov bh,0 48 42 49 call TIMER_GetTicCount 43 50 add bx, ax ; BX - Required lower Tic … … 62 69 mul bl ; Result * 91 63 70 mov dx, ax 64 movzx ax, bh 71 ;movzx ax, bh 72 mov al,bh 73 mov ah,0 74 65 75 mov bl, 18 66 76 mul bl ; Remainder * 18 … … 80 90 div dl ; Tics : 91 81 91 mov dh, al 82 movzx ax, ah 92 ;movzx ax, ah 93 mov al,ah 94 mov ah,0 95 83 96 mov dl, 18 84 97 div dl ; Remainder : 18 … … 87 100 mov bl, 5 88 101 mul bl ; Result * 5 89 movzx dx, dh 102 ;movzx dx, dh 103 mov dl,dh 104 mov dh,0 105 90 106 add ax, dx ; Add both together... 91 107 ret -
trunk/BOOTCODE/REGULAR/VIDEOIO.ASM
r29 r30 19 19 ; AiR-BOOT / VIDEO I/O 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'VIDEOIO',0 24 ENDIF 21 25 22 26 VideoIO_WaitRetrace Proc Near Uses ax dx … … 32 36 ret 33 37 VideoIO_WaitRetrace EndP 38 39 34 40 35 41 ; Holds the current position. Yeah, I know this is in the code area, but who … … 100 106 mov ax, VideoIO_Segment 101 107 mov es, ax 102 movzx ax, TextPosY 108 ;movzx ax, TextPosY 109 mov al,TextPosY 110 mov ah,0 111 103 112 mov bl, 160 104 113 mul bl … … 169 178 VideoIO_FixedPrint EndP 170 179 180 ; Rousseau: 181 ; Turn off blinking 182 ; http://www.ctyme.com/intr/rb-0088.htm does not mention this 183 VideoIO_NoBlinking Proc Near Uses ax bx 184 mov bx,0 185 mov ax,1003h 186 int 10h 187 ret 188 VideoIO_NoBlinking EndP 189 171 190 ; In: AL - Single Char to Print 172 191 ; Destroyed: None … … 179 198 ret 180 199 VideoIO_PrintSingleChar EndP 200 201 202 203 ; Print hex-byte to screen 204 ; This outputs two characters 205 ; In: AL - byte to send 206 ; Out: AL - byte sent 207 ; Destroyed: None 208 VideoIO_PrintHexByte Proc Near Uses ax 209 call CONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL 210 xchg al,ah ; High hex-nibble first 211 call VideoIO_PrintSingleChar ; Output to screen 212 xchg al,ah ; Low hex-nibble next 213 call VideoIO_PrintSingleChar ; Output to screen 214 ret 215 VideoIO_PrintHexByte EndP 216 217 218 ; Print hex-word to screen 219 ; This outputs four characters 220 ; In: AX - word to send 221 ; Out: AX - word sent 222 ; Destroyed: None 223 VideoIO_PrintHexWord Proc Near 224 xchg al,ah ; High byte first 225 call VideoIO_PrintHexByte ; Output to screen 226 xchg al,ah ; low byte next 227 call VideoIO_PrintHexByte ; Output to screen 228 ret 229 VideoIO_PrintHexWord EndP 230 231 232 ; Print hex-dword to screen 233 ; This outputs eight characters 234 ; In: DX:AX - dword to send 235 ; Out: DX:AX - dword sent 236 ; Destroyed: None 237 VideoIO_PrintHexDWord Proc Near 238 xchg ax,dx 239 call VideoIO_PrintHexWord ; High word first 240 xchg ax,dx 241 call VideoIO_PrintHexWord ; Low word next 242 ret 243 VideoIO_PrintHexDWord EndP 244 245 246 ; Print hex-qword to screen 247 ; This outputs sixteen characters 248 ; In: BX:CX:DX:AX - qword to send 249 ; Out: BX:CX:DX:AX - qword sent 250 ; Destroyed: None 251 VideoIO_PrintHexQWord Proc Near 252 xchg dx,bx 253 xchg ax,cx 254 call VideoIO_PrintHexDWord ; High dword first 255 xchg dx,bx 256 xchg ax,cx 257 call VideoIO_PrintHexDWord ; Low dword next 258 ret 259 VideoIO_PrintHexQWord EndP 260 261 262 263 181 264 182 265 ; In: AL - Single Char to Print … … 205 288 cmp al, 99 206 289 ja VIOPBN_DoNotWriteAnything 207 movzx bx, al 290 ;movzx bx, al 291 mov bl,al 292 mov bh,0 293 208 294 call VideoIO_Internal_SetRegs 209 295 cmp bl, 10 210 296 jb VIOPBN_Lower10 211 297 push ax 212 movzx ax, bl 298 ;movzx ax, bl 299 mov al,bl 300 mov ah,0 301 213 302 mov dl, 10 214 303 div dl … … 231 320 ; In: AL - Single Byte to Print 232 321 ; Destroyed: None 233 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx dx es di322 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx cx dx es di ; Rousseau: cx was missing from push-list 234 323 xor cl, cl 235 324 mov bh, al … … 240 329 cmp ah, 100 241 330 jb VIOPBDN_Lower100 242 movzx ax, ah 331 ;movzx ax, ah 332 mov al,ah 333 mov ah,0 334 243 335 mov dl, 100 244 336 div dl … … 249 341 add di, 2 250 342 VIOPBDN_Lower100: 251 movzx ax, ah 343 ;movzx ax, ah 344 mov al,ah 345 mov ah,0 346 252 347 mov dl, 10 253 348 div dl … … 270 365 ; Destroyed: None Important 271 366 VideoIO_Internal_MakeWinDown Proc Near Uses dx di 272 movzx dx, cl 367 ;movzx dx, cl 368 mov dl,cl 369 mov dh,0 370 273 371 mov bl, al 274 372 call VideoIO_Internal_SetRegs … … 281 379 dec dx 282 380 jnz VIOIMWD_Loop 283 ret 381 ret 284 382 VideoIO_Internal_MakeWinDown EndP 285 383 … … 287 385 ; Destroyed: None Important 288 386 VideoIO_Internal_MakeWinRight Proc Near Uses dx di 289 movzx dx, cl 387 ;movzx dx, cl 388 mov dl,cl 389 mov dh,0 390 290 391 mov bl, al 291 392 call VideoIO_Internal_SetRegs … … 298 399 dec dx 299 400 jnz VIOIMWR_Loop 300 ret 401 ret 301 402 VideoIO_Internal_MakeWinRight EndP 302 403 … … 366 467 sub bl, WinBeginPosX 367 468 dec bl 368 469 369 470 VIOIMW_Loop: 370 471 mov ch, WinBeginPosY … … 439 540 call VideoIO_CursorSet 440 541 call VideoIO_CursorOn ; Set and turn cursor on 441 542 442 543 ; ES:DI - Screen-Position to Start of String 443 544 ; DL - Position in String (relative to begin, base=0) … … 460 561 cmp dl, StringLen ; String "full" ? 461 562 jae VIOLUES_Loop 462 movzx bx, dl 563 ;movzx bx, dl 564 mov bl,dl 565 mov bh,0 566 463 567 shl bx, 1 464 568 mov es:[di+bx], al … … 476 580 mov al, ' ' 477 581 dec dl 478 movzx bx, dl 582 ;movzx bx, dl 583 mov bl,dl 584 mov bh,0 585 479 586 shl bx, 1 480 587 mov es:[di+bx], al … … 502 609 ret 503 610 VideoIO_LetUserEditString EndP 611 612 613 614 ; 615 ; Rousseau Additions. 616 ; 617 618 619 ; Function Template 620 ;ProcName Proc Near Uses ax bx cx dx si es di 621 ;ProcName EndP 622 623 624 ; 625 ; Clear the current page 626 ; 627 VideoIO_ClearScreen Proc Near Uses ax bx cx dx si es di 628 mov al, 0 ; clear entire window 629 mov bh,07h ; Attribute for new lines 630 xor cx,cx ; Row, Column ULC 631 xor dx,dx 632 dec dx ; Row, Column LRC (does this corrupt other pages ?) 633 mov ah, 06h ; Function Code 634 int 10h ; Do It ! 635 ret 636 VideoIO_ClearScreen EndP 637 638 ; 639 ; Rousseau: added 640 ; Set poosition to teletype cursor 641 ; 642 VideoIO_SyncPos Proc Near Uses ax bx cx dx 643 pushf 644 mov bh, 0 645 mov ah, 03h 646 int 10h 647 mov [TextPosX], dl 648 mov [TextPosY], dh 649 popf 650 ret 651 VideoIO_SyncPos EndP 652 653 654 655 VideoIO_DBG_WriteString Proc Near Uses ax bx cx dx si es di 656 mov ch, [CFG_Partitions] ; y 657 add ch, 7 658 add ch, [CFG_IncludeFloppy] 659 push cx 660 mov cl, 1 ; x 661 call VideoIO_Locate 662 mov ch, 15 ; fgc 663 mov cl, 0 ; bgc 664 call VideoIO_Color 665 mov si, offset ShowBootLog 666 call VideoIO_Print 667 pop cx 668 inc ch 669 670 ;mov ch, 21 ; y 671 mov cl, 1 ; x 672 call VideoIO_Locate 673 mov ch, 15 ; fgc 674 mov cl, 0 ; bgc 675 call VideoIO_Color 676 677 678 ; Rousseau: 679 mov al, [NewPartitions] 680 ;call VideoIO_PrintByteDynamicNumber 681 mov al, [CFG_Partitions] 682 ;call VideoIO_PrintByteDynamicNumber 683 ret 684 VideoIO_DBG_WriteString EndP 685 686 687 ; Dump the disk-info. 688 ; Disk number is in DL. 689 VideoIO_DumpDiskInfo Proc Near 690 691 VideoIO_DumpDiskInfo_next_disk: 692 push dx 693 xor ax,ax 694 mov al,[TextPosY] 695 push ax 696 697 mov ax,21 698 mov dh,dl 699 and dh,01111111b 700 mul dh 701 mov dh,al 702 703 mov [TextPosX],dh 704 705 mov si, offset Disk 706 call VideoIO_Print 707 mov al,dl 708 709 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !! 710 shr al,4 711 add al,'0' 712 call VideoIO_PrintSingleChar 713 mov al,dl 714 and al,01111111b 715 add al,'0' 716 call VideoIO_PrintSingleChar 717 mov al,'h' 718 call VideoIO_PrintSingleChar 719 720 inc [TextPosY] 721 mov [TextPosX],dh 722 723 mov al,'-' 724 mov cl,17 725 call VideoIO_PrintSingleMultiChar 726 727 inc [TextPosY] 728 mov [TextPosX],dh 729 mov si, offset BiosCyls 730 call VideoIO_Print 731 732 push dx 733 mov bx,offset BIOS_Cyls 734 xor dh,dh 735 and dl,01111111b 736 shl dx,1 737 shl dx,1 738 add bx,dx 739 mov ax,[bx] 740 mov dx,[bx+02] 741 call VideoIO_PrintHexDWord 742 pop dx 743 744 inc [TextPosY] 745 mov [TextPosX],dh 746 mov si, offset BiosHeads 747 call VideoIO_Print 748 749 push dx 750 mov bx,offset BIOS_Heads 751 xor dh,dh 752 and dl,01111111b 753 shl dx,1 754 shl dx,1 755 add bx,dx 756 mov ax,[bx] 757 mov dx,[bx+02] 758 call VideoIO_PrintHexDWord 759 pop dx 760 761 inc [TextPosY] 762 mov [TextPosX],dh 763 mov si, offset BiosSecs 764 call VideoIO_Print 765 766 push dx 767 mov bx,offset BIOS_Secs 768 xor dh,dh 769 and dl,01111111b 770 shl dx,1 771 shl dx,1 772 add bx,dx 773 mov ax,[bx] 774 mov dx,[bx+02] 775 call VideoIO_PrintHexDWord 776 pop dx 777 778 inc [TextPosY] 779 mov [TextPosX],dh 780 mov si, offset LvmSecs 781 call VideoIO_Print 782 783 push dx 784 mov bx,offset TrueSecs 785 xor dh,dh 786 and dl,01111111b 787 shl dx,1 788 shl dx,1 789 add bx,dx 790 mov ax,[bx] 791 mov dx,[bx+02] 792 call VideoIO_PrintHexDWord 793 pop dx 794 795 inc [TextPosY] 796 mov [TextPosX],dh 797 mov si, offset BiosLBA 798 call VideoIO_Print 799 800 push dx 801 mov bx,offset BIOS_TotalSecs 802 xor dh,dh 803 and dl,01111111b 804 shl dx,1 805 shl dx,1 806 shl dx,1 807 add bx,dx 808 mov ax,[bx] 809 mov dx,[bx+02] 810 call VideoIO_PrintHexDWord 811 pop dx 812 813 inc [TextPosY] 814 mov [TextPosX],dh 815 816 pop ax 817 mov [TextPosY],al 818 pop dx 819 820 inc dl 821 mov al,dl 822 and al,01111111b 823 cmp al,[TotalHarddiscs] 824 jae VideoIO_DumpDiskInfo_end 825 jmp VideoIO_DumpDiskInfo_next_disk 826 827 VideoIO_DumpDiskInfo_end: 828 mov [TextPosX],0 829 add [TextPosY],6 830 ret 831 VideoIO_DumpDiskInfo EndP 832 833 834 835 ; Disk Info to Dump to AB LogScreen 836 Disk: db "DISK ",0 837 BiosCyls: db "Cyls :",0 838 BiosHeads: db "Heads :",0 839 BiosSecs: db "Secs :",0 840 LvmSecs: db "SecsLVM :",0 841 BiosLBA: db "LBA Secs:",0 842 843 844 HugeBootDisk: db "Boot Disk is Huge : ",0 845 DisksFound: db "Disks Found : ",0 846 PartitionsFound: db "Partitions Found : ",0 847 ;AutoStartPart: db "Auto Start Partition : ",0 848 849 Phase1: db "eCS Install Phase 1 : ",0 850 851 852 ShowMenu: db "Press TAB to return to the AiR-BOOT Menu",0 853 ShowBootLog: db "Press TAB to see the Boot Log...",0 854 855 Yes: db "YES",0 856 No: db "NO",0 857 On: db "ON",0 858 Off: db "OFF",0 859 None: db "NONE",0 860 Active: db "ACTIVE",0 861 NotActive: db "NOT ACTIVE",0 862 863 ; New Line for use by MBR_Teletype 864 NL: db 0dh, 0ah, 0
Note:
See TracChangeset
for help on using the changeset viewer.
