- Timestamp:
- Apr 11, 2014, 11:48:01 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/AIR-BOOT.ASM
r42 r43 1 1 ; 2 ; BSS moet op A000 liggen3 ; Segmented werkt niet4 ; Moet met Tasm/DOS assembleren5 ; Wat we dus *niet* willen !!6 ;7 8 9 10 2 ; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz 11 3 ; … … 25 17 ; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>. 26 18 ; 27 28 29 ;IFDEF JWASM30 ; db 'JWASM'31 ;ENDIF32 ;IFDEF TASM33 ; db 'TASM'34 ;ENDIF35 36 37 38 ;IF DEBUG_LEVEL EQ 039 ; db 'L0'40 ;ELSE41 ; db 'Lx'42 ;ENDIF43 44 45 ; ---------------------------------46 ; Rousseau: Fixes and Enhancements47 ; ---------------------------------48 ;49 ; v1.0.8-rc2-bld2012021350 ;-----------------------51 ; # Removed requirement for LVM P and V name to be the same to edit #52 ; However, when both are the same before the edit, the V name will be53 ; synved to the P name to have them both the same again after the edit.54 ; If they differ, only the V name is updated.55 ;56 ; # Trying to edit the label of a type 0x35 partition now shows a popup #57 ; The user is informed that type 0x35 labels cannot be edited.58 ;59 ; # Type 0x35 partitions cannot be added to the AB-menu anymore #60 ; They are not bootable anyway. The user is informed by a popup.61 ;62 ; # De-tasemized the Assembler sources for JWasm compatibility #63 ; AiR-BOOT can now be built using JWasm, which is now the preferred64 ; assembler.65 ;66 ; # Completely reworked the build-system #67 ; Everything is now done with Makefiles using WMake, Wlink and the68 ; C/C++ Compilers from the Open Watcom development tools together with JWasm.69 ; This obsoletes tasm, tlink and exe2bin.70 ;71 ; # Cross-Platform support #72 ; AiR-BOOT and it's helpers can now be built on: DOS, Win32, OS/2 and Linux.73 ;74 ; # Rewrote FIXCODE.ASM in C so the tool-chain is not dependent on a DOS .COM75 ; program for embedding the MBR-protection. DOS,Win32,OS/2 and Linux76 ; versions of FIXCODE are now used. (EXE[MZ|PE|LX] and ELF)77 ;78 ; v1.0.8-rc1-bld2012012479 ; ----------------------80 ; # Changed version format to be more WarpIN compatible #81 ; This is a cosmetic change only, the internal format has not changed.82 ;83 ; # Show LVM VolumeName instead of LVM PartitionName #84 ; Previous versions of AiR-BOOT used the LVM PartitionName as the Label85 ; if LVM-info was present for the partition.86 ; This is inconsistent with MiniLVM which shows the LVM VolumeName.87 ; Starting with v1.0.8 the LVM VolumeName is displayed.88 ;89 ; # LVM Partition and Volume name Synchronization #90 ; Changing the Label of a partition with LVM-info now synchronizes91 ; the LVM Partition Name with the LVM Volume Name.92 ; This is the same behavior as MiniLVM.93 ; Note however that the Label can only be changed when both the94 ; LVM PartitionName and LVM VolumeName are the same.95 ; See protected editing below.96 ;97 ; # Protected editing of the Label when LVM-info is present #98 ; When the LVM VolumeName differs from the LVM PartitionName, the user can99 ; edit the label but it will not be saved to the LVM record on disk.100 ; This is to protect configurations created with the classic LVM tool.101 ; Since MiniLVM assigns the same name to both the Partition and the Volume,102 ; the Label can be edited and will be saved for such partitions.103 ; To further protect a given configuration, LVM volumes with type 0x35104 ; cannot be edited at all. This is to ensure that the LVM PartitionNames105 ; remain unique when Spanning Volumes are used.106 ;107 ; # Editing the Label appended spaces #108 ; When editing and changing the Label of a System using SETUP,109 ; trailing spaces were stored in the LVM Volume and Partition names.110 ; These labels need to be padded with zero's.111 ; This has been fixed.112 ; This bug is also present in v1.06.113 ;114 ; # Reworked Primary Partition <-> LVM-info association #115 ; The previous way was to use a 1:1 correspondence between the PT-index116 ; and the LVM-index. However, when the PT is cross-linked, lower entries117 ; pointing to higher locations on the disk, or vice-versa, incorrect118 ; LVM-info was associated. Such a cross-linked PT is sometimes generated119 ; by the LVM engine when creating or deleting multiple partitions at once.120 ; Best is to intermediately save after creating or deleting a partition121 ; with (Mini)LVM.122 ; The new way is to search the LVM-entries for the partition requested.123 ;124 ; # Reworked MBR-code to provide two I13X signatures #125 ; The normal LVM MBR-code uses a special setup to indicate Int13X capability.126 ; It contains the instruction, MOV EAX,'X31I', and some software checks127 ; for the presence of the 'I13X' string in the MBR.128 ; However, the location of this instruction differs between eCS 1.x and129 ; eCS 2.x LVM MBR-code.130 ; For compatibility, the v1.0.8 MBR has the 'I13X' string at both locations.131 ;132 ; # Fixed booting older eCS installations on HPFS #133 ; When restoring systems from archive or otherwise generated systems,134 ; the HPFS BPB sometimes lacked information that AiR-BOOT did not fill in.135 ; The result was that a wrong partition was booted or that booting136 ; stalled with the "unable to operate harddisk" message.137 ; This has been fixed.138 ;139 ; # Fixed booting Windows from a logical partition with loader on FAT32 #140 ; Depending on the configuration, sometimes the NTLDR could not be found.141 ; This has been fixed.142 ;143 ; # Fixed drive-letter feature which was broken in v1.07 #144 ; a) v1.07 did remember the drive-letter feature was active for a partition,145 ; but it failed to store the drive-letter because too few configuration146 ; sectors were saved. This resulted in arbitrary values to be assigned147 ; to the drive-letter for the partition.148 ; b) The JFS PBR-code does not use the in-memory BPB but uses the one149 ; that is on disk. This prevented AiR-BOOT from passing the user assigned150 ; drive-letter. AiR-BOOT now inserts the drive-letter in the BPB on disk,151 ; but only if the partition is JFS.152 ; AB v1.06 is also unable to use the drive-letter feature on JFS.153 ; As a convenience, a drive-letter in the dl-feature pop-up can now be set154 ; to "Disabled" by pressing backspace.155 ; (As opposed to arrowing up/down to get to the "Disabled" entry)156 ;157 ; # Fixed stuck phase1 indicator when wrong name entered #158 ; When using SET(A)BOOT /4:NAME with the MEMDRIVE env-var set,159 ; and NAME being a non-existing partition, the phase1 indicator160 ; would stay stuck between reboots.161 ; This has been fixed.162 ;163 ; # Fixed DOS installer (AIRBOOT.COM) #164 ; Behavior should now be the same as the eCS and WIN installers.165 ; This re-enables the use of a bootable floppy or usb-stick166 ; to install AiR-BOOT.167 ;168 ; # Fixed booting from FloppyDrive #169 ; This is actually also broken in v1.06 when Int13X is forced on.170 ; Now regular BIOS calls are used when booting from floppydrive.171 ; A fresh AiR-BOOT installation now includes the floppydrive menu entry.172 ;173 ; # Fixed chainloading IBM Boot Manager #174 ; AiR-BOOT v1.06 could chainload IBM-BM but only when it resided on175 ; the first disk and was located below the 1024 cylinder and forced Int13X176 ; extensions were disabled.177 ; AiR-BOOT v1.0.8 can now chainload IBM-BM with forced Int13X extensions178 ; enabled (the default) and if IBM-BM resides above the 1024 cylinder limit.179 ; Also, chainloading IBM-BM from the second disk is supported.180 ; Do not use chainloading IBM-BM unless you really have a need to.181 ; See the AiR-BOOT Manual for "gotcha's" when using both AiR-BOOT and IBM-BM.182 ;183 ; # Corrected contact links #184 ; Version 1.07 still presented the old contact links to the sourceforge185 ; repository and the original author.186 ; This caused confusion with regard to issues with v1.07.187 ; This has been corrected.188 ;189 ; NOTE:190 ; AB v1.07 had a bug with saving and loading the correct size of the191 ; configuration. This broke the drive-letter feature.192 ; As a result, the CRC over the config was also calculated wrongly.193 ; While AB v1.0.8 fixes this, it has to use the v1.07 way of CRC calculation.194 ; Otherwise SET(A)BOOT from the eCS v2.1 would break on AB v1.0.8 because it195 ; sees a corrupt AiR-BOOT configuration.196 ; This means that the CRC over the AB config is calculated over 5 sectors197 ; instead of 7, just like in v1.07.198 ;199 ; NOTE:200 ; Because of space constraints most of the debug code has been commented201 ; out in this version.202 ; Possibly it will be re-enabled after code cleanup and changing to JWasm.203 ;204 ;205 ; v1.07206 ; -----207 ; # Huge Drives and LVM #208 ; When using disks >512GB under eComStation, the drive geometry changes to209 ; 127 or 255 sectors per track. Since LVM-info is written at the last sector210 ; of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the211 ; LVM-info and the eCS partition / volume bootsector.212 ; This has been fixed.213 ; Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT214 ; will use the eCS geometry to locate the LVM-info and the bootsector.215 ;216 ; # Special loader handling #217 ; The special handling of partition boot-loaders has been enhanced to218 ; enable booting of legacy systems on huge drives with or without OS/2219 ; extended geometry.220 ;221 ; # eComStation boot-through after phase 1 #222 ; Special functionality is implemented to directly boot a newly223 ; installed eCS system after completing phase 1 of the installation.224 ; This works in conjuntion with the OS/2 specific SET(A)BOOT.EXE program,225 ; also part of the AiR-BOOT package.226 ;227 ; # Math, Debug, Conv and Aux modules #228 ; These are used for 32-bit arithmatic on 16-bit code,229 ; debug the booting process, converting between data-types230 ; and outputting log-data to the com-port.231 ;232 ;233 ; v1.06234 ; -----235 ; This is the last version developed by Martin Kiewitz.236 ; It serves as the base for the versions above.237 ; Please do not post your feedback on sourceforge or bother Martin with238 ; regard to issues with the above versions.239 ; Use the eCS bug-tracker or the Trac project-page at netlabs and see the240 ; documentation of this newer versions for the relevant contact information.241 19 242 20 … … 262 40 ; instructions, to allow for automatic recoding by TASM. 263 41 ; This seems to be a TASM bug. (v2,v3,v4, dunno v5) 264 ; 265 ;JUMPS266 ; 42 IFDEF TASM 43 ;~ JUMPS 44 ENDIF 267 45 268 46 ; … … 272 50 ; 273 51 ;ModuleNames equ 1 274 275 276 277 278 279 ;280 ; An ORG directive resets the location counter where code and data is281 ; generated. If the location counter is reset back to a point where282 ; code or data already has been generated, this will be overwritten283 ; without warning.284 ; This macro is run at every ORG directive to check for this condition,285 ; and when it occurs further assembly is terminated.286 ; FIXME: Get JWasm and Tasm use some common ECHO/%OUT method.287 ; (Tasm only pases first word of non-quoted string to a macro)288 ;289 check_overlap MACRO loc290 291 ; Exit macro immediately if no overlap.292 ; We don't want to assign values to z_last_... if there is no293 ; overlap because they would then hold the values the last time this294 ; macro was called and not those of the last overlap.295 IF (loc - $) LE 0296 EXITM297 ENDIF298 299 ; Calculate the overlap.300 z_last_overlap_location = loc301 z_last_overlap_size = (loc - $)302 303 IFDEF JWASM304 ; Output message.305 ECHO306 ECHO ** ERROR: LOCATION OVERLAP DETECTED [JWASM] ! **307 ECHO . THIS IS MOST LIKELY CAUSED BY CODE / DATA308 ECHO . EXPANSION TOWARDS AN 'ORG' DIRECTIVE.309 ECHO . LOOK AT 'z_last_overlap_location' TO SEE WHERE.310 ECHO . LOOK AT 'z_last_overlap_size' TO SEE SIZE.311 ECHO . FORCING ERROR...312 ECHO313 ENDIF314 IFDEF TASM315 IF2316 ; Output message (only on pass2).317 %OUT318 %OUT ** ERROR: LOCATION OVERLAP DETECTED [TASM] ! **319 %OUT . THIS IS MOST LIKELY CAUSED BY CODE / DATA320 %OUT . EXPANSION TOWARDS AN 'ORG' DIRECTIVE.321 %OUT . LOOK AT 'z_last_overlap_location' TO WHERE.322 %OUT . LOOK AT 'z_last_overlap_size' TO SEE SIZE.323 %OUT . FORCING ERROR...324 %OUT325 ENDIF326 ENDIF327 328 ; Terminate assembly by forcing an error.329 .ERR330 331 ENDM332 333 334 52 335 53 … … 342 60 MaxDisks equ 64 343 61 344 ; 345 ; If defined then include DEBUG.ASM and output debug-info to serial-port. 346 ; 347 ;AuxDebug equ 1 348 349 ; Com-port for debugging, 0 is disabled 350 BiosComPort equ 0 62 ; Only when assembled with JWasm because Tasm generates too large code. 63 IFDEF JWASM 64 ; If defined then include DEBUG.ASM and output debug-info to serial-port. 65 AUX_DEBUG EQU 66 ELSE 67 ;~ AUX_DEBUG EQU 68 ENDIF 351 69 352 70 … … 363 81 364 82 ; 9600 bps, no parity, 1 stop-bit, 8 bits per char 365 AuxInitParms equ 11100011b 83 AUX_INIT_PARMS EQU 11100011b 84 85 ; Com-port for debugging, 0 is disabled 86 BIOS_COM_PORT EQU 1 366 87 367 88 ; Default word value for BIOS_AuxParms variable 368 89 ; Note that is has moved since v1.07 369 BIOS_AuxParmsDefault equ (AuxInitParms SHL 8) OR BiosComPort 90 BIOS_AUXPARMS_DEFAULT EQU (AUX_INIT_PARMS SHL 8) OR BIOS_COM_PORT 91 92 93 370 94 371 95 ; … … 373 97 ; 374 98 ReleaseCode equ -1 375 376 377 378 99 379 100 … … 542 263 543 264 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 265 ; ------------------------------------------ 266 ; Rousseau: # Changed this from .386 to .286 267 ; ------------------------------------------ 268 ; Because of the TASM-bug the processor had to be changed to turn JUMPS 269 ; off. Existing movzx instructions were replaced with 286 equivalent code. 270 ; Out of range relative jumps have been recoded. 271 ; TASM still generates an extra NOP after test [mem],1 272 ; instructions. 273 ; JWasm produces tighter code. 274 ; JWasm: 275 ; With segment overrides, the address is expanded to the bit-width. 276 ; So, .386 will generate a 32-bit address, even in a USE16 segment. 277 .286 278 279 ; This influences the uses directive and other stuff, 280 ; like calling-style and local variables. 281 ; The model itself,large, has no effect because we generate 282 ; a binairy image and not a segmented executable. 283 284 ; Tasm needs a memory model for USES on PROC to work. 285 IFDEF TASM 286 ;.model large, basic 287 .model tiny,c 288 ENDIF 568 289 569 290 ; … … 580 301 ; time. 581 302 ; 582 SEGMENTED EQU 1303 SEGMENTED EQU 583 304 584 305 IFDEF SEGMENTED 585 AIRBOOT GROUPIMAGE,VOLATILE306 AIRBOOT GROUP LDRIMAGE,VOLATILE 586 307 ENDIF 587 308 588 309 ; Our code-segment starts here. 589 IMAGESEGMENT USE16 PUBLIC 'MIXED'310 LDRIMAGE SEGMENT USE16 PUBLIC 'MIXED' 590 311 591 312 IFDEF SEGMENTED 592 ASSUMECS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing313 ASSUME CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing 593 314 ELSE 594 ASSUME CS:IMAGE, DS:IMAGE,ES:nothing, SS:nothing315 ASSUME CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing 595 316 ENDIF 596 597 317 598 318 ;============================================================================== … … 638 358 639 359 ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID 640 db 'AiRBOOT', 16h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID360 db 'AiRBOOT', 20h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID 641 361 642 362 ; Total Sectors Count. … … 709 429 710 430 711 712 431 ; Comport settings 713 432 ; It had to be moved to create room for the double I13X 714 433 ; signature. 715 434 ; It cannot be in the config-area (sector 55) 716 ; because that area 717 ; is crc-protected. 718 BIOS_AuxParms dw BIOS_AuxParmsDefault 719 720 ; 721 ; Reserved space 722 ; Should check overflow here, later... 723 ; 435 ; because that area is crc-protected and would not allow 'poking'. 436 here = $ 437 org 0003Ch 438 check_overlap here 439 BIOS_AuxParms dw BIOS_AUXPARMS_DEFAULT 440 724 441 reserved db 6 dup('X') 725 726 442 727 443 ; … … 733 449 ; want to change the AiR-BOOT signature 734 450 ; because of Microsoft inventions... 735 736 737 738 739 740 451 here = $ 741 452 org 044h … … 832 543 mov ds, ax ; Set DS==ES to Code Segment 833 544 545 834 546 ; If we are in debug-mode, all code is moved already, 835 547 ; so we can directly jump to it. … … 966 678 dw '$$' 967 679 680 681 here = $ 682 org 001beh 683 check_overlap here 968 684 969 685 ; Partition Table … … 1057 773 1058 774 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 775 ; ############################################## 1073 776 ; ## ENTRY-POINT AFTER ALL THE INITIAL HASSLE ## 1074 777 ; ############################################## 778 1075 779 1076 780 … … 1107 811 1108 812 813 mov ax, offset sobss 814 mov ax,offset BeginOfVariables 815 mov ax,offset [TrueSecs] 816 lea ax, [TrueSecs] 817 mov ax,word ptr [TrueSecs] 818 mov ax,offset EndOfVariables 819 mov ax, offset eobss 820 nop 821 ;~ mov ax, offset qqqq 822 1109 823 1110 824 ;jmp skip … … 1267 981 1268 982 1269 skip:983 skip: 1270 984 1271 985 … … 1441 1155 size_driveio = $-b_driveio 1442 1156 1157 b_lvm: 1158 Include SPECIAL/LVM.ASM ; LVM-specific code 1159 size_lvm = $-b_lvm 1160 1443 1161 b_videoio: 1444 1162 Include REGULAR/VIDEOIO.ASM ; Video I/O … … 1469 1187 size_other = $-b_other 1470 1188 1471 ; Rousseau: Special modules moved upwards.1472 1189 b_main: 1473 1190 Include SETUP/MAIN.ASM ; The whole AiR-BOOT SETUP 1474 1191 size_main = $-b_main 1192 1475 1193 1476 1194 … … 1481 1199 ENDIF 1482 1200 1201 1483 1202 b_math: 1484 1203 Include REGULAR/MATH.ASM ; Math functions (like 32-bit multiply) … … 1487 1206 1488 1207 1489 IFDEF AuxDebug 1208 1209 ; Various debugging routines, uses AUXIO and CONV 1210 IFDEF AUX_DEBUG 1490 1211 b_debug: 1491 ; Include REGULAR/DEBUG.ASM ; Various debugging routines, 1492 ; uses AUXIO and CONV 1212 Include REGULAR/DEBUG.ASM 1493 1213 size_debug = $-b_debug 1214 b_auxio: 1215 Include REGULAR/AUXIO.ASM ; Com-port support for debugging 1216 size_auxio = $-b_auxio 1494 1217 ENDIF 1495 1496 b_auxio:1497 ;Include REGULAR/AUXIO.ASM ; Com-port support for debugging1498 size_auxio = $-b_auxio1499 1500 ; Rousseau: moved upwards1501 ;IFDEF TXT_IncludeCyrillic1502 ; Include SPECIAL/CHARSET.ASM ; Charset Support (e.g. Cyrillic)1503 ;ENDIF1504 1505 b_lvm:1506 Include SPECIAL/LVM.ASM ; LVM-specific code1507 size_lvm = $-b_lvm1508 1218 1509 1219 … … 1603 1313 1604 1314 1605 1606 CODE_END: 1607 1608 ;org 06A00h - 4 1315 ; 1316 ; End of code marker. 1317 ; 1609 1318 db 'BABE' 1610 1611 ;org 06A00h1612 1319 db 'FACE' 1613 1320 1321 code_end: 1322 1323 1324 1325 here = $ 1326 org 06800h 1327 ; For some reason, this overlap check does not work !! 1328 ; I gues it's because 'here' has no definitive value yet 1329 ; and since JWasm is a single pass assembler, it won't 1330 ; change anymore. it is off by 1dh bytes. 1331 ; (Changing the ORG to 6700h produces an overlap of 11dh. 1332 ; This 1dh is by sheer coincidence the same length as the 1333 ; MBR_Prot signature on my system, but it's not related. 1334 check_overlap here 1335 1614 1336 ; 1615 1337 ; This is the AiR-BOOT MBR-Protection Image. 1616 ; 0 4600 / 200h = 34h = 52d sectors are before this point.1338 ; 06800 / 200h = 34h = 52d sectors are before this point. 1617 1339 ; The stuff generated here gets overwritten when the MBR_PROT.ASM 1618 1340 ; module, which is assembled separately, gets merged. 1619 1341 ; So you won't find the string below in the generated binary. 1620 1342 ; 1621 here = $ 1622 org 06800h 1623 check_overlap here 1624 1343 ; Hardcoded to 1k (1024 bytes) (MBR_PROT.ASM) 1625 1344 MBR_Protection db 'AiR-BOOT MBR-Protection Image' 1626 ; Hardcoded to 1k (1024 bytes) 1627 db 1024-($-MBR_Protection) dup(0) 1628 1629 1630 ;CODE_SEG ENDS 1631 1345 1346 ; Just fill. 1347 db 1024-($-MBR_Protection) dup('M') 1348 1349 ;LDRIMAGE ENDS 1632 1350 ;DATA_SEG SEGMENT USE16 PUBLIC 'CODE' 1351 1352 1353 1354 ;~ MYDATA SEGMENT COMMON 'MIXED' 1355 ;~ qqqq dw 'QQ' 1356 ;~ MYDATA ENDS 1633 1357 1634 1358 ;============================================================================== … … 1979 1703 ; 1980 1704 1981 IMAGEENDS1982 1983 ;DATA_SEG 1705 LDRIMAGE ENDS 1706 1707 ;DATA_SEG ENDS 1984 1708 1985 1709 ; … … 2000 1724 ; 2001 1725 org 02400h ; Uninitialized 2002 1726 ;~ org 00200h ; 200h geeft 3 floppies ! 2003 1727 2004 1728 ; This space actually gets initialized in PreCrap to NUL (till EndOfVariables) … … 2010 1734 2011 1735 ; Everything used to build a new IPT and reference it to the old one 1736 ; IETS OVERSCHRIJFT DIT !! 2012 1737 NewPartTable db 1536 dup (?) ; New Partition Table 1738 2013 1739 NewHidePartTable db partition_count * LocHPT_LenOfHPT dup (?) ; New Hide-Partition Table 2014 1740 NewDriveLetters db partition_count dup (?) ; Logical Drive-Letters … … 2167 1893 VOLATILE ENDS 2168 1894 ELSE 2169 IMAGEENDS1895 LDRIMAGE ENDS 2170 1896 ENDIF 1897 2171 1898 END AIR_BOOT 2172 1899 2173 2174 -
trunk/BOOTCODE/BLDDATE.ASM
r42 r43 1 1 IFDEF JWASM 2 BUILD_DATE db 'Build Date: 16 Feb 2012 at 03:00:00 [JWasm]',02 BUILD_DATE db 'Build Date: 20 Feb 2012 at 19:30:00 [JWasm]',0 3 3 ENDIF 4 4 IFDEF TASM 5 BUILD_DATE db 'Build Date: 16 Feb 2012 at 03:00:00 [Tasm]',05 BUILD_DATE db 'Build Date: 20 Feb 2012 at 19:30:00 [Tasm]',0 6 6 ENDIF -
trunk/BOOTCODE/Makefile
r42 r43 130 130 #ASM=masm 131 131 #ASM=alp 132 #ASM=tasm132 ASM=tasm 133 133 #ASM=wasm 134 ASM=jwasm134 #ASM=jwasm 135 135 136 136 # -
trunk/BOOTCODE/REGULAR/AUXIO.ASM
r31 r43 34 34 35 35 ; Initialize the com-port, but only when logging is enabled. 36 ; It get's it's parameters from offset 1B0hin the MBR.36 ; It get's it's parameters from the value in the MBR. 37 37 ; Out: AX - line status 38 AuxIO_Init 39 ; bits 7-5 = datarate (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)40 ; bits 4-3 = parity (00 or 10 = none, 01 = odd, 11 = even)41 ; bit 2 = stop-bits (set = 2 stop-bits, clear = 1 stop-bit)42 ; bits 1-0 = data-bits (00 = 5, 01 = 6, 10 = 7, 11 = 8)43 ; mov [BIOS_AuxParms],ax ; save initialization and port44 movdx,[BIOS_AuxParms] ; DL=port, 0=disabled, 1=com1; DH=config-parms45 testdl,dl ; see if logging is enabled, if not, skip initialization46 jzAuxIO_Init_NoLogging47 48 decdl ; adjust port-number49 anddl,03h ; 3 is max value50 51 ; Initialization message52 movsi,offset AuxInitMsg53 callMBR_Teletype54 55 ; Port number56 callVideoIO_SyncPos57 moval,dl58 incal59 callVideoIO_PrintByteDynamicNumber60 xorsi,si61 callMBR_TeletypeNL62 63 ; Do the initialization64 moval,dh ; initialization parameters to al65 movdh,0 ; DX now contains port-number66 movah,067 int14h ; intialize com-port68 AuxIO_Init_NoLogging:69 ret70 AuxIO_Init 38 AuxIO_Init Proc Near Uses dx si 39 ; bits 7-5 = datarate (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps) 40 ; bits 4-3 = parity (00 or 10 = none, 01 = odd, 11 = even) 41 ; bit 2 = stop-bits (set = 2 stop-bits, clear = 1 stop-bit) 42 ; bits 1-0 = data-bits (00 = 5, 01 = 6, 10 = 7, 11 = 8) 43 ; mov [BIOS_AuxParms],ax ; save initialization and port 44 mov dx,[BIOS_AuxParms] ; DL=port, 0=disabled, 1=com1; DH=config-parms 45 test dl,dl ; see if logging is enabled, if not, skip initialization 46 jz AuxIO_Init_NoLogging 47 48 dec dl ; adjust port-number 49 and dl,03h ; 3 is max value 50 51 ; Initialization message 52 mov si,offset AuxInitMsg 53 call MBR_Teletype 54 55 ; Port number 56 call VideoIO_SyncPos 57 mov al,dl 58 inc al 59 call VideoIO_PrintByteDynamicNumber 60 xor si,si 61 call MBR_TeletypeNL 62 63 ; Do the initialization 64 mov al,dh ; initialization parameters to al 65 mov dh,0 ; DX now contains port-number 66 mov ah,0 67 int 14h ; intialize com-port 68 AuxIO_Init_NoLogging: 69 ret 70 AuxIO_Init EndP 71 71 72 72 … … 75 75 ; Destroyed: None 76 76 AuxIO_PrintSingleChar Proc Near Uses ax es di 77 nop77 nop 78 78 AuxIO_PrintSingleChar EndP 79 79 80 80 81 81 ; Print char to com-port (teletype style) 82 AuxIO_Teletype 83 movdx,[BIOS_AuxParms] ; get port and parameters84 xordh,dh ; we don't need the parameters85 testdl,dl ; test if logging is enabled86 jzAuxIO_Teletype_NoLogging ; nope, return immediately87 decdl ; adjust port-number88 anddl,03h ; 3 is max value89 movah,01h90 int14h ; send char to com-port91 AuxIO_Teletype_NoLogging:92 ret93 AuxIO_TeleType 82 AuxIO_Teletype Proc Near Uses ax dx 83 mov dx,[BIOS_AuxParms] ; get port and parameters 84 xor dh,dh ; we don't need the parameters 85 test dl,dl ; test if logging is enabled 86 jz AuxIO_Teletype_NoLogging ; nope, return immediately 87 dec dl ; adjust port-number 88 and dl,03h ; 3 is max value 89 mov ah,01h 90 int 14h ; send char to com-port 91 AuxIO_Teletype_NoLogging: 92 ret 93 AuxIO_TeleType EndP 94 94 95 95 96 96 ; Print newline char (unix) to com-port (teletype style) 97 AuxIO_TeletypeNL 98 moval,1099 callAuxIO_Teletype100 ret101 AuxIO_TeleTypeNL 97 AuxIO_TeletypeNL Proc Near Uses ax 98 mov al,10 99 call AuxIO_Teletype 100 ret 101 AuxIO_TeleTypeNL EndP 102 102 103 103 … … 108 108 ; Destroyed: None 109 109 AuxIO_TeletypeHexByte Proc Near Uses ax 110 callCONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL111 xchgal,ah ; High hex-nibble first112 callAuxIO_Teletype ; Output to com-port113 xchgal,ah ; Low hex-nibble next114 callAuxIO_Teletype ; Output to com-port115 ret110 call CONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL 111 xchg al,ah ; High hex-nibble first 112 call AuxIO_Teletype ; Output to com-port 113 xchg al,ah ; Low hex-nibble next 114 call AuxIO_Teletype ; Output to com-port 115 ret 116 116 AuxIO_TeleTypeHexByte EndP 117 117 … … 122 122 ; Destroyed: None 123 123 AuxIO_TeletypeHexWord Proc Near 124 xchgal,ah ; High byte first125 callAuxIO_TeletypeHexByte ; Output to com-port126 xchgal,ah ; low byte next127 callAuxIO_TeletypeHexByte ; Output to com-port128 ret124 xchg al,ah ; High byte first 125 call AuxIO_TeletypeHexByte ; Output to com-port 126 xchg al,ah ; low byte next 127 call AuxIO_TeletypeHexByte ; Output to com-port 128 ret 129 129 AuxIO_TeleTypeHexWord EndP 130 130 … … 136 136 ; Destroyed: None 137 137 AuxIO_TeletypeHexDWord Proc Near 138 xchgax,dx139 callAuxIO_TeletypeHexWord ; High word first140 xchgax,dx141 callAuxIO_TeletypeHexWord ; Low word next142 ret138 xchg ax,dx 139 call AuxIO_TeletypeHexWord ; High word first 140 xchg ax,dx 141 call AuxIO_TeletypeHexWord ; Low word next 142 ret 143 143 AuxIO_TeleTypeHexDWord EndP 144 144 … … 150 150 ; Destroyed: None 151 151 AuxIO_TeletypeHexQWord Proc Near 152 xchgdx,bx153 xchgax,cx154 callAuxIO_TeletypeHexDWord ; High dword first155 xchgdx,bx156 xchgax,cx157 callAuxIO_TeletypeHexDWord ; Low dword next158 ret152 xchg dx,bx 153 xchg ax,cx 154 call AuxIO_TeletypeHexDWord ; High dword first 155 xchg dx,bx 156 xchg ax,cx 157 call AuxIO_TeletypeHexDWord ; Low dword next 158 ret 159 159 AuxIO_TeleTypeHexQWord EndP 160 160 161 161 162 162 163 164 165 166 163 ; Print 0-terminated string to com-port 167 AuxIO_Print Proc Near Uses ax bx cx dx168 AuxIO_PrintNext:169 lodsb170 testal,al171 jzAuxIO_PrintEOS172 callAuxIO_Teletype173 jmpAuxIO_PrintNext174 AuxIO_PrintEOS:175 ret176 AuxIO_Print EndP164 AuxIO_Print Proc Near Uses ax bx cx dx 165 AuxIO_PrintNext: 166 lodsb 167 test al,al 168 jz AuxIO_PrintEOS 169 call AuxIO_Teletype 170 jmp AuxIO_PrintNext 171 AuxIO_PrintEOS: 172 ret 173 AuxIO_Print EndP 177 174 178 175 … … 182 179 AuxIO_DumpParagraph Proc Near Uses ax cx dx si 183 180 184 ; Dump the index dword185 xordx,dx186 movax,si187 callAuxIO_TeletypeHexDWord188 189 ; Separate it from the dump190 moval,' '191 callAuxIO_Teletype192 moval,' '193 callAuxIO_Teletype194 moval,'|'195 callAuxIO_Teletype196 moval,' '197 callAuxIO_Teletype198 199 ; Save si for later200 pushsi201 202 ; Four groups of 4 bytes203 movcx,4204 205 206 AuxIO_DumpParagraph_Next_1:207 208 ; byte at offset 0209 lodsb210 callAuxIO_TeletypeHexByte211 212 ; space separator213 moval,' '214 callAuxIO_Teletype215 216 ; byte at offset 1217 lodsb218 callAuxIO_TeletypeHexByte219 220 ; space separator221 moval,' '222 callAuxIO_Teletype223 224 ; byte at offset 2225 lodsb226 callAuxIO_TeletypeHexByte227 228 ; space separator229 mov al,' '230 callAuxIO_Teletype231 232 ; byte at offset 3233 lodsb234 callAuxIO_TeletypeHexByte235 236 ; space separator237 mov al,' '238 callAuxIO_Teletype239 240 ; separator241 mov al,'|'242 callAuxIO_Teletype243 244 ; space separator245 mov al,' '246 callAuxIO_Teletype247 248 loopAuxIO_DumpParagraph_Next_1249 250 ; space separator251 mov al,' '252 callAuxIO_Teletype253 254 ; recall pointer255 popsi256 257 ; 16 ascii bytes to print258 movcx,16259 260 AuxIO_DumpParagraph_Next_2:261 movah,'.' ; char to use ufnot printable262 lodsb ; load byte263 callCONV_ConvertToPrintable ; use dot's if not printable264 callAuxIO_Teletype ; print it265 loopAuxIO_DumpParagraph_Next_2266 ret267 AuxIO_DumpParagraph EndP268 269 270 271 AuxIO_DumpSector Proc Near Uses cx si272 movcx,32 ; Number of paragraphs in a sector273 AuxIO_DumpSector_Next:274 callAuxIO_DumpParagraph ; Dump te paragraph275 addsi,16 ; Advance pointer276 callAuxIO_TeletypeNL277 loopAuxIO_DumpSector_Next278 ret279 AuxIO_DumpSector EndP280 281 282 AuxIOHello :db 'AiR-BOOT com-port debugging',10,0283 284 285 181 ; Dump the index dword 182 xor dx,dx 183 mov ax,si 184 call AuxIO_TeletypeHexDWord 185 186 ; Separate it from the dump 187 mov al,' ' 188 call AuxIO_Teletype 189 mov al,' ' 190 call AuxIO_Teletype 191 mov al,'|' 192 call AuxIO_Teletype 193 mov al,' ' 194 call AuxIO_Teletype 195 196 ; Save si for later 197 push si 198 199 ; Four groups of 4 bytes 200 mov cx,4 201 202 203 AuxIO_DumpParagraph_Next_1: 204 205 ; byte at offset 0 206 lodsb 207 call AuxIO_TeletypeHexByte 208 209 ; space separator 210 mov al,' ' 211 call AuxIO_Teletype 212 213 ; byte at offset 1 214 lodsb 215 call AuxIO_TeletypeHexByte 216 217 ; space separator 218 mov al,' ' 219 call AuxIO_Teletype 220 221 ; byte at offset 2 222 lodsb 223 call AuxIO_TeletypeHexByte 224 225 ; space separator 226 mov al,' ' 227 call AuxIO_Teletype 228 229 ; byte at offset 3 230 lodsb 231 call AuxIO_TeletypeHexByte 232 233 ; space separator 234 mov al,' ' 235 call AuxIO_Teletype 236 237 ; separator 238 mov al,'|' 239 call AuxIO_Teletype 240 241 ; space separator 242 mov al,' ' 243 call AuxIO_Teletype 244 245 loop AuxIO_DumpParagraph_Next_1 246 247 ; space separator 248 mov al,' ' 249 call AuxIO_Teletype 250 251 ; recall pointer 252 pop si 253 254 ; 16 ascii bytes to print 255 mov cx,16 256 257 AuxIO_DumpParagraph_Next_2: 258 mov ah,'.' ; char to use ufnot printable 259 lodsb ; load byte 260 call CONV_ConvertToPrintable ; use dot's if not printable 261 call AuxIO_Teletype ; print it 262 loop AuxIO_DumpParagraph_Next_2 263 ret 264 AuxIO_DumpParagraph EndP 265 266 267 268 AuxIO_DumpSector Proc Near Uses cx si 269 mov cx,32 ; Number of paragraphs in a sector 270 AuxIO_DumpSector_Next: 271 call AuxIO_DumpParagraph ; Dump te paragraph 272 add si,16 ; Advance pointer 273 call AuxIO_TeletypeNL 274 loop AuxIO_DumpSector_Next 275 ret 276 AuxIO_DumpSector EndP 277 278 279 AuxIOHello db 'AiR-BOOT com-port debugging',10,0 280 281 282 -
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r40 r43 598 598 ; In: CL - Color, DL - Partition 599 599 ; Destroyed: None, but Locate-Pointer gets set 600 BOOTMENU_ReColorPart 601 602 ; call SOUND_Beep603 604 mov bh, cl ; Color to BH605 ; First calculate location of bar606 cmp Menu_UpperPart, dl607 ja BMRCP_NotInWindowView608 mov ch, dl609 sub ch, Menu_UpperPart; CH - Position relative to UpperPart610 cmp ch, 14; 14 - Maximum Total in Window611 ja BMRCP_NotInWindowView612 add ch, 5; Y-Position add-on fixed 5613 mov cl, 2; X-Position is always 2614 call VideoIO_Locate; geht zu CX615 call VideoIO_Internal_SetRegs616 inc di; DI - Destination+1 -> Color-Byte617 mov cl, 78; Length of Bar is always 78618 BMRCP_ClearLoop:619 mov al, es:[di]620 and al, 0Fh621 or al, bh; Adds background color (from BH)622 623 ;mov al,97h624 625 mov es:[di], al626 add di, 2627 dec cl628 jnz BMRCP_ClearLoop629 BMRCP_NotInWindowView:630 ret631 BOOTMENU_ReColorPart 600 BOOTMENU_ReColorPart Proc Near Uses bx cx es di 601 602 ; call SOUND_Beep 603 604 mov bh, cl ; Color to BH 605 ; First calculate location of bar 606 cmp Menu_UpperPart, dl 607 ja BMRCP_NotInWindowView 608 mov ch, dl 609 sub ch, Menu_UpperPart ; CH - Position relative to UpperPart 610 cmp ch, 14 ; 14 - Maximum Total in Window 611 ja BMRCP_NotInWindowView 612 add ch, 5 ; Y-Position add-on fixed 5 613 mov cl, 2 ; X-Position is always 2 614 call VideoIO_Locate ; geht zu CX 615 call VideoIO_Internal_SetRegs 616 inc di ; DI - Destination+1 -> Color-Byte 617 mov cl, 78 ; Length of Bar is always 78 618 BMRCP_ClearLoop: 619 mov al, es:[di] 620 and al, 0Fh 621 or al, bh ; Adds background color (from BH) 622 623 ;mov al,97h 624 625 mov es:[di], al 626 add di, 2 627 dec cl 628 jnz BMRCP_ClearLoop 629 BMRCP_NotInWindowView: 630 ret 631 BOOTMENU_ReColorPart EndP 632 632 633 633 634 634 ; Calculate Menu-Variables for Boot-Menu, these use the filtered Part-Pointers 635 BOOTMENU_ResetMenuVars 636 xor dl, dl ; Partition at Pos 0 == 1st637 mov Menu_UpperPart, dl638 639 ; = TIMED BOOTING =640 mov dl, CFG_TimedBoot641 mov TimedBootEnable, dl642 mov al, CFG_TimedSecs643 mov TimedSecondLeft, al644 call TIMER_TranslateSecToTic645 add ax, 16 ; So that the required ammount will646 mov CFG_TimedDelay, ax ; be shown and not Timer-1.647 call BOOTMENU_ResetTimedBoot648 ; = FLOPPY-GET-NAME TIMER =649 call BOOTMENU_ResetGetFloppy650 651 ; Resettet die Base-Variablen...652 mov dl, PartitionPointerCount653 mov Menu_TotalParts, dl654 655 ; Copy device-name to the ContBIOSbootSeq-IPT entry656 ; Normally this does not need to get done here, but is done for safety657 ; reasons if e.g. IPT got changed by SETUP, but that setup was discarded.658 call PART_UpdateResumeBIOSName659 660 ; Default-Partition -> Filtered View -> Menu_EntryDefault661 mov dl, CFG_PartDefault662 call PART_ConvertFromStraight663 mov Menu_EntryDefault, dl664 665 ; Last-Booted-Partition -> Filtered View -> Menu_EntryLast666 mov dl, CFG_PartLast667 call PART_ConvertFromStraight668 mov Menu_EntryLast, dl669 670 ; Automatic-Partition -> Filtered View -> Menu_EntryAutomatic671 mov dl, CFG_PartAutomatic672 call PART_ConvertFromStraight673 mov Menu_EntryAutomatic, dl674 675 ; [Linux support removed since v1.02]676 ;; Okay, now we check if Default/Last Kernel Partition Name is available...677 ;; if so, simply set Menu_EntryDefault/Menu_EntryLast.678 ;mov si, offset CFG_LinuxDefaultKernel679 ;call LINUX_SearchKernelName ; DL - Filtered Entry No680 ;cmp dl, 0FFh681 ;je BMRMV_DefaultKernelNF682 ;mov Menu_EntryDefault, dl683 ;BMRMV_DefaultKernelNF:684 ;mov si, offset CFG_LinuxLastKernel685 ;call LINUX_SearchKernelName ; DL - Filtered Entry No686 ;cmp dl, 0FFh687 ;je BMRMV_LastKernelNF688 ;mov Menu_EntryLast, dl689 ;BMRMV_LastKernelNF:690 691 ; restlichen Variablen berechnen...692 mov dl, Menu_TotalParts693 cmp Menu_TotalParts, 14694 jbe BMRMV_NotMoreThan14695 mov dl, 14696 BMRMV_NotMoreThan14:697 mov Menu_TotalLines, dl698 699 ; Now copy the name of the Timed-Booted Partition to TimedBoot-Field700 mov dl, Menu_EntryDefault701 test CFG_TimedBootLast, 1702 jz BMRMV_TimedBootDefault703 mov dl, Menu_EntryLast704 BMRMV_TimedBootDefault:705 call PART_GetPartitionPointer ; Holt SI fr Partition DL706 add si, LocIPT_Name707 mov cx, 11708 call GetLenOfName709 mov di, offset TXT_TimedBootEntryName710 jz BMRMV_NoName711 rep movsb712 BMRMV_NoName:713 xor al, al714 stosb ; Ending Zero715 ret716 BOOTMENU_ResetMenuVars 635 BOOTMENU_ResetMenuVars Proc Near Uses dx 636 xor dl, dl ; Partition at Pos 0 == 1st 637 mov Menu_UpperPart, dl 638 639 ; = TIMED BOOTING = 640 mov dl, CFG_TimedBoot 641 mov TimedBootEnable, dl 642 mov al, CFG_TimedSecs 643 mov TimedSecondLeft, al 644 call TIMER_TranslateSecToTic 645 add ax, 16 ; So that the required ammount will 646 mov CFG_TimedDelay, ax ; be shown and not Timer-1. 647 call BOOTMENU_ResetTimedBoot 648 ; = FLOPPY-GET-NAME TIMER = 649 call BOOTMENU_ResetGetFloppy 650 651 ; Resettet die Base-Variablen... 652 mov dl, PartitionPointerCount 653 mov Menu_TotalParts, dl 654 655 ; Copy device-name to the ContBIOSbootSeq-IPT entry 656 ; Normally this does not need to get done here, but is done for safety 657 ; reasons if e.g. IPT got changed by SETUP, but that setup was discarded. 658 call PART_UpdateResumeBIOSName 659 660 ; Default-Partition -> Filtered View -> Menu_EntryDefault 661 mov dl, CFG_PartDefault 662 call PART_ConvertFromStraight 663 mov Menu_EntryDefault, dl 664 665 ; Last-Booted-Partition -> Filtered View -> Menu_EntryLast 666 mov dl, CFG_PartLast 667 call PART_ConvertFromStraight 668 mov Menu_EntryLast, dl 669 670 ; Automatic-Partition -> Filtered View -> Menu_EntryAutomatic 671 mov dl, CFG_PartAutomatic 672 call PART_ConvertFromStraight 673 mov Menu_EntryAutomatic, dl 674 675 ;~ ; [Linux support removed since v1.02] 676 ;~ ; Okay, now we check if Default/Last Kernel Partition Name is available... 677 ;~ ; if so, simply set Menu_EntryDefault/Menu_EntryLast. 678 ;~ mov si, offset CFG_LinuxDefaultKernel 679 ;~ call LINUX_SearchKernelName ; DL - Filtered Entry No 680 ;~ cmp dl, 0FFh 681 ;~ je BMRMV_DefaultKernelNF 682 ;~ mov Menu_EntryDefault, dl 683 ;~ BMRMV_DefaultKernelNF: 684 ;~ mov si, offset CFG_LinuxLastKernel 685 ;~ call LINUX_SearchKernelName ; DL - Filtered Entry No 686 ;~ cmp dl, 0FFh 687 ;~ je BMRMV_LastKernelNF 688 ;~ mov Menu_EntryLast, dl 689 ;~ BMRMV_LastKernelNF: 690 691 ; restlichen Variablen berechnen... 692 mov dl, Menu_TotalParts 693 cmp Menu_TotalParts, 14 694 jbe BMRMV_NotMoreThan14 695 mov dl, 14 696 BMRMV_NotMoreThan14: 697 mov Menu_TotalLines, dl 698 699 ; Now copy the name of the Timed-Booted Partition to TimedBoot-Field 700 mov dl, Menu_EntryDefault 701 test CFG_TimedBootLast, 1 702 jz BMRMV_TimedBootDefault 703 mov dl, Menu_EntryLast 704 BMRMV_TimedBootDefault: 705 call PART_GetPartitionPointer ; Holt SI fr Partition DL 706 add si, LocIPT_Name 707 mov cx, 11 708 call GetLenOfName 709 mov di, offset TXT_TimedBootEntryName 710 jz BMRMV_NoName 711 rep movsb 712 BMRMV_NoName: 713 xor al, al 714 stosb ; Ending Zero 715 ret 716 BOOTMENU_ResetMenuVars EndP 717 717 718 718 ; Will Set some Vars after user selected entry to boot... 719 719 ; ...don't select Straight View ! 720 BOOTMENU_SetVarsAfterMenu Proc Near 721 ; No Straight View in here...we got filtered view since BootMenu-Startup... 722 mov al, CFG_RememberTimed 723 test TimedBootUsed, 1 724 jnz BMSVAM_TimedBootUsed 725 mov al, CFG_RememberBoot 726 BMSVAM_TimedBootUsed: 727 or al, al 728 jz BMSVAM_DontRememberBoot 729 mov dl, Menu_EntrySelected 730 call PART_ConvertToStraight ; CFG_PartLast is non-filtered 731 ; mov di, offset CFG_LinuxLastKernel 732 ; mov cx, 11 733 cmp dl, 0FDh ; Dont Remember on Floppy/CD-ROM/etc. 734 ja BMSVAM_DontRememberBoot 735 ; je BMSVAM_RememberKernelBoot ; but remember Kernel-Bootings... 736 mov CFG_PartLast, dl ; Remember partition in CFG_PartLast 737 ; mov al, ' ' 738 ; rep stosb ; SPACE out CFG_LinuxLastKernel 739 BMSVAM_DontRememberBoot: 740 ret 741 ; 742 ; BMSVAM_RememberKernelBoot: 743 ; mov dl, Menu_EntrySelected 744 ; call PART_GetPartitionPointer ; SI - Pointer to Kernel Entry... 745 ; add si, LocIPT_Name 746 ; rep movsb ; Copy KernelName 2 CFG_LinuxLastKernel 747 ; ret 748 BOOTMENU_SetVarsAfterMenu EndP 720 BOOTMENU_SetVarsAfterMenu Proc Near 721 ; No Straight View in here...we got filtered view since BootMenu-Startup... 722 mov al, CFG_RememberTimed 723 test TimedBootUsed, 1 724 jnz BMSVAM_TimedBootUsed 725 mov al, CFG_RememberBoot 726 BMSVAM_TimedBootUsed: 727 or al, al 728 jz BMSVAM_DontRememberBoot 729 mov dl, Menu_EntrySelected 730 call PART_ConvertToStraight ; CFG_PartLast is non-filtered 731 ;~ mov di, offset CFG_LinuxLastKernel 732 ;~ mov cx, 11 733 cmp dl, 0FDh ; Dont Remember on Floppy/CD-ROM/etc. 734 ja BMSVAM_DontRememberBoot 735 ; je BMSVAM_RememberKernelBoot ; but remember Kernel-Bootings... 736 mov CFG_PartLast, dl ; Remember partition in CFG_PartLast 737 ;~ mov al, ' ' 738 ;~ rep stosb ; SPACE out CFG_LinuxLastKernel 739 BMSVAM_DontRememberBoot: 740 ret 741 742 ;~ BMSVAM_RememberKernelBoot: 743 ;~ mov dl, Menu_EntrySelected 744 ;~ call PART_GetPartitionPointer ; SI - Pointer to Kernel Entry... 745 ;~ add si, LocIPT_Name 746 ;~ rep movsb ; Copy KernelName 2 CFG_LinuxLastKernel 747 ;~ ret 748 BOOTMENU_SetVarsAfterMenu EndP 749 750 751 749 752 750 753 ; Actually does the Boot-Menu Interaction 751 754 ; Sets Carry-flag, if Setup is to be entered, otherwise system shall get booted 752 755 ; On boot: Fills out some variables (like Menu_EntrySelected), when Booting 753 BOOTMENU_Execute 754 ; Finds out, where to place the bar at first...755 mov dl, Menu_EntryDefault756 test CFG_RememberBoot, 1757 jnz BME_RememberMode758 test CFG_RememberTimed, 1759 jz BME_ForgetMode760 BME_RememberMode:761 mov dl, Menu_EntryLast762 BME_ForgetMode:763 ; Got it, so display bar...764 mov dh, dl765 766 ;callSOUND_Beep767 768 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active769 770 ;callSOUND_Beep771 772 call SOUND_PreBootMenu773 774 775 BME_MainLoop:776 777 ;call VideoIO_DBG_WriteString2 ; Rousseau778 779 test TimedBootEnable, 1780 jz BME_NoTimedBoot781 ; ------------------------------------------------ TIMED BOOT782 push ax783 push dx784 785 786 787 788 789 790 791 792 793 794 795 796 pop dx797 pop ax798 mov dl, Menu_EntryDefault799 and CFG_TimedBootLast, 1800 jz BME_TimedBootDefault801 mov dl, Menu_EntryLast802 803 mov Menu_EntrySelected, dl ; Just boot default partition804 mov TimedBootUsed, 1 ; set flag...805 clc ; Boot-Now!806 ret807 808 809 pop dx810 pop ax811 BME_NoTimedBoot:812 ; ------------------------------------------------ FLOPPY-NAME TIMER813 test CFG_FloppyBootGetTimer, 1814 jz BME_NoFloppyNameTimer815 ; Wait 2 Seconds everytime816 push ax817 push dx818 819 820 821 822 823 824 825 pop dx826 pop ax827 jmp BME_RefreshFloppyName828 829 pop dx830 pop ax831 BME_NoFloppyNameTimer:832 ; ------------------------------------------------ KEYBOARD833 push dx834 mov ah, 1835 int 16h836 pop dx837 jnz BME_KeyAvailable838 jmp BME_MainLoop839 840 BME_RefreshFloppyName:841 test CFG_IncludeFloppy, 1842 jz BME_NoRefreshFloppyName843 test CFG_FloppyBootGetName, 1844 jz BME_NoRefreshFloppyName845 846 847 848 BME_NoRefreshFloppyName:849 jmp BME_MainLoop850 851 BME_KeyAvailable:852 push dx853 mov ah, 0854 int 16h855 pop dx856 cmp ah, Keys_ENTER857 je BME_KeyEnter858 cmp ah, Keys_F10859 je BME_KeyF10860 cmp ah, Keys_Delete861 je BME_KeyDelete862 cmp ah, Keys_ESC863 je BME_KeyESC864 ; Upper Keys do not fall under Timed Boot Key Handling865 test TimedBootEnable, 1866 je BME_NoTimedKeyHandling867 cmp CFG_TimedKeyHandling, 1868 jb BME_NoTimedKeyHandling ; = 0869 je BME_ResetTimedBoot ; = 1870 mov al, TimedBootEnable ; = 2871 xor al, 1 ; Flip Flop Switch :]872 mov TimedBootEnable, al873 874 push dx875 876 877 pop dx878 BME_NoTimedKeyHandling:879 cmp ah, Keys_TAB880 je BME_KeyTAB881 cmp ah, Keys_Up882 je BME_KeyUp883 cmp ah, Keys_Down884 je BME_KeyDown885 jmp BME_MainLoop886 887 BME_KeyUp:888 dec dh889 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active890 jmp BME_MainLoop891 892 BME_KeyDown:893 inc dh894 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active895 jmp BME_MainLoop896 897 BME_KeyEnter:898 mov Menu_EntrySelected, dl899 mov TimedBootUsed, 0 ; reset flag...900 clc ; Boot-Now!901 ret902 903 BME_KeyF10:904 mov al, Keys_Flags_EnterSetup905 mov SETUP_KeysOnEntry, al ; Simulate user wants to enter setup906 stc ; Go Re-Enter Setup907 ret908 909 BME_KeyDelete:910 call SOUND_ExecuteBoot911 call APM_TurnOffComputer912 jmp BME_MainLoop913 914 BME_KeyESC:915 mov al, TimedBootEnable916 xor al, 1 ; Flip Flop Switch :]917 mov TimedBootEnable, al918 push dx919 call BOOTMENU_ResetTimedBoot ; Reset Timer920 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText921 pop dx922 jmp BME_MainLoop923 924 BME_KeyTAB:925 push dx926 test CFG_CooperBars, 1927 jnz BME_KeyTAB_ShowFX928 mov ax, 0501h ; Go To Page 1 -> BIOS POST crap929 int 10h930 mov ah, 0931 int 16h ; Wait for any key932 call BOOTMENU_ResetTimedBoot ; Reset Timer933 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText934 mov ax, 0500h ; Go Back to Page 0935 int 10h936 pop dx937 jmp BME_MainLoop938 939 pusha940 941 942 943 944 945 946 947 948 949 950 951 952 953 popa954 pop dx955 jmp BME_MainLoop756 BOOTMENU_Execute Proc Near Uses es di 757 ; Finds out, where to place the bar at first... 758 mov dl, Menu_EntryDefault 759 test CFG_RememberBoot, 1 760 jnz BME_RememberMode 761 test CFG_RememberTimed, 1 762 jz BME_ForgetMode 763 BME_RememberMode: 764 mov dl, Menu_EntryLast 765 BME_ForgetMode: 766 ; Got it, so display bar... 767 mov dh, dl 768 769 ;~ call SOUND_Beep 770 771 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active 772 773 ;~ call SOUND_Beep 774 775 call SOUND_PreBootMenu 776 777 778 BME_MainLoop: 779 780 ;call VideoIO_DBG_WriteString2 ; Rousseau 781 782 test TimedBootEnable, 1 783 jz BME_NoTimedBoot 784 ; ------------------------------------------------ TIMED BOOT 785 push ax 786 push dx 787 call TIMER_GetTicCount 788 mov dx, word ptr [TimedTimeOut] 789 sub dx, ax 790 mov ax, dx 791 call TIMER_TranslateTicToSec ; DX - Timertics till ByeBye 792 cmp al, TimedSecondLeft ; -> AL - Seconds till ByeBye 793 je BME_NoFixSecond 794 mov TimedSecondLeft, al 795 call BOOTMENU_BuildTimedBootText ; Display Timed-Boot-Text 796 BME_NoFixSecond: 797 cmp al, 0 798 jne BME_NoTimeOut 799 pop dx 800 pop ax 801 mov dl, Menu_EntryDefault 802 and CFG_TimedBootLast, 1 803 jz BME_TimedBootDefault 804 mov dl, Menu_EntryLast 805 BME_TimedBootDefault: 806 mov Menu_EntrySelected, dl ; Just boot default partition 807 mov TimedBootUsed, 1 ; set flag... 808 clc ; Boot-Now! 809 ret 810 811 BME_NoTimeOut: 812 pop dx 813 pop ax 814 BME_NoTimedBoot: 815 ; ------------------------------------------------ FLOPPY-NAME TIMER 816 test CFG_FloppyBootGetTimer, 1 817 jz BME_NoFloppyNameTimer 818 ; Wait 2 Seconds everytime 819 push ax 820 push dx 821 call TIMER_GetTicCount 822 cmp dx, wptr [FloppyGetNameTimer+2] 823 ja BME_ExpiredGetFloppy 824 cmp ax, wptr [FloppyGetNameTimer+0] 825 jb BME_NoFloppyNameExpired 826 BME_ExpiredGetFloppy: 827 call BOOTMENU_ResetGetFloppy 828 pop dx 829 pop ax 830 jmp BME_RefreshFloppyName 831 BME_NoFloppyNameExpired: 832 pop dx 833 pop ax 834 BME_NoFloppyNameTimer: 835 ; ------------------------------------------------ KEYBOARD 836 push dx 837 mov ah, 1 838 int 16h 839 pop dx 840 jnz BME_KeyAvailable 841 jmp BME_MainLoop 842 843 BME_RefreshFloppyName: 844 test CFG_IncludeFloppy, 1 845 jz BME_NoRefreshFloppyName 846 test CFG_FloppyBootGetName, 1 847 jz BME_NoRefreshFloppyName 848 call DriveIO_UpdateFloppyName 849 call BOOTMENU_RefreshPartitionText 850 call BOOTMENU_BuildChoiceBar ; Redisplay the selection-bar 851 BME_NoRefreshFloppyName: 852 jmp BME_MainLoop 853 854 BME_KeyAvailable: 855 push dx 856 mov ah, 0 857 int 16h 858 pop dx 859 cmp ah, Keys_ENTER 860 je BME_KeyEnter 861 cmp ah, Keys_F10 862 je BME_KeyF10 863 cmp ah, Keys_Delete 864 je BME_KeyDelete 865 cmp ah, Keys_ESC 866 je BME_KeyESC 867 ; Upper Keys do not fall under Timed Boot Key Handling 868 test TimedBootEnable, 1 869 je BME_NoTimedKeyHandling 870 cmp CFG_TimedKeyHandling, 1 871 jb BME_NoTimedKeyHandling ; = 0 872 je BME_ResetTimedBoot ; = 1 873 mov al, TimedBootEnable ; = 2 874 xor al, 1 ; Flip Flop Switch :] 875 mov TimedBootEnable, al 876 BME_ResetTimedBoot: 877 push dx 878 call BOOTMENU_ResetTimedBoot ; Reset Timer 879 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText 880 pop dx 881 BME_NoTimedKeyHandling: 882 cmp ah, Keys_TAB 883 je BME_KeyTAB 884 cmp ah, Keys_Up 885 je BME_KeyUp 886 cmp ah, Keys_Down 887 je BME_KeyDown 888 jmp BME_MainLoop 889 890 BME_KeyUp: 891 dec dh 892 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active 893 jmp BME_MainLoop 894 895 BME_KeyDown: 896 inc dh 897 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active 898 jmp BME_MainLoop 899 900 BME_KeyEnter: 901 mov Menu_EntrySelected, dl 902 mov TimedBootUsed, 0 ; reset flag... 903 clc ; Boot-Now! 904 ret 905 906 BME_KeyF10: 907 mov al, Keys_Flags_EnterSetup 908 mov SETUP_KeysOnEntry, al ; Simulate user wants to enter setup 909 stc ; Go Re-Enter Setup 910 ret 911 912 BME_KeyDelete: 913 call SOUND_ExecuteBoot 914 call APM_TurnOffComputer 915 jmp BME_MainLoop 916 917 BME_KeyESC: 918 mov al, TimedBootEnable 919 xor al, 1 ; Flip Flop Switch :] 920 mov TimedBootEnable, al 921 push dx 922 call BOOTMENU_ResetTimedBoot ; Reset Timer 923 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText 924 pop dx 925 jmp BME_MainLoop 926 927 BME_KeyTAB: 928 push dx 929 test CFG_CooperBars, 1 930 jnz BME_KeyTAB_ShowFX 931 mov ax, 0501h ; Go To Page 1 -> BIOS POST crap 932 int 10h 933 mov ah, 0 934 int 16h ; Wait for any key 935 call BOOTMENU_ResetTimedBoot ; Reset Timer 936 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText 937 mov ax, 0500h ; Go Back to Page 0 938 int 10h 939 pop dx 940 jmp BME_MainLoop 941 BME_KeyTAB_ShowFX: 942 pusha 943 mov ax, VideoIO_Page1 944 mov bx, VideoIO_Page0 945 mov dx, 160 946 xor di, di 947 call FX_InterleaveCopy 948 call FX_ScrollScreenLeft 949 mov ah, 0 950 int 16h ; Wait for any key 951 call BOOTMENU_ResetTimedBoot ; Reset Timer 952 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText 953 call FX_ScrollScreenRight 954 call FX_EndScreenInternalCleanUp 955 call BOOTMENU_ResetTimedBoot ; Reset Timer again... 956 popa 957 pop dx 958 jmp BME_MainLoop 956 959 BOOTMENU_Execute EndP 957 960 958 961 ; Resettet den TimedBoot Timer... 959 BOOTMENU_ResetTimedBoot 960 call TIMER_GetTicCount961 add ax, CFG_TimedDelay962 adc dx, 0963 mov wptr [TimedTimeOut], ax964 mov wptr [TimedTimeOut+2], dx965 ret966 BOOTMENU_ResetTimedBoot 962 BOOTMENU_ResetTimedBoot Proc Near Uses ax 963 call TIMER_GetTicCount 964 add ax, CFG_TimedDelay 965 adc dx, 0 966 mov wptr [TimedTimeOut], ax 967 mov wptr [TimedTimeOut+2], dx 968 ret 969 BOOTMENU_ResetTimedBoot EndP 967 970 968 971 ; Resettet den Floppy-Get-Name Timer... 969 BOOTMENU_ResetGetFloppy 970 call TIMER_GetTicCount971 add ax, 36 ; 18*2 -> 2 seconds972 adc dx, 0973 mov word ptr [FloppyGetNameTimer], ax974 mov word ptr [FloppyGetNameTimer+2], dx975 ret976 BOOTMENU_ResetGetFloppy 972 BOOTMENU_ResetGetFloppy Proc Near Uses ax 973 call TIMER_GetTicCount 974 add ax, 36 ; 18*2 -> 2 seconds 975 adc dx, 0 976 mov word ptr [FloppyGetNameTimer], ax 977 mov word ptr [FloppyGetNameTimer+2], dx 978 ret 979 BOOTMENU_ResetGetFloppy EndP -
trunk/BOOTCODE/REGULAR/CONV.ASM
r30 r43 36 36 ; Out: AX - two (Hex) Ascii digits 37 37 ; Destroyed: none 38 CONV_BinToAsc Proc Near39 movah,al ; Save value to process high nibble later40 andal,0fh ; Mask low nibble41 addal,'0' ; Convert to ASCII42 cmpal,'9' ; Is it in the range of '0' - '9' ?43 jbeCONV_BinToAsc_DecDigit_1 ; Yep, done44 addal,7 ; Nope, adjust to Hex Ascii45 CONV_BinToAsc_DecDigit_1:46 xchgal,ah ; Exchange with saved value to process high nibble47 shr al,4; Move high nibble to low nibble (80186+)48 ;shral49 ;shral50 ;shral51 addal,'0' ; Convert to ASCII52 cmpal,'9' ; Is it in the range of '0' - '9' ?53 jbeCONV_BinToAsc_DecDigit_254 addal,7 ; Nope, adjust to Hex Ascii55 CONV_BinToAsc_DecDigit_2:56 xchgal,ah ; Correct order, AX now contains the two (hex) digits57 ret58 CONV_BinToAsc Endp38 CONV_BinToAsc Proc Near 39 mov ah,al ; Save value to process high nibble later 40 and al,0fh ; Mask low nibble 41 add al,'0' ; Convert to ASCII 42 cmp al,'9' ; Is it in the range of '0' - '9' ? 43 jbe CONV_BinToAsc_DecDigit_1 ; Yep, done 44 add al,7 ; Nope, adjust to Hex Ascii 45 CONV_BinToAsc_DecDigit_1: 46 xchg al,ah ; Exchange with saved value to process high nibble 47 shr al,4 ; Move high nibble to low nibble (80186+) 48 ;shr al 49 ;shr al 50 ;shr al 51 add al,'0' ; Convert to ASCII 52 cmp al,'9' ; Is it in the range of '0' - '9' ? 53 jbe CONV_BinToAsc_DecDigit_2 54 add al,7 ; Nope, adjust to Hex Ascii 55 CONV_BinToAsc_DecDigit_2: 56 xchg al,ah ; Correct order, AX now contains the two (hex) digits 57 ret 58 CONV_BinToAsc Endp 59 59 60 60 … … 66 66 ; Out: AL - char printed (could be dot) 67 67 ; Destroyed: none 68 CONV_ConvertToPrintable Proc Near69 cmpal,20h70 jbCONV_ConvertToPrintable_NP ; Below space, so not printable71 cmpal,7eh ; Above tilde, so not printable72 jaCONV_ConvertToPrintable_NP73 jmpCONV_ConvertToPrintable_End ; Go output it74 CONV_ConvertToPrintable_NP:75 moval,ah ; Use the replacement character76 CONV_ConvertToPrintable_End:77 ret78 CONV_ConvertToPrintable EndP68 CONV_ConvertToPrintable Proc Near 69 cmp al,20h 70 jb CONV_ConvertToPrintable_NP ; Below space, so not printable 71 cmp al,7eh ; Above tilde, so not printable 72 ja CONV_ConvertToPrintable_NP 73 jmp CONV_ConvertToPrintable_End ; Go output it 74 CONV_ConvertToPrintable_NP: 75 mov al,ah ; Use the replacement character 76 CONV_ConvertToPrintable_End: 77 ret 78 CONV_ConvertToPrintable EndP 79 79 80 80 … … 90 90 ; ZF=1 if upper 32-bits are zero (LBA32) 91 91 ; Destroyed: none 92 CONV_CHS2LBA Proc Near93 localreq_cyl:dword94 localreq_head:word95 localreq_sec:word96 locallba:qword92 CONV_CHS2LBA Proc Near 93 local req_cyl:dword 94 local req_head:word 95 local req_sec:word 96 local lba:qword 97 97 98 ; Save parameters99 movword ptr [req_cyl],ax ; save low cyl100 movword ptr [req_cyl+2],dx ; save high cyl101 mov[req_head],bx ; save head102 testcx,cx103 jnzCONV_CHS2LBA_sec_ok104 movcx,1 ; cannot have sector 0, so change to 1105 CONV_CHS2LBA_sec_ok:106 deccx ; prepare for calculation later107 mov[req_sec],cx ; save sec98 ; Save parameters 99 mov word ptr [req_cyl],ax ; save low cyl 100 mov word ptr [req_cyl+2],dx ; save high cyl 101 mov [req_head],bx ; save head 102 test cx,cx 103 jnz CONV_CHS2LBA_sec_ok 104 mov cx,1 ; cannot have sector 0, so change to 1 105 CONV_CHS2LBA_sec_ok: 106 dec cx ; prepare for calculation later 107 mov [req_sec],cx ; save sec 108 108 109 ; Clear return value110 xorax,ax111 movword ptr [lba+6],ax112 movword ptr [lba+4],ax113 movword ptr [lba+2],ax114 movword ptr [lba+0],ax109 ; Clear return value 110 xor ax,ax 111 mov word ptr [lba+6],ax 112 mov word ptr [lba+4],ax 113 mov word ptr [lba+2],ax 114 mov word ptr [lba+0],ax 115 115 116 ; Cyls * Heads117 movdx,word ptr [req_cyl+2] ; high word of requested cylinder118 movax,word ptr [req_cyl+0] ; low word of requested cylinder119 xorbx,bx ; zero for 32-bit math120 movcx,word ptr [BIOS_Heads] ; number of heads121 callMATH_Mul32116 ; Cyls * Heads 117 mov dx,word ptr [req_cyl+2] ; high word of requested cylinder 118 mov ax,word ptr [req_cyl+0] ; low word of requested cylinder 119 xor bx,bx ; zero for 32-bit math 120 mov cx,word ptr [BIOS_Heads] ; number of heads 121 call MATH_Mul32 122 122 123 ; WE DISCARD HIGH 32-BITS HERE BECAUSE CALCULATION124 ; WOULD REQUIRE 64-bits MATH.125 ; THIS WILL BE FIXED LATER.126 ; THIS MEANS LBA >2TiB IS NOT SUPPORTED YET.123 ; WE DISCARD HIGH 32-BITS HERE BECAUSE CALCULATION 124 ; WOULD REQUIRE 64-bits MATH. 125 ; THIS WILL BE FIXED LATER. 126 ; THIS MEANS LBA >2TiB IS NOT SUPPORTED YET. 127 127 128 ; Add requested head129 addax,[req_head]130 adcdx,0131 ;adccx,0132 ;adcbx,0128 ; Add requested head 129 add ax,[req_head] 130 adc dx,0 131 ;adc cx,0 132 ;adc bx,0 133 133 134 ; * Secs135 xorbx,bx136 mov cx,word ptr [TrueSecs]137 callMATH_Mul32134 ; * Secs 135 xor bx,bx 136 mov cx,word ptr [TrueSecs] ; Implicitly address disk 80h 137 call MATH_Mul32 138 138 139 ; Add requested sec140 addax,[req_sec]141 adcdx,0142 ;adccx,0143 ;adcbx,0139 ; Add requested sec 140 add ax,[req_sec] 141 adc dx,0 142 ;adc cx,0 143 ;adc bx,0 144 144 145 xorbx,bx146 xorcx,cx145 xor bx,bx 146 xor cx,cx 147 147 148 ; Set ZF if high upper 32-bits are zero149 orbx,cx148 ; Set ZF if high upper 32-bits are zero 149 or bx,cx 150 150 151 151 ret 152 CONV_CHS2LBA EndP152 CONV_CHS2LBA EndP 153 153 154 154 155 CONV_LBA2CYLS Proc Near 155 CONV_LBA2CYLS Proc Near 156 ret 157 CONV_LBA2CYLS Endp 156 158 157 159 158 ret159 CONV_LBA2CYLS Endp160 161 160 ; Convert a character to upper-case 162 CONV_ToUpper Proc Near163 cmpal,'a'164 jbCONV_ToUpperSkip1165 cmpal,'z'166 jaCONV_ToUpperSkip1167 subal,20h168 CONV_ToUpperSkip1:169 ret161 CONV_ToUpper Proc Near 162 cmp al,'a' 163 jb CONV_ToUpperSkip1 164 cmp al,'z' 165 ja CONV_ToUpperSkip1 166 sub al,20h 167 CONV_ToUpperSkip1: 168 ret 170 169 CONV_ToUpper EndP -
trunk/BOOTCODE/REGULAR/DEBUG.ASM
r30 r43 36 36 ENDIF 37 37 38 39 40 ; Initialize the com-port 41 ; In: AL - com-port, 0=disable com-port logging, 1=com1 etc. (max 4) 42 ; AH - initialization parameters (see below) 43 ; Out: AX - line status 44 DEBUG_Dump1 Proc Near 45 pushf 46 pusha 47 48 ; Hello message 49 mov si, offset AuxIOHello 50 call AuxIO_Print 51 52 ; Build Date 53 mov si, offset BUILD_DATE 54 call AuxIO_Print 55 56 ; Start new line 57 call AuxIO_TeletypeNL 58 Call AuxIO_TeletypeNL 59 60 ; Msg check math-module 61 mov si,offset db_checkmath 62 call AuxIO_Print 63 64 ; Output hex-word 65 mov ax,0BABEh 66 call AuxIO_TeletypeHexWord 67 68 mov al,' ' 69 call AuxIO_Teletype 70 mov al,'*' 71 call AuxIO_Teletype 72 mov al,' ' 73 call AuxIO_Teletype 74 75 ; Output hex-word 76 mov ax,0BABEh 77 call AuxIO_TeletypeHexWord 78 79 mov al,' ' 80 call AuxIO_Teletype 81 mov al,'=' 82 call AuxIO_Teletype 83 mov al,' ' 84 call AuxIO_Teletype 85 86 mov ax,0BABEh 87 mul ax 88 call AuxIO_TeletypeHexDWord 89 90 ; Start new line 91 call AuxIO_TeletypeNL 92 93 94 ; Output hex-dword 95 mov dx,0DEADh 96 mov ax,0FACEh 97 call AuxIO_TeletypeHexDWord 98 99 mov al,' ' 100 call AuxIO_Teletype 101 mov al,'*' 102 call AuxIO_Teletype 103 mov al,' ' 104 call AuxIO_Teletype 105 106 ; Output hex-dword 107 mov dx,0DEADh 108 mov ax,0FACEh 109 call AuxIO_TeletypeHexDWord 110 111 mov al,' ' 112 call AuxIO_Teletype 113 mov al,'=' 114 call AuxIO_Teletype 115 mov al,' ' 116 call AuxIO_Teletype 117 118 119 120 mov bx,0DEADh 121 mov cx,0FACEh 122 mov dx,0DEADh 123 mov ax,0FACEh 124 call MATH_Mul32 125 call AuxIO_TeletypeHexQWord 126 127 128 ; Start new line 129 call AuxIO_TeletypeNL 130 131 132 ; Start new line 133 call AuxIO_TeletypeNL 134 135 136 ; BIOS cyls 137 ; mov dx,word ptr [BIOS_Cyls+02] 138 ; mov ax,word ptr [BIOS_Cyls+00] 139 ; call AuxIO_TeletypeHexDWord 140 ; call AuxIO_TeletypeNL 141 142 ; BIOS heads 143 ; mov dx,word ptr [BIOS_Heads+02] 144 ; mov ax,word ptr [BIOS_Heads+00] 145 ; call AuxIO_TeletypeHexDWord 146 ; call AuxIO_TeletypeNL 147 148 ; BIOS secs 149 ; mov dx,word ptr [BIOS_Secs+02] 150 ; mov ax,word ptr [BIOS_Secs+00] 151 ; call AuxIO_TeletypeHexDWord 152 ; call AuxIO_TeletypeNL 153 154 ; Bytes per sector 155 ; mov ax,[BIOS_Bytes] 156 ; call AuxIO_TeletypeHexWord 157 ; call AuxIO_TeletypeNL 158 159 ; Total secs 160 ; mov bx, word ptr [BIOS_TotalSecs+06] 161 ; mov cx, word ptr [BIOS_TotalSecs+04] 162 ; mov dx, word ptr [BIOS_TotalSecs+02] 163 ; mov ax, word ptr [BIOS_TotalSecs+00] 164 ; call AuxIO_TeletypeHexDWord 165 ; call AuxIO_TeletypeNL 166 167 ; CHS to LBA 168 ; mov dx,1 169 ; mov ax,29e5h 170 ; mov bx,23h 171 ; mov cx,9h 172 ; call CONV_CHS2LBA 173 ; call AuxIO_TeletypeHexDWord 174 ; call AuxIO_TeletypeNL 175 176 177 popa 178 popf 179 ret 180 DEBUG_Dump1 EndP 181 182 183 184 ;DEBUG_Dump2 Proc Near 185 ; pushf 186 ; pusha 187 188 189 ; call AuxIO_TeletypeNL 190 ; call AuxIO_TeletypeNL 191 192 193 ; mov si,offset db_config 194 ; call AuxIO_Print 195 196 ; mov si,offset db_cfgparts 197 ; call AuxIO_Print 198 ; mov al,[CFG_Partitions] 199 ; call AuxIO_TeletypeHexByte 200 ; call AuxIO_TeletypeNL 201 202 ; mov si,offset db_cfgpartdef 203 ; call AuxIO_Print 204 ; mov al,[CFG_PartDefault] 205 ; call AuxIO_TeletypeHexByte 206 ; call AuxIO_TeletypeNL 207 208 ; mov si,offset db_cfgpartlast 209 ; call AuxIO_Print 210 ; mov al,[CFG_PartLast] 211 ; call AuxIO_TeletypeHexByte 212 ; call AuxIO_TeletypeNL 213 ; call AuxIO_TeletypeNL 214 215 216 217 ; mov si,offset db_vars 218 ; call AuxIO_Print 219 220 ; mov si,offset db_newpart 221 ; call AuxIO_Print 222 ; mov si,offset NewPartTable 223 ; call AuxIO_DumpSector 224 ; call AuxIO_TeletypeNL 225 ; add si,512 226 ; call AuxIO_DumpSector 227 ; call AuxIO_TeletypeNL 228 ; call AuxIO_TeletypeNL 229 230 ; mov si,offset db_newhide 231 ; call AuxIO_Print 232 ; mov si,offset NewHidePartTable 233 ; call AuxIO_DumpSector 234 ; call AuxIO_TeletypeNL 235 ; add si,512 236 ; call AuxIO_DumpSector 237 ; call AuxIO_TeletypeNL 238 ; call AuxIO_TeletypeNL 239 240 ; mov si,offset db_dletters 241 ; call AuxIO_Print 242 ; mov si,offset NewDriveLetters 243 ; call AuxIO_DumpParagraph 244 ; call AuxIO_TeletypeNL 245 ; add si,16 246 ; call AuxIO_DumpParagraph 247 ; call AuxIO_TeletypeNL 248 ; call AuxIO_TeletypeNL 249 250 ; mov si,offset db_tmpec 251 ; call AuxIO_Print 252 ; mov si,offset TmpSector 253 ; call AuxIO_DumpSector 254 ; call AuxIO_TeletypeNL 255 ; call AuxIO_TeletypeNL 256 257 ; mov si,offset db_partsec 258 ; call AuxIO_Print 259 ; mov si,offset PartitionSector 260 ; call AuxIO_DumpSector 261 ; call AuxIO_TeletypeNL 262 ; call AuxIO_TeletypeNL 263 264 ; popa 265 ; popf 266 ; ret 267 ;DEBUG_Dump2 EndP 268 269 270 271 db_mbr: db "## MBR ##",10,0 272 db_masterlvm: db "## MLVMR ##",10,0 273 274 db_checkmath: db "## CHK MATH ##",10,0 275 276 277 db_config: db '## CFG (DMP2) ##',10,0 278 db_cfgparts: db 'CFG_Partitions:',0 279 db_cfgpartdef: db 'CFG_PartDefault:',0 280 db_cfgpartlast: db 'CFG_PartLast:',0 281 282 283 db_vars: db '## VARS ##',10,0 284 db_partsec: db 'PartitionSector:',10,0 285 ;db_lvmsec: db 'LVMSector :',10,0 286 db_tmpec: db 'TmpSector :',10,0 287 288 db_newpart: db 'NewPartTable :',10,0 289 db_newhide: db 'NewHideTable:',10,0 290 db_dletters: db 'NewDriveLetters:',10,0 291 292 ;db_partsize: db 'PartitionSizeTable:',10,0 293 ;db_partpoint: db 'PartitionPointers:',10,0 294 ;db_partpointcnt: db 'PartitionPointerCount:',0 295 ;db_partxref: db 'PartitionXref:',10,0 296 ;db_partvoldl: db 'PartitionVolumeLetters:',10,0 297 298 ;db_totaldisks: db 'TotalHarddiscs:',0 299 ;db_lbaswitchtab: db 'LBASwitchTable:',10,0 300 ;db_newparts: db 'NewPartitions:',0 301 302 ;db_exabspos: db 'ExtendedAbsPos:',0 303 ;db_exabsposset: db 'ExtendedAbsPosSet:',0 304 305 db_curpartloc: db 'CurPartition_Location:',0 306 ;db_curiox: db 'CurIO_UseExtension:',0 307 308 db_curlvmsec: db 'Current LVM Sector:',0 38 DEBUG_CheckMath Proc Near 39 pushf 40 pusha 41 42 ; Msg check math-module 43 mov si,offset db_checkmath 44 call AuxIO_Print 45 46 ; Output hex-word 47 mov ax,0BABEh 48 call AuxIO_TeletypeHexWord 49 50 mov al,' ' 51 call AuxIO_Teletype 52 mov al,'*' 53 call AuxIO_Teletype 54 mov al,' ' 55 call AuxIO_Teletype 56 57 ; Output hex-word 58 mov ax,0BABEh 59 call AuxIO_TeletypeHexWord 60 61 mov al,' ' 62 call AuxIO_Teletype 63 mov al,'=' 64 call AuxIO_Teletype 65 mov al,' ' 66 call AuxIO_Teletype 67 68 mov ax,0BABEh 69 mul ax 70 call AuxIO_TeletypeHexDWord 71 72 ; Start new line 73 call AuxIO_TeletypeNL 74 75 ; Output hex-dword 76 mov dx,0DEADh 77 mov ax,0FACEh 78 call AuxIO_TeletypeHexDWord 79 80 mov al,' ' 81 call AuxIO_Teletype 82 mov al,'*' 83 call AuxIO_Teletype 84 mov al,' ' 85 call AuxIO_Teletype 86 87 ; Output hex-dword 88 mov dx,0DEADh 89 mov ax,0FACEh 90 call AuxIO_TeletypeHexDWord 91 92 mov al,' ' 93 call AuxIO_Teletype 94 mov al,'=' 95 call AuxIO_Teletype 96 mov al,' ' 97 call AuxIO_Teletype 98 99 mov bx,0DEADh 100 mov cx,0FACEh 101 mov dx,0DEADh 102 mov ax,0FACEh 103 call MATH_Mul32 104 call AuxIO_TeletypeHexQWord 105 106 ; Start new line 107 call AuxIO_TeletypeNL 108 109 ;~ ; Start new line 110 call AuxIO_TeletypeNL 111 112 popa 113 popf 114 115 ret 116 DEBUG_CheckMath EndP 117 118 119 DEBUG_DumpGeo Proc 120 pushf 121 pusha 122 123 ; BIOS cyls 124 mov dx,word ptr [BIOS_Cyls+02] 125 mov ax,word ptr [BIOS_Cyls+00] 126 call AuxIO_TeletypeHexDWord 127 call AuxIO_TeletypeNL 128 129 ; BIOS heads 130 mov dx,word ptr [BIOS_Heads+02] 131 mov ax,word ptr [BIOS_Heads+00] 132 call AuxIO_TeletypeHexDWord 133 call AuxIO_TeletypeNL 134 135 ; BIOS secs 136 mov dx,word ptr [BIOS_Secs+02] 137 mov ax,word ptr [BIOS_Secs+00] 138 call AuxIO_TeletypeHexDWord 139 call AuxIO_TeletypeNL 140 141 ; Bytes per sector 142 mov ax,[BIOS_Bytes] 143 call AuxIO_TeletypeHexWord 144 call AuxIO_TeletypeNL 145 146 ; Total secs 147 mov bx, word ptr [BIOS_TotalSecs+06] 148 mov cx, word ptr [BIOS_TotalSecs+04] 149 mov dx, word ptr [BIOS_TotalSecs+02] 150 mov ax, word ptr [BIOS_TotalSecs+00] 151 call AuxIO_TeletypeHexDWord 152 call AuxIO_TeletypeNL 153 154 ; CHS to LBA 155 mov dx,1 156 mov ax,29e5h 157 mov bx,23h 158 mov cx,9h 159 call CONV_CHS2LBA 160 call AuxIO_TeletypeHexDWord 161 call AuxIO_TeletypeNL 162 163 popa 164 popf 165 166 ret 167 DEBUG_DumpGeo Endp 168 169 ; 170 ; Dump information before the menu is displayed. 171 ; 172 DEBUG_Dump1 Proc Near 173 pushf 174 pusha 175 176 ; Hello message 177 mov si, offset AuxIOHello 178 call AuxIO_Print 179 180 ; Build Date 181 mov si, offset BUILD_DATE 182 call AuxIO_Print 183 184 ; Start new line 185 call AuxIO_TeletypeNL 186 call AuxIO_TeletypeNL 187 188 ;~ call DEBUG_CheckMath 189 190 ;~ call DEBUG_DumpGeo 191 192 193 194 popa 195 popf 196 ret 197 DEBUG_Dump1 EndP 198 199 200 DEBUG_DumpBSSSectors Proc Near 201 pushf 202 pusha 203 204 mov si, offset [PartitionSector] 205 call AuxIO_DumpSector 206 call AuxIO_TeletypeNL 207 208 mov si, offset [JfsPBR] 209 call AuxIO_DumpSector 210 call AuxIO_TeletypeNL 211 212 mov si, offset [LVMSector] 213 call AuxIO_DumpSector 214 call AuxIO_TeletypeNL 215 216 mov si, offset [TmpSector] 217 call AuxIO_DumpSector 218 call AuxIO_TeletypeNL 219 220 mov si, offset [NewPartTable] 221 call AuxIO_DumpSector 222 call AuxIO_TeletypeNL 223 call AuxIO_TeletypeNL 224 225 popa 226 popf 227 ret 228 229 230 DEBUG_DumpBSSSectors EndP 231 232 233 234 235 ; 236 ; Dump information before the partition is booted. 237 ; 238 DEBUG_Dump2 Proc Near 239 pushf 240 pusha 241 242 243 call AuxIO_TeletypeNL 244 call AuxIO_TeletypeNL 245 246 247 mov si,offset db_config 248 call AuxIO_Print 249 250 mov si,offset db_cfgparts 251 call AuxIO_Print 252 mov al,[CFG_Partitions] 253 call AuxIO_TeletypeHexByte 254 call AuxIO_TeletypeNL 255 256 mov si,offset db_cfgpartdef 257 call AuxIO_Print 258 mov al,[CFG_PartDefault] 259 call AuxIO_TeletypeHexByte 260 call AuxIO_TeletypeNL 261 262 mov si,offset db_cfgpartlast 263 call AuxIO_Print 264 mov al,[CFG_PartLast] 265 call AuxIO_TeletypeHexByte 266 call AuxIO_TeletypeNL 267 call AuxIO_TeletypeNL 268 269 270 271 mov si,offset db_vars 272 call AuxIO_Print 273 274 mov si,offset db_newpart 275 call AuxIO_Print 276 mov si,offset NewPartTable 277 call AuxIO_DumpSector 278 call AuxIO_TeletypeNL 279 add si,512 280 call AuxIO_DumpSector 281 call AuxIO_TeletypeNL 282 call AuxIO_TeletypeNL 283 284 mov si,offset db_newhide 285 call AuxIO_Print 286 mov si,offset NewHidePartTable 287 call AuxIO_DumpSector 288 call AuxIO_TeletypeNL 289 add si,512 290 call AuxIO_DumpSector 291 call AuxIO_TeletypeNL 292 call AuxIO_TeletypeNL 293 294 mov si,offset db_dletters 295 call AuxIO_Print 296 mov si,offset NewDriveLetters 297 call AuxIO_DumpParagraph 298 call AuxIO_TeletypeNL 299 add si,16 300 call AuxIO_DumpParagraph 301 call AuxIO_TeletypeNL 302 call AuxIO_TeletypeNL 303 304 mov si,offset db_tmpec 305 call AuxIO_Print 306 mov si,offset TmpSector 307 call AuxIO_DumpSector 308 call AuxIO_TeletypeNL 309 call AuxIO_TeletypeNL 310 311 mov si,offset db_partsec 312 call AuxIO_Print 313 mov si,offset PartitionSector 314 call AuxIO_DumpSector 315 call AuxIO_TeletypeNL 316 call AuxIO_TeletypeNL 317 318 popa 319 popf 320 ret 321 DEBUG_Dump2 EndP 322 323 324 325 db_mbr db "## MBR ##",10,0 326 db_masterlvm db "## MLVMR ##",10,0 327 328 db_checkmath db "## CHK MATH ##",10,0 329 330 331 db_config db '## CFG (DMP2) ##',10,0 332 db_cfgparts db 'CFG_Partitions:',0 333 db_cfgpartdef db 'CFG_PartDefault:',0 334 db_cfgpartlast db 'CFG_PartLast:',0 335 336 337 db_vars db '## VARS ##',10,0 338 db_partsec db 'PartitionSector:',10,0 339 ;db_lvmsec db 'LVMSector :',10,0 340 db_tmpec db 'TmpSector :',10,0 341 342 db_newpart db 'NewPartTable :',10,0 343 db_newhide db 'NewHideTable:',10,0 344 db_dletters db 'NewDriveLetters:',10,0 345 346 ;db_partsize db 'PartitionSizeTable:',10,0 347 ;db_partpoint db 'PartitionPointers:',10,0 348 ;db_partpointcnt db 'PartitionPointerCount:',0 349 ;db_partxref db 'PartitionXref:',10,0 350 ;db_partvoldl db 'PartitionVolumeLetters:',10,0 351 352 ;db_totaldisks db 'TotalHarddiscs:',0 353 ;db_lbaswitchtab db 'LBASwitchTable:',10,0 354 ;db_newparts db 'NewPartitions:',0 355 356 ;db_exabspos db 'ExtendedAbsPos:',0 357 ;db_exabsposset db 'ExtendedAbsPosSet:',0 358 359 db_curpartloc db 'CurPartition_Location:',0 360 ;db_curiox db 'CurIO_UseExtension:',0 361 362 db_curlvmsec db 'Current LVM Sector:',0 363 -
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r40 r43 35 35 ; Will only load base-configuration, will NOT load IPT nor Hide-Config 36 36 ; Those are originally loaded on startup and will NOT get reloaded. 37 DriveIO_LoadConfiguration 38 mov ax, cs39 mov es, ax40 mov bx, offset Configuration41 mov dx, 0080h ; First harddrive, Sector 55...42 mov cx, 0037h43 mov ax, 0201h ; Function 02, read 1 sector...44 int 13h45 jnc DIOLC_NoError46 call MBR_LoadError ; Will Abort BootUp47 DIOLC_NoError:48 ret49 DriveIO_LoadConfiguration 50 51 DriveIO_SaveConfiguration 52 mov ax, cs53 mov ds, ax54 mov es, ax ; Safety first (CS==DS==ES)55 ; --- Overwrite Floppy-Name with "FloppyDrive"56 mov si, offset TXT_Floppy_Drive57 mov di, offset PartitionTable58 sub di, 30 ; Adjust to Floppy-Name59 mov cx, 1160 rep movsb61 mov si, offset Configuration ; Calculate new checksum62 xor bx, bx63 64 ; Changed from 5 to calculated value (not here, see compat. issue below)65 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"66 ; Size of the ab-configuration in 512 byte sectors67 ;mov cx, (MBR_BackUpMBR - Configuration) / 200h68 69 ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum.70 ; AB v1.0.8 *should* stores a 7 sector configuration with a71 ; 7 sector checksum.72 ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.873 ; config as corrupted, while this is not the case.74 ; So, for compatibility reasons, in v1.0.8, the checksum stored is over75 ; 5 sectors, to be compatible with v1.07.76 ; This may change (be corrected) in future versions !77 mov cx,578 79 mov dx, [CFG_CheckConfig]80 mov [CFG_CheckConfig], bx81 DIOSC_Loop:82 call MBR_GetCheckOfSector83 loop DIOSC_Loop84 mov [CFG_CheckConfig], bx85 ; --------------------------------------------------------------------86 ; ES == CS87 mov bx, offset Configuration88 mov dx, 0080h ; First harddrive, Sector 55...89 mov cx, 0037h90 91 ; Changed from 5 to calculated value92 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"93 ; Size of the ab-configuration in 512 byte sectors94 mov al, (MBR_BackUpMBR - Configuration) / 200h95 mov ah,03h96 97 int 13h98 jnc DIOSC_NoError99 call MBR_SaveError ; Will Abort BootUp100 DIOSC_NoError:101 ret102 DriveIO_SaveConfiguration 103 104 DriveIO_UpdateFloppyName 105 mov ax, cs106 mov ds, ax107 mov es, ax108 109 mov ah, 00h ; Function 2 - Reset Drive110 xor dl, dl111 int 13h112 xor dx, dx ; Cylinder=0, Head=0113 mov cx, 1 ; Sector=1, Drive=0114 mov bx, offset TmpSector ; ES:BX - TmpSector115 mov ax, 0201h ; Function 2 - Load Sector116 int 13h117 jnc DIOUFN_AllFine118 119 ; --- Overwrite Floppy-Name with "No Disc"120 mov si, offset TXT_Floppy_NoDisc121 xor ax, ax122 DIOUFN_WriteFloppyName:123 mov di, offset PartitionTable124 sub di, 30 ; Adjust to Floppy-Name125 mov cl, 11126 rep movsb127 ret ; AX=-1 -> GotDisc, =0 -> NoDisc128 129 ; --- Floppy found and read, data in TempSector130 DIOUFN_AllFine:131 mov ax, -1132 mov si, offset TXT_Floppy_NoName133 cmp wptr es:[bx+54], 'AF'134 jne DIOUFN_WriteFloppyName135 cmp wptr es:[bx+56], '1T'136 jne DIOUFN_WriteFloppyName137 cmp bptr es:[bx+58], '2'138 jne DIOUFN_WriteFloppyName139 mov si, bx140 add si, 43 ; FAT12 - Volume Label Location141 jmp DIOUFN_WriteFloppyName142 DriveIO_UpdateFloppyName 37 DriveIO_LoadConfiguration Proc Near Uses ax bx cx dx es 38 mov ax, cs 39 mov es, ax 40 mov bx, offset Configuration 41 mov dx, 0080h ; First harddrive, Sector 55... 42 mov cx, 0037h 43 mov ax, 0201h ; Function 02, read 1 sector... 44 int 13h 45 jnc DIOLC_NoError 46 call MBR_LoadError ; Will Abort BootUp 47 DIOLC_NoError: 48 ret 49 DriveIO_LoadConfiguration EndP 50 51 DriveIO_SaveConfiguration Proc Near Uses ax bx cx dx ds es si 52 mov ax, cs 53 mov ds, ax 54 mov es, ax ; Safety first (CS==DS==ES) 55 ; --- Overwrite Floppy-Name with "FloppyDrive" 56 mov si, offset TXT_Floppy_Drive 57 mov di, offset PartitionTable 58 sub di, 30 ; Adjust to Floppy-Name 59 mov cx, 11 60 rep movsb 61 mov si, offset Configuration ; Calculate new checksum 62 xor bx, bx 63 64 ; Changed from 5 to calculated value (not here, see compat. issue below) 65 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 66 ; Size of the ab-configuration in 512 byte sectors 67 ;mov cx, (MBR_BackUpMBR - Configuration) / 200h 68 69 ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum. 70 ; AB v1.0.8 *should* stores a 7 sector configuration with a 71 ; 7 sector checksum. 72 ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8 73 ; config as corrupted, while this is not the case. 74 ; So, for compatibility reasons, in v1.0.8, the checksum stored is over 75 ; 5 sectors, to be compatible with v1.07. 76 ; This may change (be corrected) in future versions ! 77 mov cx,5 78 79 mov dx, [CFG_CheckConfig] 80 mov [CFG_CheckConfig], bx 81 DIOSC_Loop: 82 call MBR_GetCheckOfSector 83 loop DIOSC_Loop 84 mov [CFG_CheckConfig], bx 85 ; -------------------------------------------------------------------- 86 ; ES == CS 87 mov bx, offset Configuration 88 mov dx, 0080h ; First harddrive, Sector 55... 89 mov cx, 0037h 90 91 ; Changed from 5 to calculated value 92 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 93 ; Size of the ab-configuration in 512 byte sectors 94 mov al, (MBR_BackUpMBR - Configuration) / 200h 95 mov ah,03h 96 97 int 13h 98 jnc DIOSC_NoError 99 call MBR_SaveError ; Will Abort BootUp 100 DIOSC_NoError: 101 ret 102 DriveIO_SaveConfiguration EndP 103 104 DriveIO_UpdateFloppyName Proc Near Uses bx cx dx ds si es di 105 mov ax, cs 106 mov ds, ax 107 mov es, ax 108 109 mov ah, 00h ; Function 2 - Reset Drive 110 xor dl, dl 111 int 13h 112 xor dx, dx ; Cylinder=0, Head=0 113 mov cx, 1 ; Sector=1, Drive=0 114 mov bx, offset TmpSector ; ES:BX - TmpSector 115 mov ax, 0201h ; Function 2 - Load Sector 116 int 13h 117 jnc DIOUFN_AllFine 118 119 ; --- Overwrite Floppy-Name with "No Disc" 120 mov si, offset TXT_Floppy_NoDisc 121 xor ax, ax 122 DIOUFN_WriteFloppyName: 123 mov di, offset PartitionTable 124 sub di, 30 ; Adjust to Floppy-Name 125 mov cl, 11 126 rep movsb 127 ret ; AX=-1 -> GotDisc, =0 -> NoDisc 128 129 ; --- Floppy found and read, data in TempSector 130 DIOUFN_AllFine: 131 mov ax, -1 132 mov si, offset TXT_Floppy_NoName 133 cmp wptr es:[bx+54], 'AF' 134 jne DIOUFN_WriteFloppyName 135 cmp wptr es:[bx+56], '1T' 136 jne DIOUFN_WriteFloppyName 137 cmp bptr es:[bx+58], '2' 138 jne DIOUFN_WriteFloppyName 139 mov si, bx 140 add si, 43 ; FAT12 - Volume Label Location 141 jmp DIOUFN_WriteFloppyName 142 DriveIO_UpdateFloppyName EndP 143 143 144 144 ; ============================================================================= … … 152 152 ; Internal access (to AiR-BOOT) is always done via INT 13h/CHS. 153 153 154 DriveIO_GetHardDriveCount 155 push ds156 push si157 push 0040h158 pop ds159 mov si, 0075h160 mov dh, ds:[si] ; 40:75 -> POST: Total Harddiscs == DL161 pop si162 pop ds163 mov TotalHarddiscs, dh164 ret165 DriveIO_GetHardDriveCount 154 DriveIO_GetHardDriveCount Proc Near Uses ds si 155 push ds 156 push si 157 push 0040h 158 pop ds 159 mov si, 0075h 160 mov dh, ds:[si] ; 40:75 -> POST: Total Harddiscs == DL 161 pop si 162 pop ds 163 mov TotalHarddiscs, dh 164 ret 165 DriveIO_GetHardDriveCount EndP 166 166 167 167 … … 170 170 ; This is calculated by Sector*Heads. Comparing will get done with Bit 25-10 171 171 ; on LBA sectors, so we actually divide sector number by 1024. 172 DriveIO_InitLBASwitchTable 173 mov di, offset LBASwitchTable174 mov dh, TotalHarddiscs175 mov dl, 80h176 DIOILUT_DriveLoop:177 push dx178 push di179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 pop di196 pop dx197 mov bptr ds:[di], ah ; Save that value198 inc di ; Go to next BYTE199 inc dl200 dec dh201 jnz DIOILUT_DriveLoop202 ret203 DriveIO_InitLBASwitchTable 172 DriveIO_InitLBASwitchTable Proc Near Uses es di 173 mov di, offset LBASwitchTable 174 mov dh, TotalHarddiscs 175 mov dl, 80h 176 DIOILUT_DriveLoop: 177 push dx 178 push di 179 mov ah, 08h 180 int 13h ; DISK - GET DRIVE PARAMETERS 181 mov ah, 0FBh ; Assume 255 heads/63 sectors, if error 182 jc DIOILUT_Error 183 and cl, 111111b ; Isolate lower 6 bits of CL -> sector count 184 185 ;movzx ax, cl 186 mov al,cl 187 mov ah,0 188 189 mov bl, dh ; DH -> max head number 190 mul bl ; AX = Sectors*Heads 191 shl ah, 1 192 shl ah, 1 ; Shift 2 bits, so we are able to compare to 193 ; bit 16-23 of the LBA address 194 DIOILUT_Error: 195 pop di 196 pop dx 197 mov bptr ds:[di], ah ; Save that value 198 inc di ; Go to next BYTE 199 inc dl 200 dec dh 201 jnz DIOILUT_DriveLoop 202 ret 203 DriveIO_InitLBASwitchTable EndP 204 204 205 205 … … 212 212 DriveIO_LVMAdjustToInfoSector Proc Near 213 213 214 215 216 ; pusha 217 ; call AuxIO_TeletypeNL 218 219 ; LBA 220 ; xchg dx,bx 221 ; call AuxIO_TeletypeHexDWord 222 ; call AuxIO_TeletypeNL 223 ; xchg bx,dx 224 225 ; CYL 226 ; mov al,ch 227 ; call AuxIO_TeletypeHexByte 228 ; call AuxIO_TeletypeNL 229 230 ; HEAD 231 ; mov al,dh 232 ; call AuxIO_TeletypeHexByte 233 ; call AuxIO_TeletypeNL 234 235 ; SEC 236 ; mov al,cl 237 ; call AuxIO_TeletypeHexByte 238 ; call AuxIO_TeletypeNL 239 240 ; DRIVE 241 ; mov al,dl 242 ; call AuxIO_TeletypeHexByte 243 ; call AuxIO_TeletypeNL 244 245 ; popa 246 247 248 ;local ts:word 249 ;local ts2:word 250 251 pusha 252 253 ; Dump drive 254 mov si,offset drive 255 ; call AuxIO_Print 256 xchg al,dl 257 ; call AuxIO_TeletypeHexByte 258 ; call AuxIO_TeletypeNL 259 xchg dl,al 260 261 ; Dump SPT 262 mov si,offset spt_used 263 ; call AuxIO_Print 264 push dx 265 push bx 214 ;~ pusha 215 ;~ call AuxIO_TeletypeNL 216 ;~ 217 ;~ ; LBA 218 ;~ xchg dx,bx 219 ;~ call AuxIO_TeletypeHexDWord 220 ;~ call AuxIO_TeletypeNL 221 ;~ xchg bx,dx 222 ;~ 223 ;~ ; CYL 224 ;~ mov al,ch 225 ;~ call AuxIO_TeletypeHexByte 226 ;~ call AuxIO_TeletypeNL 227 ;~ 228 ;~ ; HEAD 229 ;~ mov al,dh 230 ;~ call AuxIO_TeletypeHexByte 231 ;~ call AuxIO_TeletypeNL 232 ;~ 233 ;~ ; SEC 234 ;~ mov al,cl 235 ;~ call AuxIO_TeletypeHexByte 236 ;~ call AuxIO_TeletypeNL 237 ;~ 238 ;~ ; DRIVE 239 ;~ mov al,dl 240 ;~ call AuxIO_TeletypeHexByte 241 ;~ call AuxIO_TeletypeNL 242 ;~ popa 243 ;~ 244 ;~ ;local ts:word 245 ;~ ;local ts2:word 246 247 pusha 248 249 ; Dump drive 250 mov si,offset drive 251 ;call AuxIO_Print 252 xchg al,dl 253 ;call AuxIO_TeletypeHexByte 254 ;call AuxIO_TeletypeNL 255 xchg dl,al 256 257 ; Dump SPT 258 mov si,offset spt_used 259 ;call AuxIO_Print 260 push dx 261 push bx 262 xor dh,dh 263 and dl,01111111b 264 shl dx,1 265 shl dx,1 266 mov bx, offset TrueSecs 267 add bx,dx 268 mov ax,word ptr [bx] 269 ;mov [ts],ax 270 ;call AuxIO_TeletypeHexWord 271 ;call AuxIO_TeletypeNL 272 pop bx 273 pop dx 274 275 pusha 276 push dx 277 ; Location of extended position 278 mov dx,word ptr [ExtendedAbsPos+02] 279 mov ax,word ptr [ExtendedAbsPos+00] 280 ;call AuxIO_TeletypeHexDWord 281 ;call AuxIO_TeletypeNL 282 pop dx 283 284 xor dh,dh 285 and dl,01111111b 286 shl dx,1 287 shl dx,1 288 mov bx, offset TrueSecs 289 add bx,dx 290 291 mov ax, word ptr[bx] 292 ;call AuxIO_TeletypeHexWord 293 ;call AuxIO_TeletypeNL 294 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 295 ;call AuxIO_TeletypeHexByte 296 ;call AuxIO_TeletypeNL 297 ;mov si,offset PartitionSector 298 ;call AuxIO_DumpSector 299 popa 300 301 ; LBA 302 mov si,offset before_lvm_adjust 303 ;call AuxIO_Print 304 305 xchg dx,bx 306 ;call AuxIO_TeletypeHexDWord 307 ;call AuxIO_TeletypeNL 308 xchg bx,dx 309 popa 310 311 312 ;or bx,ax 313 test [ExtendedAbsPosSet],1 314 jz pri 315 316 317 318 319 pusha 320 mov si,offset before_lvm_adjust_log 321 ;call AuxIO_Print 322 ; LBA 323 xchg dx,bx 324 ;call AuxIO_TeletypeHexDWord 325 ;call AuxIO_TeletypeNL 326 xchg bx,dx 327 popa 328 329 330 push dx 331 push bx 332 266 333 xor dh,dh 267 334 and dl,01111111b 268 335 shl dx,1 269 336 shl dx,1 270 mov bx, 337 mov bx,offset TrueSecs 271 338 add bx,dx 272 mov ax,word ptr [bx] 273 274 ;mov [ts],ax 275 276 ; call AuxIO_TeletypeHexWord 277 ; call AuxIO_TeletypeNL 278 pop bx 279 pop dx 280 281 pusha 282 push dx 283 ; Location of extended position 284 mov dx,word ptr [ExtendedAbsPos+02] 285 mov ax,word ptr [ExtendedAbsPos+00] 286 ; call AuxIO_TeletypeHexDWord 287 ; call AuxIO_TeletypeNL 288 pop dx 289 290 xor dh,dh 291 and dl,01111111b 292 shl dx,1 293 shl dx,1 294 mov bx, offset TrueSecs 295 add bx,dx 296 297 mov ax, word ptr[bx] 298 ; call AuxIO_TeletypeHexWord 299 ; call AuxIO_TeletypeNL 300 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 301 ; call AuxIO_TeletypeHexByte 302 ; call AuxIO_TeletypeNL 303 ; mov si,offset PartitionSector 304 ; call AuxIO_DumpSector 305 popa 306 307 ; LBA 308 mov si,offset before_lvm_adjust 309 ; call AuxIO_Print 310 311 xchg dx,bx 312 ; call AuxIO_TeletypeHexDWord 313 ; call AuxIO_TeletypeNL 314 xchg bx,dx 315 popa 316 317 318 ;or bx,ax 319 test [ExtendedAbsPosSet],1 320 jz pri 321 322 323 324 325 pusha 326 mov si,offset before_lvm_adjust_log 327 ; call AuxIO_Print 328 ; LBA 329 xchg dx,bx 330 ; call AuxIO_TeletypeHexDWord 331 ; call AuxIO_TeletypeNL 332 xchg bx,dx 333 popa 334 335 336 push dx 337 push bx 338 xor dh,dh 339 and dl,01111111b 340 shl dx,1 341 shl dx,1 342 mov bx,offset TrueSecs 343 add bx,dx 344 mov dx,[bx] 345 dec dx 346 add ax,dx 347 pop bx 348 pop dx 349 adc bx,0 350 351 352 pusha 353 mov si,offset after_lvm_adjust_log 354 ; call AuxIO_Print 355 ; LBA 356 xchg dx,bx 357 ; call AuxIO_TeletypeHexDWord 358 ; call AuxIO_TeletypeNL 359 xchg bx,dx 360 popa 361 362 jmp done 363 364 365 366 367 pri: 368 369 370 push ax 371 push cx 372 xor ch, ch ; Zero out upper-byte 373 374 push dx 375 xor dh,dh 376 and dl,01111111b 377 shl dx,1 378 shl dx,1 379 push bx 380 mov bx,offset TrueSecs 381 add bx,dx 382 mov ax,[bx] 383 ;mov [ts2],ax 384 pop bx 385 pop dx 386 387 388 389 ;mov al, 63 390 ;call VideoIO_PrintByteDynamicNumber 391 ;self: jmp self 392 393 394 395 ; DEZE WERKT SOMS NIET GOED 396 ; ROMMELT MET CYLINDERS 397 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 398 399 and cl, al ; Isolate lower bits, because upper 400 mov ah, 0 401 mov si, ax ; ones may be used for cylinder 402 sub si, cx 403 404 pop cx 405 pop ax 406 407 or cl, al ; Set sector to last sector 408 409 add ax, si ; Adjust lower LBA 410 adc bx, 0 ; Adjust LBA Sector (BX:AX) 411 412 413 414 ;push ax 415 ;call AuxIO_TeletypeHexWord 416 ;call AuxIO_TeletypeNL 417 ;mov ax,[ts] 418 ;call AuxIO_TeletypeHexWord 419 ;call AuxIO_TeletypeNL 420 ;mov ax,[ts2] 421 ;call AuxIO_TeletypeHexWord 422 ;call AuxIO_TeletypeNL 423 ;pop ax 424 425 ;and ax,[ts] 339 mov dx,[bx] 340 dec dx 341 add ax,dx 342 343 pop bx 344 pop dx 345 adc bx,0 346 347 348 pusha 349 mov si,offset after_lvm_adjust_log 350 ;call AuxIO_Print 351 ; LBA 352 xchg dx,bx 353 ;call AuxIO_TeletypeHexDWord 354 ;call AuxIO_TeletypeNL 355 xchg bx,dx 356 popa 357 358 jmp done 359 360 361 362 363 pri: 364 365 366 push ax 367 push cx 368 xor ch, ch ; Zero out upper-byte 369 370 push dx 371 xor dh,dh 372 and dl,01111111b 373 shl dx,1 374 shl dx,1 375 376 push bx 377 mov bx,offset TrueSecs 378 add bx,dx 379 mov ax,[bx] 380 ;mov [ts2],ax 381 pop bx 382 pop dx 383 384 385 386 ;~ mov al, 63 387 ;~ call VideoIO_PrintByteDynamicNumber 388 ;~ self: jmp self 389 390 391 392 ; DEZE WERKT SOMS NIET GOED 393 ; ROMMELT MET CYLINDERS 394 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 395 396 and cl, al ; Isolate lower bits, because upper 397 mov ah, 0 398 mov si, ax ; ones may be used for cylinder 399 sub si, cx 400 401 pop cx 402 pop ax 403 404 or cl, al ; Set sector to last sector 405 add ax, si ; Adjust lower LBA 406 adc bx, 0 ; Adjust LBA Sector (BX:AX) 407 408 409 410 ;~ push ax 411 ;~ call AuxIO_TeletypeHexWord 412 ;~ call AuxIO_TeletypeNL 413 ;~ mov ax,[ts] 414 ;~ call AuxIO_TeletypeHexWord 415 ;~ call AuxIO_TeletypeNL 416 ;~ mov ax,[ts2] 417 ;~ call AuxIO_TeletypeHexWord 418 ;~ call AuxIO_TeletypeNL 419 ;~ pop ax 420 421 ;~ and ax,[ts] 426 422 427 423 jmp done … … 429 425 430 426 431 done: 432 433 434 435 pusha 436 mov si,offset after_lvm_adjust 437 ; call AuxIO_Print 438 ; LBA 439 xchg dx,bx 440 ; call AuxIO_TeletypeHexDWord 441 ; call AuxIO_TeletypeNL 442 xchg bx,dx 443 popa 444 445 446 447 ; pusha 448 ; call AuxIO_TeletypeNL 449 450 ; CYL 451 ; mov al,ch 452 ; call AuxIO_TeletypeHexByte 453 ; call AuxIO_TeletypeNL 454 455 ; HEAD 456 ; mov al,dh 457 ; call AuxIO_TeletypeHexByte 458 ; call AuxIO_TeletypeNL 459 460 ; SEC 461 ; mov al,cl 462 ; call AuxIO_TeletypeHexByte 463 ; call AuxIO_TeletypeNL 464 465 ; DRIVE 466 ; mov al,dl 467 ; call AuxIO_TeletypeHexByte 468 ; call AuxIO_TeletypeNL 469 470 ; popa 471 472 427 done: 428 429 pusha 430 mov si,offset after_lvm_adjust 431 ;~ call AuxIO_Print 432 ; LBA 433 xchg dx,bx 434 ;~ call AuxIO_TeletypeHexDWord 435 ;~ call AuxIO_TeletypeNL 436 xchg bx,dx 437 popa 438 439 ;~ pusha 440 ;~ call AuxIO_TeletypeNL 441 ;~ 442 ;~ ; CYL 443 ;~ mov al,ch 444 ;~ call AuxIO_TeletypeHexByte 445 ;~ call AuxIO_TeletypeNL 446 ;~ 447 ;~ ; HEAD 448 ;~ mov al,dh 449 ;~ call AuxIO_TeletypeHexByte 450 ;~ call AuxIO_TeletypeNL 451 ;~ 452 ;~ ; SEC 453 ;~ mov al,cl 454 ;~ call AuxIO_TeletypeHexByte 455 ;~ call AuxIO_TeletypeNL 456 ;~ 457 ;~ ; DRIVE 458 ;~ mov al,dl 459 ;~ call AuxIO_TeletypeHexByte 460 ;~ call AuxIO_TeletypeNL 461 ;~ popa 473 462 474 463 ret 475 464 DriveIO_LVMAdjustToInfoSector EndP 465 466 476 467 477 468 drive db 'drive : ',0 … … 492 483 ; Preserve: all registers 493 484 ; ######################################################################### 494 DriveIO_LoadPartition 495 mov wptr cs:[CurPartition_Location+0], ax496 mov wptr cs:[CurPartition_Location+2], bx497 mov wptr cs:[CurPartition_Location+4], dx498 mov wptr cs:[CurPartition_Location+6], cx ; Saves the location499 mov si, offset PartitionSector ; DS:SI - ExecBase500 call DriveIO_LoadSector501 clc502 cmp wptr [si+LocBR_Magic], 0AA55h503 je DIOLP_Success504 ; We check, if we are scanning partitions. In that case, if CHS is not 0/0/1505 ; we will display a "bad partition table" message and halt the system.506 cmp cx, 0001h507 jne DIOLP_Failed508 or dh, dh509 jnz DIOLP_Failed510 stc ; Set carry, so no partition table511 DIOLP_Success:512 513 IFDEF AuxDebug 514 ; show current partition location515 pushf516 pusha517 call AuxIO_TeletypeNL518 mov si,offset db_curpartloc519 call AuxIO_Print520 mov dx,word ptr [CurPartition_Location+02]521 mov ax,word ptr [CurPartition_Location+00]522 call AuxIO_TeletypeHexDWord523 call AuxIO_TeletypeNL524 mov si,offset PartitionSector525 call AuxIO_DumpSector526 call AuxIO_TeletypeNL527 popa528 popf529 ENDIF530 531 ret532 DIOLP_Failed:533 jmp DriveIO_GotLoadError534 DriveIO_LoadPartition 485 DriveIO_LoadPartition Proc Near Uses si 486 mov wptr cs:[CurPartition_Location+0], ax 487 mov wptr cs:[CurPartition_Location+2], bx 488 mov wptr cs:[CurPartition_Location+4], dx 489 mov wptr cs:[CurPartition_Location+6], cx ; Saves the location 490 mov si, offset PartitionSector ; DS:SI - ExecBase 491 call DriveIO_LoadSector 492 clc 493 cmp wptr [si+LocBR_Magic], 0AA55h 494 je DIOLP_Success 495 ; We check, if we are scanning partitions. In that case, if CHS is not 0/0/1 496 ; we will display a "bad partition table" message and halt the system. 497 cmp cx, 0001h 498 jne DIOLP_Failed 499 or dh, dh 500 jnz DIOLP_Failed 501 stc ; Set carry, so no partition table 502 DIOLP_Success: 503 504 IFDEF AUX_DEBUG 505 ; show current partition location 506 ;~ pushf 507 ;~ pusha 508 ;~ call AuxIO_TeletypeNL 509 ;~ mov si,offset db_curpartloc 510 ;~ call AuxIO_Print 511 ;~ mov dx,word ptr [CurPartition_Location+02] 512 ;~ mov ax,word ptr [CurPartition_Location+00] 513 ;~ call AuxIO_TeletypeHexDWord 514 ;~ call AuxIO_TeletypeNL 515 ;~ mov si,offset PartitionSector 516 ;~ call AuxIO_DumpSector 517 ;~ call AuxIO_TeletypeNL 518 ;~ popa 519 ;~ popf 520 ENDIF 521 522 ret 523 DIOLP_Failed: 524 jmp DriveIO_GotLoadError 525 DriveIO_LoadPartition EndP 535 526 536 527 ; ######################################################################### … … 541 532 ; Preserve: all registers 542 533 ; ######################################################################### 543 DriveIO_SavePartition 544 mov ax, wptr cs:[CurPartition_Location+0]545 mov bx, wptr cs:[CurPartition_Location+2]546 mov dx, wptr cs:[CurPartition_Location+4]547 mov cx, wptr cs:[CurPartition_Location+6] ; Gets prev. saved location548 mov si, offset PartitionSector ; DS:SI - ExecBase549 cmp wptr [si+LocBR_Magic], 0AA55h ; Checks for signature, if not found550 jne DIOSP_SevereError ; we assume a really bad error551 call DriveIO_SaveSector552 DIOSP_SevereError:553 ret554 DriveIO_SavePartition 534 DriveIO_SavePartition Proc Near Uses ax bx cx dx si 535 mov ax, wptr cs:[CurPartition_Location+0] 536 mov bx, wptr cs:[CurPartition_Location+2] 537 mov dx, wptr cs:[CurPartition_Location+4] 538 mov cx, wptr cs:[CurPartition_Location+6] ; Gets prev. saved location 539 mov si, offset PartitionSector ; DS:SI - ExecBase 540 cmp wptr [si+LocBR_Magic], 0AA55h ; Checks for signature, if not found 541 jne DIOSP_SevereError ; we assume a really bad error 542 call DriveIO_SaveSector 543 DIOSP_SevereError: 544 ret 545 DriveIO_SavePartition EndP 555 546 556 547 ; Keeps DS:SI for caller 557 DriveIO_LoadTmpSector 558 mov si, offset TmpSector559 call DriveIO_LoadSector ; Uses INT13X if needed560 ret561 DriveIO_LoadTmpSector 548 DriveIO_LoadTmpSector Proc Near 549 mov si, offset TmpSector 550 call DriveIO_LoadSector 551 ret 552 DriveIO_LoadTmpSector EndP 562 553 563 554 ; Keeps DS:SI for caller 564 DriveIO_SaveTmpSector 565 mov si, offset TmpSector566 call DriveIO_SaveSector567 ret568 DriveIO_SaveTmpSector 555 DriveIO_SaveTmpSector Proc Near 556 mov si, offset TmpSector 557 call DriveIO_SaveSector 558 ret 559 DriveIO_SaveTmpSector EndP 569 560 570 561 ; Keeps DS:SI for caller, sets carry if valid LVM sector encountered 571 DriveIO_LoadLVMSector 572 test [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so573 jnz DIOLLVMS_NoLVMSector ; don't load but declare as bad!574 mov ax, wptr cs:[CurPartition_Location+0]575 mov bx, wptr cs:[CurPartition_Location+2]576 mov dx, wptr cs:[CurPartition_Location+4]577 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location578 579 call DriveIO_LVMAdjustToInfoSector580 581 mov si, offset LVMSector582 call DriveIO_LoadSector583 584 IFDEF AuxDebug 585 ; show current partition location586 pushf587 pusha588 ; callAuxIO_TeletypeNL589 movsi,offset db_curlvmsec590 ; callAuxIO_Print591 movdx,bx592 ; callAuxIO_TeletypeHexDWord593 ; callAuxIO_TeletypeNL594 movsi,offset LVMSector595 ; callAuxIO_DumpSector596 ; callAuxIO_TeletypeNL597 popa598 popf599 ENDIF600 601 call LVM_CheckSectorSignature602 jnc DIOLLVMS_NoLVMSector603 call LVM_CheckSectorCRC604 jnc DIOLLVMS_NoLVMSector605 ret606 ; This here is called, if an invalid (or no) LVM information sector is found607 ; It will truncate the first byte of the sector, so all other routines608 ; will notice it easily by just comparing the first byte.609 DIOLLVMS_NoLVMSector:610 mov bptr [si+LocLVM_SignatureStart], 0611 ret612 DriveIO_LoadLVMSector 562 DriveIO_LoadLVMSector Proc Near Uses ax bx cx dx 563 test [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 564 jnz DIOLLVMS_NoLVMSector ; don't load but declare as bad! 565 mov ax, wptr cs:[CurPartition_Location+0] 566 mov bx, wptr cs:[CurPartition_Location+2] 567 mov dx, wptr cs:[CurPartition_Location+4] 568 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 569 570 call DriveIO_LVMAdjustToInfoSector 571 572 mov si, offset LVMSector 573 call DriveIO_LoadSector 574 575 IFDEF AUX_DEBUG 576 ; show current partition location 577 pushf 578 pusha 579 ;~ call AuxIO_TeletypeNL 580 ;~ mov si,offset db_curlvmsec 581 ;~ call AuxIO_Print 582 mov dx,bx 583 ;~ call AuxIO_TeletypeHexDWord 584 ;~ call AuxIO_TeletypeNL 585 mov si,offset LVMSector 586 ;~ call AuxIO_DumpSector 587 ;~ call AuxIO_TeletypeNL 588 popa 589 popf 590 ENDIF 591 592 call LVM_CheckSectorSignature 593 jnc DIOLLVMS_NoLVMSector 594 call LVM_CheckSectorCRC 595 jnc DIOLLVMS_NoLVMSector 596 ret 597 ; This here is called, if an invalid (or no) LVM information sector is found 598 ; It will truncate the first byte of the sector, so all other routines 599 ; will notice it easily by just comparing the first byte. 600 DIOLLVMS_NoLVMSector: 601 mov bptr [si+LocLVM_SignatureStart], 0 602 ret 603 DriveIO_LoadLVMSector EndP 613 604 614 605 ; Keeps DS:SI for caller, saves at anytime w/o checks (!) 615 DriveIO_SaveLVMSector Proc Near Uses ax bx cx dx 616 test [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 617 jnz DIOSLVMS_SevereError ; don't save at anytime (security!) 618 mov ax, wptr cs:[CurPartition_Location+0] 619 mov bx, wptr cs:[CurPartition_Location+2] 620 mov dx, wptr cs:[CurPartition_Location+4] 621 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 622 call LVM_CheckSectorSignature 623 jnc DIOSLVMS_SevereError ; LVM Signature must be there 624 call DriveIO_LVMAdjustToInfoSector 625 mov si, offset LVMSector 626 call DriveIO_SaveSector 627 DIOSLVMS_SevereError: 628 ret 629 DriveIO_SaveLVMSector EndP 606 DriveIO_SaveLVMSector Proc Near Uses ax bx cx dx 607 test [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 608 jnz DIOSLVMS_SevereError ; don't save at anytime (security!) 609 mov ax, wptr cs:[CurPartition_Location+0] 610 mov bx, wptr cs:[CurPartition_Location+2] 611 mov dx, wptr cs:[CurPartition_Location+4] 612 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 613 call LVM_CheckSectorSignature 614 jnc DIOSLVMS_SevereError ; LVM Signature must be there 615 call DriveIO_LVMAdjustToInfoSector 616 mov si, offset LVMSector 617 call DriveIO_SaveSector 618 DIOSLVMS_SevereError: 619 ret 620 DriveIO_SaveLVMSector EndP 621 622 ; Rousseau: Move this to BSS and merge with int13xbuf there. 630 623 631 624 ; Memory-Block that holds information for LBA-access via INT 13h 632 DriveIO_DAP db 10h; Size of paket633 db0 ; Reserved634 DriveIO_DAP_NumBlocks dw0 ; Number of blocks635 DriveIO_DAP_Transfer dd0 ; Transfer Adress636 DriveIO_DAP_Absolute dd0 ; Absolute Sector637 dd0 ; Second Part of QWORD625 DriveIO_DAP db 10h ; Size of paket 626 db 0 ; Reserved 627 DriveIO_DAP_NumBlocks dw 0 ; Number of blocks 628 DriveIO_DAP_Transfer dd 0 ; Transfer Adress 629 DriveIO_DAP_Absolute dd 0 ; Absolute Sector 630 dd 0 ; Second Part of QWORD 638 631 639 632 ; Special error message instead of "LOAD ERROR" during partition scanning, 640 633 ; so users will notice that something is bad with their partition table(s) 641 DriveIO_GotLoadError 642 test cs:CurIO_Scanning, 1 ; Must be CS:, cause DS!=CS maybe here643 jnz InScanMode644 jmp MBR_LoadError645 InScanMode:646 mov si, offset TXT_BrokenPartitionTable647 push cs648 pop ds649 call MBR_Teletype650 mov si, offset BrokenHDD651 sub dl, 50h ; 80h -> '0'652 cmp dl, 39h653 jbe DIOGLE_BelowA654 add dl, 7 ; 3Ah -> 'A'655 DIOGLE_BelowA:656 mov bptr [si+5], dl657 call MBR_Teletype658 659 ; JWasm: cannot jump to local label inprocedure.660 ; Changed to halt here.661 ;jmp MBRLE_Halt662 DriveIO_GotLoadError_halt:663 jmp DriveIO_GotLoadError_halt664 DriveIO_GotLoadError 634 DriveIO_GotLoadError Proc Near 635 test cs:CurIO_Scanning, 1 ; Must be CS:, cause DS!=CS maybe here 636 jnz InScanMode 637 jmp MBR_LoadError 638 InScanMode: 639 mov si, offset TXT_BrokenPartitionTable 640 push cs 641 pop ds 642 call MBR_Teletype 643 mov si, offset BrokenHDD 644 sub dl, 50h ; 80h -> '0' 645 cmp dl, 39h 646 jbe DIOGLE_BelowA 647 add dl, 7 ; 3Ah -> 'A' 648 DIOGLE_BelowA: 649 mov bptr [si+5], dl 650 call MBR_Teletype 651 652 ; JWasm: cannot jump to local label in other procedure. 653 ; Changed to halt here. 654 ;jmp MBRLE_Halt 655 DriveIO_GotLoadError_halt: 656 jmp DriveIO_GotLoadError_halt 657 DriveIO_GotLoadError EndP 665 658 666 659 ; ######################################################################### … … 673 666 ; Preserve: all registers 674 667 ; ######################################################################### 675 DriveIO_LoadSector 676 ; Is the drive not a harddrive?677 cmpdl, 80h678 jbDIOLS_UseNormal679 680 testcs:[CurIO_UseExtension], 1681 jzDIOLS_UseNormal682 ; Are we forced do use LBA via Setting?683 jnzDIOLS_UseExtension684 685 ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h)686 orbh, bh687 jnzDIOLS_UseExtension688 ; Compare Switch-Table value to bit 16-23 of LBA-address689 movdi, dx690 anddi, 007Fh691 cmpbptr cs:[LBASwitchTable+di], bl692 jbeDIOLS_UseExtension693 DIOLS_UseNormal:694 movdi, 3695 696 pushds697 popes698 movbx, si ; ES:BX - Destination699 movax, 0201h ; Function 2 - Load Sector700 int13h701 jncDIOLS_Success702 decdi703 jnzDIOLS_ErrorLoop704 ; Sector load failed...705 jmpDriveIO_GotLoadError706 707 DIOLS_UseExtension:708 push cx709 mov cs:[DriveIO_DAP_NumBlocks], 1 ; Copy ONE sector710 mov wptr cs:[DriveIO_DAP_Transfer+0], si711 mov cx, ds712 mov wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress713 mov wptr cs:[DriveIO_DAP_Absolute+0], ax714 mov wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector715 push cs716 pop ds717 mov si, offset DriveIO_DAP718 mov ah, 42h ; Extended Read719 int 13h720 pop cx721 jnc DIOLS_Success722 ; Sector load failed...723 jmp DriveIO_GotLoadError724 725 DIOLS_Success:726 ret727 DriveIO_LoadSector 668 DriveIO_LoadSector Proc Near Uses ax bx ds si es di 669 ; Is the drive not a harddrive? 670 cmp dl, 80h 671 jb DIOLS_UseNormal 672 673 test cs:[CurIO_UseExtension], 1 674 jz DIOLS_UseNormal 675 ; Are we forced do use LBA via Setting? 676 jnz DIOLS_UseExtension 677 678 ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h) 679 or bh, bh 680 jnz DIOLS_UseExtension 681 ; Compare Switch-Table value to bit 16-23 of LBA-address 682 mov di, dx 683 and di, 007Fh 684 cmp bptr cs:[LBASwitchTable+di], bl 685 jbe DIOLS_UseExtension 686 DIOLS_UseNormal: 687 mov di, 3 688 DIOLS_ErrorLoop: 689 push ds 690 pop es 691 mov bx, si ; ES:BX - Destination 692 mov ax, 0201h ; Function 2 - Load Sector 693 int 13h 694 jnc DIOLS_Success 695 dec di 696 jnz DIOLS_ErrorLoop 697 ; Sector load failed... 698 jmp DriveIO_GotLoadError 699 700 DIOLS_UseExtension: 701 push cx 702 mov cs:[DriveIO_DAP_NumBlocks], 1 ; Copy ONE sector 703 mov wptr cs:[DriveIO_DAP_Transfer+0], si 704 mov cx, ds 705 mov wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress 706 mov wptr cs:[DriveIO_DAP_Absolute+0], ax 707 mov wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector 708 push cs 709 pop ds 710 mov si, offset DriveIO_DAP 711 mov ah, 42h ; Extended Read 712 int 13h 713 pop cx 714 jnc DIOLS_Success 715 ; Sector load failed... 716 jmp DriveIO_GotLoadError 717 718 DIOLS_Success: 719 ret 720 DriveIO_LoadSector EndP 728 721 729 722 … … 744 737 ; AX = Error code 745 738 ; 746 DriveIO_LoadSectorLBA 747 ; Get one sector748 mov cs:[DriveIO_DAP_NumBlocks], 1749 750 ; Setup buffer address751 mov wptr cs:[DriveIO_DAP_Transfer+0], si752 mov wptr cs:[DriveIO_DAP_Transfer+2], di753 754 ; Setup LBA address of requested sector755 mov wptr cs:[DriveIO_DAP_Absolute+0], cx756 mov wptr cs:[DriveIO_DAP_Absolute+2], bx757 mov wptr cs:[DriveIO_DAP_Absolute+4], 0758 mov wptr cs:[DriveIO_DAP_Absolute+6], 0759 760 ; Address of packet761 mov si, offset DriveIO_DAP762 763 ; Do the extended read764 mov ah, 42h765 int 13h766 767 ; Looking good so far768 jnc DriveIO_LoadSectorLBA_succes1769 770 ; AH should not be zero, if it is then set to undefined and set carry771 test ah,ah772 jnz DriveIO_LoadSectorLBA_error1773 mov ah, 0bbh ; Undefined error774 DriveIO_LoadSectorLBA_error1:775 stc776 jmp DriveIO_LoadSectorLBA_exit777 778 ; AL should be zero, if not then set to undefined and set carry779 DriveIO_LoadSectorLBA_succes1:780 test ah,ah781 jz DriveIO_LoadSectorLBA_exit782 stc783 jmp DriveIO_LoadSectorLBA_exit784 785 ; Return to caller786 DriveIO_LoadSectorLBA_exit:787 ret788 DriveIO_LoadSectorLBA 739 DriveIO_LoadSectorLBA Proc Near Uses bx cx dx si di ds es 740 ; Get one sector 741 mov cs:[DriveIO_DAP_NumBlocks], 1 742 743 ; Setup buffer address 744 mov wptr cs:[DriveIO_DAP_Transfer+0], si 745 mov wptr cs:[DriveIO_DAP_Transfer+2], di 746 747 ; Setup LBA address of requested sector 748 mov wptr cs:[DriveIO_DAP_Absolute+0], cx 749 mov wptr cs:[DriveIO_DAP_Absolute+2], bx 750 mov wptr cs:[DriveIO_DAP_Absolute+4], 0 751 mov wptr cs:[DriveIO_DAP_Absolute+6], 0 752 753 ; Address of packet 754 mov si, offset DriveIO_DAP 755 756 ; Do the extended read 757 mov ah, 42h 758 int 13h 759 760 ; Looking good so far 761 jnc DriveIO_LoadSectorLBA_succes1 762 763 ; AH should not be zero, if it is then set to undefined and set carry 764 test ah,ah 765 jnz DriveIO_LoadSectorLBA_error1 766 mov ah, 0bbh ; Undefined error 767 DriveIO_LoadSectorLBA_error1: 768 stc 769 jmp DriveIO_LoadSectorLBA_exit 770 771 ; AL should be zero, if not then set to undefined and set carry 772 DriveIO_LoadSectorLBA_succes1: 773 test ah,ah 774 jz DriveIO_LoadSectorLBA_exit 775 stc 776 jmp DriveIO_LoadSectorLBA_exit 777 778 ; Return to caller 779 DriveIO_LoadSectorLBA_exit: 780 ret 781 DriveIO_LoadSectorLBA EndP 789 782 790 783 … … 801 794 ; ######################################################################### 802 795 DriveIO_SaveSector Proc Near Uses ax bx cx ds si es di 803 testcs:[CurIO_UseExtension], 1804 jzDIOSS_UseNormal805 ; Are we forced do use LBA via Setting?806 testcs:[CFG_ForceLBAUsage], 1807 jnzDIOSS_UseExtension808 ; Is the drive not a harddrive?809 cmpdl, 80h810 jbDIOSS_UseNormal811 ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h)812 orbh, bh813 jnzDIOSS_UseExtension814 ; Compare Switch-Table value to bit 16-23 of LBA-address815 movdi, dx816 anddi, 007Fh817 cmpbptr cs:[LBASwitchTable+di], bl818 jbeDIOSS_UseExtension819 DIOSS_UseNormal:820 movdi, 3821 822 pushds823 popes824 movbx, si ; ES:BX - Destination825 movax, 0301h ; Function 3 - Write Sector826 int13h827 jncDIOSS_Success828 decdi829 jnzDIOSS_ErrorLoop830 callMBR_SaveError831 832 DIOSS_UseExtension:833 push cx834 mov cs:[DriveIO_DAP_NumBlocks], 1 ; Copy ONE sector835 mov wptr cs:[DriveIO_DAP_Transfer+0], si836 mov cx, ds837 mov wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress838 mov wptr cs:[DriveIO_DAP_Absolute+0], ax839 mov wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector840 push cs841 pop ds842 mov si, offset DriveIO_DAP843 mov ax, 4300h ; Extended Write (No Verify)844 int 13h845 pop cx846 jnc DIOSS_Success847 call MBR_SaveError848 849 DIOSS_Success:850 ret796 test cs:[CurIO_UseExtension], 1 797 jz DIOSS_UseNormal 798 ; Are we forced do use LBA via Setting? 799 test cs:[CFG_ForceLBAUsage], 1 800 jnz DIOSS_UseExtension 801 ; Is the drive not a harddrive? 802 cmp dl, 80h 803 jb DIOSS_UseNormal 804 ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h) 805 or bh, bh 806 jnz DIOSS_UseExtension 807 ; Compare Switch-Table value to bit 16-23 of LBA-address 808 mov di, dx 809 and di, 007Fh 810 cmp bptr cs:[LBASwitchTable+di], bl 811 jbe DIOSS_UseExtension 812 DIOSS_UseNormal: 813 mov di, 3 814 DIOSS_ErrorLoop: 815 push ds 816 pop es 817 mov bx, si ; ES:BX - Destination 818 mov ax, 0301h ; Function 3 - Write Sector 819 int 13h 820 jnc DIOSS_Success 821 dec di 822 jnz DIOSS_ErrorLoop 823 call MBR_SaveError 824 825 DIOSS_UseExtension: 826 push cx 827 mov cs:[DriveIO_DAP_NumBlocks], 1 ; Copy ONE sector 828 mov wptr cs:[DriveIO_DAP_Transfer+0], si 829 mov cx, ds 830 mov wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress 831 mov wptr cs:[DriveIO_DAP_Absolute+0], ax 832 mov wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector 833 push cs 834 pop ds 835 mov si, offset DriveIO_DAP 836 mov ax, 4300h ; Extended Write (No Verify) 837 int 13h 838 pop cx 839 jnc DIOSS_Success 840 call MBR_SaveError 841 842 DIOSS_Success: 843 ret 851 844 DriveIO_SaveSector EndP 852 845 … … 858 851 pusha 859 852 860 call 853 call LVM_CheckSectorSignature 861 854 ; NC if no signature found 862 jnc 863 864 call 855 jnc DriveIO_LVMSectorValid_End 856 857 call LVM_CheckSectorCRC 865 858 ; Force valid !!! 866 859 stc … … 889 882 ; Return CF when valid master LVM sector found, NC if not. 890 883 ; Loads sector at [LVMSector] ! 891 DriveIO_LoadMasterLVMSector 884 DriveIO_LoadMasterLVMSector Proc Near 892 885 pusha 893 886 894 ; mov si,offset db_lmlvm895 ; call AuxIO_Print896 897 ; Physical disk898 ;mov al,'<'899 ;call VideoIO_PrintSingleChar900 ;mov al,dl901 ;call VideoIO_PrintHexByte902 ;mov al,'>'903 ;call VideoIO_PrintSingleChar904 905 ; callAuxIO_TeletypeHexByte906 ; callAuxIO_TeletypeNL887 ;~ mov si,offset db_lmlvm 888 ;~ call AuxIO_Print 889 890 ;~ ; Physical disk 891 ;~ mov al,'<' 892 ;~ call VideoIO_PrintSingleChar 893 ;~ mov al,dl 894 ;~ call VideoIO_PrintHexByte 895 ;~ mov al,'>' 896 ;~ call VideoIO_PrintSingleChar 897 ;~ 898 ;~ call AuxIO_TeletypeHexByte 899 ;~ call AuxIO_TeletypeNL 907 900 908 901 909 902 ; Loop over the sector-translation table, 910 903 ; process the first three values from high (255) to low (bios spt, most likely 63) 911 mov 904 mov cx,3 912 905 DriveIO_LoadMasterLVMSector_NextTry: 913 906 ; Number of sectors to read … … 934 927 ; 935 928 936 ;push ax937 ;push ax938 ;mov al,'$'939 ;call VideoIO_PrintSingleChar940 ;pop ax941 ;call VideoIO_PrintHexByte942 ;mov al,'$'943 ;call VideoIO_PrintSingleChar944 ;pop ax945 946 IFDEF A uxDebug929 ;~ push ax 930 ;~ push ax 931 ;~ mov al,'$' 932 ;~ call VideoIO_PrintSingleChar 933 ;~ pop ax 934 ;~ call VideoIO_PrintHexByte 935 ;~ mov al,'$' 936 ;~ call VideoIO_PrintSingleChar 937 ;~ pop ax 938 939 IFDEF AUX_DEBUG 947 940 ; Dump the value 948 941 ;call AuxIO_TeletypeHexByte … … 963 956 964 957 ; See if this is a valid LVM-sector 965 call 958 call DriveIO_LVMSectorValid 966 959 967 960 ; pushf … … 980 973 jc DriveIO_LoadMasterLVMSector_Found 981 974 ; Try next location 982 loop 975 loop DriveIO_LoadMasterLVMSector_NextTry 983 976 984 977 ; No master LVM-sector found, set CF=false … … 1083 1076 ; DL contains BIOS disk-number; 80h for first, 81h for second, etc. 1084 1077 DriveIO_GatherDiskInfo Proc Near 1085 pushf1086 push bx1087 push cx1088 push dx1089 push si1090 push di1091 push es1092 1093 ; Set ES to CS for buffer clearing1094 push cs1095 pop es1096 1097 ; Clear the buffer1098 ; Don't overwrite the word of the buffersize at index 0 !1099 ; Old Phoenix BIOSses require word (flags) at 02 to be zero,1100 ; so we clear the whole buffer to be sure.1101 mov cx, i13xbuf_size1102 mov di, offset i13xbuf1103 mov [di],cx1104 inc di1105 inc di1106 xor ah,ah1107 cld1108 rep stosb1109 1110 ; Get the drive parameters1111 mov ah, 48h; Get Drive Parameters (extended version)1112 ;mov dl, 80h; Drive number1113 mov si, offset i13xbuf; Buffer for result-info1114 push dx1115 int 13h; Call the BIOS-function1116 pop dx1117 1118 ; Do some error-checking1119 or ah,ah; AH is zero if no error (ZF=1 if no error)1120 mov ax,0; Setup code for non-huge drive (does not influence ZF)1121 jz DriveIO_GatherDiskInfo_ok; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive1122 jnc DriveIO_GatherDiskInfo_ok; Return if error (CY=1), assuming non-huge drive1123 jmp DriveIO_GatherDiskInfo_ret1124 1125 1126 DriveIO_GatherDiskInfo_ok:1127 1128 ;1129 ; Store the drive geometry1130 ;1131 1132 mov si, offset i13xbuf1133 1134 xor dh,dh1135 and dl,01111111b1136 shl dx,11137 shl dx,11138 1139 ; Store number of cylinders on disk1140 mov bx, offset BIOS_Cyls1141 add bx,dx1142 mov ax,[si+04h]1143 1144 mov word ptr [bx+00],ax1145 mov ax,[si+06]1146 mov word ptr [bx+02],ax1147 1148 ; Store number of heads per cylinder1149 mov bx, offset BIOS_Heads1150 add bx,dx1151 mov ax,[si+08h]1152 mov word ptr [bx+00],ax1153 mov ax,[si+0ah]1154 mov word ptr [bx+02],ax1155 1156 ; Store number of sectors per track1157 mov bx, offset BIOS_Secs1158 add bx,dx1159 mov ax,[si+0ch]1160 mov word ptr [bx+00],ax1161 1162 ; Update first byte of translation-table to conform to BIOS SPT1163 mov byte ptr [secs_per_track_table], al1164 1165 mov ax,[si+0eh]1166 mov word ptr [bx+02],ax1167 1168 ; Store total secs1169 mov bx, offset BIOS_TotalSecs1170 add bx,dx1171 add bx,dx1172 mov ax,[si+10h]1173 1174 mov word ptr [bx+00],ax1175 mov ax,[si+12h]1176 mov word ptr [bx+02],ax1177 mov ax,[si+14h]1178 mov word ptr [bx+04],ax1179 mov ax,[si+18h]1180 mov word ptr [bx+06],ax1181 1182 ; Store number of bytes per sector1183 mov bx, offset BIOS_Bytes1184 add bx,dx1185 mov ax,[si+18h]1186 mov [bx],ax1187 1188 1189 ;1190 ; See of it's a huge drive of not1191 ;1192 1193 ; Drive is larger than 2TiB1194 mov ax,5; Drive code (5)1195 mov bx, [si+14h]; Low word of high dword of sector-count1196 or bx, [si+16h]; High word of high dword of sector-count1197 jnz DriveIO_GatherDiskInfo_ret; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing1198 1199 ; Drive is larger than max OS/2 capacity1200 dec ax; Drive code (4)1201 mov bx, [si+12h]; High word of low dword of sector-count1202 cmp bx, 0fe01h; Boundary1203 jae DriveIO_GatherDiskInfo_ret; If above or equal to boundary,1204 1205 1206 ; Drive can be completely utilized by OS/21207 dec ax; Drive code (3)1208 cmp bx, 8000h; Boundary1209 jae DriveIO_GatherDiskInfo_ret; If above or equal to boundary,1210 1211 1212 ; This is the small area between DANI 1TiB and LBA 1TiB1213 dec ax; Drive code (2)1214 cmp bx, 7e81h; Boundary1215 jae DriveIO_GatherDiskInfo_ret; If above or equal to boundary,1216 1217 1218 1219 ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track)1220 dec ax; Drive code (1)1221 cmp bx, 3ec1h; Boundary1222 jae DriveIO_GatherDiskInfo_ret; If above or equal to boundary,1223 1224 1225 1226 1227 ; We have a drive that can be addressed using standard 255/63 geometry1228 dec ax ; Drive code (0)1229 1230 1231 DriveIO_GatherDiskInfo_ret:1232 pop es1233 pop di1234 pop si1235 pop dx1236 pop cx1237 pop bx1238 1239 mov [CurIO_UseExtension],11240 1241 popf1242 ret1078 pushf 1079 push bx 1080 push cx 1081 push dx 1082 push si 1083 push di 1084 push es 1085 1086 ; Set ES to CS for buffer clearing 1087 push cs 1088 pop es 1089 1090 ; Clear the buffer 1091 ; Also setup the buffer size. 1092 ; Old Phoenix BIOSses require word (flags) at 02 to be zero, 1093 ; so we clear the whole buffer to be sure. 1094 mov cx, i13xbuf_size ; Dynamically calculated by assembler. 1095 mov di, offset i13xbuf ; Points to size field. 1096 mov [di],cx ; Setup buffer-size. 1097 inc di 1098 inc di ; Now pointing at actual buffer. 1099 xor ah,ah ; Fill value. 1100 cld ; Direction up. 1101 rep stosb ; Clear buffer. 1102 1103 ; Get the drive parameters 1104 mov ah, 48h ; Get Drive Parameters (extended version) 1105 ;mov dl, 80h ; Drive number 1106 mov si, offset i13xbuf ; Buffer for result-info 1107 push dx 1108 int 13h ; Call the BIOS-function 1109 pop dx 1110 1111 ; Do some error-checking 1112 or ah,ah ; AH is zero if no error (ZF=1 if no error) 1113 mov ax,0 ; Setup code for non-huge drive (does not influence ZF) 1114 jz DriveIO_GatherDiskInfo_ok ; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive 1115 jnc DriveIO_GatherDiskInfo_ok ; Return if error (CY=1), assuming non-huge drive 1116 jmp DriveIO_GatherDiskInfo_ret 1117 1118 1119 DriveIO_GatherDiskInfo_ok: 1120 1121 ; 1122 ; Store the drive geometry 1123 ; 1124 1125 mov si, offset i13xbuf 1126 1127 xor dh,dh 1128 and dl,01111111b 1129 shl dx,1 1130 shl dx,1 1131 1132 ; Store number of cylinders on disk 1133 mov bx, offset BIOS_Cyls 1134 add bx,dx 1135 mov ax,[si+04h] 1136 1137 mov word ptr [bx+00],ax 1138 mov ax,[si+06] 1139 mov word ptr [bx+02],ax 1140 1141 ; Store number of heads per cylinder 1142 mov bx, offset BIOS_Heads 1143 add bx,dx 1144 mov ax,[si+08h] 1145 mov word ptr [bx+00],ax 1146 mov ax,[si+0ah] 1147 mov word ptr [bx+02],ax 1148 1149 ; Store number of sectors per track 1150 mov bx, offset BIOS_Secs 1151 add bx,dx 1152 mov ax,[si+0ch] 1153 mov word ptr [bx+00],ax 1154 1155 ; Update first byte of translation-table to conform to BIOS SPT 1156 mov byte ptr [secs_per_track_table], al 1157 1158 mov ax,[si+0eh] 1159 mov word ptr [bx+02],ax 1160 1161 ; Store total secs 1162 mov bx, offset BIOS_TotalSecs 1163 add bx,dx 1164 add bx,dx 1165 mov ax,[si+10h] 1166 1167 mov word ptr [bx+00],ax 1168 mov ax,[si+12h] 1169 mov word ptr [bx+02],ax 1170 mov ax,[si+14h] 1171 mov word ptr [bx+04],ax 1172 mov ax,[si+18h] 1173 mov word ptr [bx+06],ax 1174 1175 ; Store number of bytes per sector 1176 mov bx, offset BIOS_Bytes 1177 add bx,dx 1178 mov ax,[si+18h] 1179 mov [bx],ax 1180 1181 1182 ; 1183 ; See of it's a huge drive of not 1184 ; 1185 1186 ; Drive is larger than 2TiB 1187 mov ax,5 ; Drive code (5) 1188 mov bx, [si+14h] ; Low word of high dword of sector-count 1189 or bx, [si+16h] ; High word of high dword of sector-count 1190 jnz DriveIO_GatherDiskInfo_ret ; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing 1191 1192 ; Drive is larger than max OS/2 capacity 1193 dec ax ; Drive code (4) 1194 mov bx, [si+12h] ; High word of low dword of sector-count 1195 cmp bx, 0fe01h ; Boundary 1196 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1197 ; we have a drive larger than to 65536*255*255 = FE010000 sectors 1198 1199 ; Drive can be completely utilized by OS/2 1200 dec ax ; Drive code (3) 1201 cmp bx, 8000h ; Boundary 1202 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1203 ; we have a drive larger than 2^31 sectors but smaller than 65536*255*255 1204 1205 ; This is the small area between DANI 1TiB and LBA 1TiB 1206 dec ax ; Drive code (2) 1207 cmp bx, 7e81h ; Boundary 1208 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1209 ; we have a drive larger than 65536*255*127 but <65536*255*255 1210 ; DANIS506.ADD will use 255/255 extended geometry 1211 1212 ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track) 1213 dec ax ; Drive code (1) 1214 cmp bx, 3ec1h ; Boundary 1215 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1216 ; we have a drive larger than 65536*255*63 sectors (OS/2 502GiB Limit!) 1217 ; DANIS506.ADD will use 255/127 extended geometry ! 1218 ; IBM1S506.ADD will use 255/255 extended geometry ! 1219 1220 ; We have a drive that can be addressed using standard 255/63 geometry 1221 dec ax ; Drive code (0) 1222 ; We have a drive smaller than 65536*255*63 = 3EC10000 sectors 1223 1224 DriveIO_GatherDiskInfo_ret: 1225 pop es 1226 pop di 1227 pop si 1228 pop dx 1229 pop cx 1230 pop bx 1231 1232 mov [CurIO_UseExtension],1 1233 1234 popf 1235 ret 1243 1236 DriveIO_GatherDiskInfo EndP 1244 1237 -
trunk/BOOTCODE/REGULAR/OTHER.ASM
r40 r43 29 29 ; Zero Flag set if nul string 30 30 ; Destroyed: None 31 GetLenOfName 32 add si, cx33 dec si34 GLON_NameLoop:35 mov al, ds:[si]36 dec si37 cmp al, 3238 ja GLON_EndLoop39 dec cx40 jnz GLON_NameLoop41 GLON_EndLoop:42 or cx, cx43 ret ; return supposed len44 GetLenOfName 31 GetLenOfName Proc Near Uses ax si 32 add si, cx 33 dec si 34 GLON_NameLoop: 35 mov al, ds:[si] 36 dec si 37 cmp al, 32 38 ja GLON_EndLoop 39 dec cx 40 jnz GLON_NameLoop 41 GLON_EndLoop: 42 or cx, cx 43 ret ; return supposed len 44 GetLenOfName EndP 45 45 46 46 ; In: DS:SI - Pointer to NUL-terminated string … … 48 48 ; Zero Flag set if nul string 49 49 ; Destroyed: None 50 GetLenOfString 51 xor cx, cx52 GLOS_StringLoop:53 lodsb54 or al, al55 jz GLOS_EndOfString56 inc cx57 jmp GLOS_StringLoop58 59 GLOS_EndOfString:60 or cx, cx61 ret62 GetLenOfString 50 GetLenOfString Proc Near Uses ax si 51 xor cx, cx 52 GLOS_StringLoop: 53 lodsb 54 or al, al 55 jz GLOS_EndOfString 56 inc cx 57 jmp GLOS_StringLoop 58 59 GLOS_EndOfString: 60 or cx, cx 61 ret 62 GetLenOfString EndP 63 63 64 64 ; In: DS:SI - Pointer to NUL-terminated strings … … 66 66 ; Out: CX - Length of strings 67 67 ; Destroyed: None 68 GetLenOfStrings Proc Near Uses bx dx si 69 mov dh, cl 70 xor dl, dl 71 GLOSS_StringsLoop: 72 call GetLenOfString 73 add dl, cl 74 add si, cx 75 inc si 76 dec dh 77 jnz GLOSS_StringsLoop 78 ;movzx cx, dl 79 mov cl,dl 80 mov ch,0 81 82 ret 83 GetLenOfStrings EndP 84 85 PRECRAP_Main Proc Near 86 ; First initialize Variable-Area (everything with NUL) 87 mov di, offset BeginOfVariables 88 mov cx, offset EndOfVariables-offset BeginOfVariables 89 xor ax, ax 90 shr cx, 1 91 inc cx 92 rep stosw 93 94 mov VideoIO_Segment, VideoIO_Page0 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 NC if no valid LVM record found 146 147 pushf 148 149 ; mov al,'#' 150 ; pushf 151 ; call VideoIO_PrintSingleChar 152 ; popf 153 ; mov al,0 154 ; rcl al,1 155 ; call VideoIO_PrintHexByte 156 ; mov al,'#' 157 ; call VideoIO_PrintSingleChar 158 159 mov bx, offset TrueSecs 160 add bx,cx 161 add bx,cx 162 add bx,cx 163 add bx,cx 164 popf 165 166 ; bx now contains pointer to truesecs for this drive 167 168 jnc NoValidMasterLVM 169 170 ; ?? 3f bij disk 80h maar 0 bij disk 81h 171 mov si,offset LVMSector 172 mov ax,[si+LocLVM_Secs] 173 174 ; pusha 175 ; mov dx,ax 176 ; mov al,'%' 177 ; call VideoIO_PrintSingleChar 178 ; mov ax,dx 179 ; call VideoIO_PrintHexWord 180 ; mov al,'%' 181 ; call VideoIO_PrintSingleChar 182 ; popa 183 184 mov word ptr [bx],ax 185 jmp SkipUseBiosSecs 186 187 188 NoValidMasterLVM: 189 push bx ; push truesecs pointer 190 mov bx, offset BIOS_Secs 191 add bx,cx 192 add bx,cx 193 add bx,cx 194 add bx,cx 195 196 mov ax,[bx] ; get biossecs 197 pop bx 198 mov word ptr [bx],ax ; store bios secs in truesecs 199 200 201 SkipUseBiosSecs: 202 inc cx 203 cmp cl,[TotalHarddiscs] 204 jb PRECRAP_Main_next_disk 205 206 207 208 IFDEF AuxDebug 209 ; Write some debug-info to the com-port 210 call DEBUG_Dump1 211 ENDIF 212 213 ; jz NoValidMasterLVM 214 215 216 ; A valid Master LVM has been found. 217 ; We use the values in here to determine the number of sectors per track, 218 ; since this could be OS/2 extended geometry. 219 220 ; jmp Continue1 221 222 223 ;mov word ptr [LOG_Secs],63 68 GetLenOfStrings Proc Near Uses bx dx si 69 mov dh, cl 70 xor dl, dl 71 GLOSS_StringsLoop: 72 call GetLenOfString 73 add dl, cl 74 add si, cx 75 inc si 76 dec dh 77 jnz GLOSS_StringsLoop 78 ;movzx cx, dl 79 mov cl,dl 80 mov ch,0 81 ret 82 GetLenOfStrings EndP 83 84 PRECRAP_Main Proc Near 85 ; First initialize Variable-Area (everything with NUL) 86 ; We use the start instead of the variables because they could be 'orged' 87 ; to an offset. We want everything after the code to be nullified. 88 mov di, offset sobss 89 mov cx, offset EndOfVariables-offset BeginOfVariables 90 xor ax, ax 91 shr cx, 1 92 inc cx 93 rep stosw 94 95 mov VideoIO_Segment, VideoIO_Page0 96 97 ; Don't use blinking attribute 98 call VideoIO_NoBlinking 99 100 ; Get HardDriveCount 101 call DriveIO_GetHardDriveCount 102 103 104 ; Rousseau: added 105 call VideoIO_ClearScreen 106 107 ; Cursor to upper-left 108 mov TextPosX, 0 109 mov TextPosY, 0 110 call VideoIO_CursorSet 111 112 ;~ mov ax, VideoIO_Page1 113 ;~ call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 114 115 ; Copyright 116 mov si, offset Copyright 117 call MBR_Teletype 118 xor si,si 119 call MBR_TeletypeNL 120 121 122 ;call SOUND_Beep 123 124 ; Build Date 125 mov si, offset BUILD_DATE 126 call MBR_TeletypeNL 127 128 IFDEF AUX_DEBUG 129 ; Initialize the com-port for debugging 130 call AuxIO_Init 131 ENDIF 132 133 xor si,si 134 call MBR_TeletypeNL 135 136 xor cx,cx 137 PRECRAP_Main_next_disk: 138 139 mov dl,cl 140 or dl,80h 141 142 ; 143 ; This also setup the size of the i13xbuf. 144 ; 145 call DriveIO_GatherDiskInfo ; Also used to fill the geo, should be separate function 146 147 mov bx,offset HugeDisk 148 add bx,cx 149 mov [bx], al 150 151 call DriveIO_LoadMasterLVMSector ; returns NC if no valid LVM record found 152 153 pushf 154 155 ;~ mov al,'#' 156 ;~ pushf 157 ;~ call VideoIO_PrintSingleChar 158 ;~ popf 159 ;~ mov al,0 160 ;~ rcl al,1 161 ;~ call VideoIO_PrintHexByte 162 ;~ mov al,'#' 163 ;~ call VideoIO_PrintSingleChar 164 165 mov bx, offset TrueSecs 166 add bx,cx 167 add bx,cx 168 add bx,cx 169 add bx,cx 170 popf 171 172 ; bx now contains pointer to truesecs for this drive 173 174 jnc NoValidMasterLVM 175 176 ; ?? 3f bij disk 80h maar 0 bij disk 81h 177 mov si,offset LVMSector 178 mov ax,[si+LocLVM_Secs] 179 180 ;~ pusha 181 ;~ mov dx,ax 182 ;~ mov al,'%' 183 ;~ call VideoIO_PrintSingleChar 184 ;~ mov ax,dx 185 ;~ call VideoIO_PrintHexWord 186 ;~ mov al,'%' 187 ;~ call VideoIO_PrintSingleChar 188 ;~ popa 189 190 mov word ptr [bx],ax 191 jmp SkipUseBiosSecs 192 193 194 NoValidMasterLVM: 195 push bx ; push truesecs pointer 196 mov bx, offset BIOS_Secs 197 add bx,cx 198 add bx,cx 199 add bx,cx 200 add bx,cx 201 202 mov ax,[bx] ; get biossecs 203 pop bx 204 mov word ptr [bx],ax ; store bios secs in truesecs 205 206 207 SkipUseBiosSecs: 208 inc cx 209 cmp cl,[TotalHarddiscs] 210 jb PRECRAP_Main_next_disk 211 212 213 214 IFDEF AUX_DEBUG 215 ; Write some debug-info to the com-port 216 call DEBUG_Dump1 217 ENDIF 218 219 ;~ jz NoValidMasterLVM 220 ;~ 221 ;~ ; A valid Master LVM has been found. 222 ;~ ; We use the values in here to determine the number of sectors per track, 223 ;~ ; since this could be OS/2 extended geometry. 224 ;~ 225 ;~ jmp Continue1 226 ;~ 227 ;~ mov word ptr [LOG_Secs],63 224 228 225 229 ; mov al,[HugeDisk] ;; fout, moet nog index bij … … 233 237 234 238 235 ; Huge Disk indicator 236 mov si, offset HugeBootDisk 237 call MBR_Teletype 238 mov al,[HugeDisk] 239 mov si, offset No 240 test al,al 241 jz MBR_HugeDriveIndicator 242 mov si, offset Yes 243 244 MBR_HugeDriveIndicator: 245 call MBR_Teletype 246 xor si,si 247 call MBR_TeletypeNL 248 249 250 251 252 253 ; 254 ; Phase 1 Indicator 255 ; 256 mov si, offset Phase1 257 call MBR_Teletype 258 259 mov si, offset eCS_InstallVolume 260 mov al, [si] 261 test al,al ; See if phase 1 is active 262 jnz MBR_Main_BootThrough 263 mov si, offset NotActive 264 265 MBR_Main_BootThrough: 266 call MBR_Teletype 267 xor si,si 268 call MBR_TeletypeNL 269 270 271 ; Calculate Cooper-Bar Tables 272 call FX_CalculateTables 273 274 ; Calculate LVM-CRC-Table 275 call LVM_InitCRCTable 276 277 ; Get HardDriveCount 278 call DriveIO_GetHardDriveCount 279 280 ; Calculate CHS/LBA Switch Table 281 call DriveIO_InitLBASwitchTable 282 283 ; Setup PartitionPointers-Table 284 call PART_CalculateStraightPartPointers 285 286 ; Setup Cyrillic Charset, if needed 287 ifdef TXT_IncludeCyrillic 288 call CHARSET_IncludeCyrillic 289 endif 290 291 292 ; This sets [CurIO_UseExtension] flag. 293 call PRECRAP_CheckFor13extensions 294 295 296 297 IFNDEF ReleaseCode 298 ret 299 ENDIF 300 301 302 call PRECRAP_CheckConfiguration 303 304 305 ; ======================================= 306 ; Checks for MBR Virii :) I love that job 307 ; ======================================= 308 test CFG_DetectStealth, 1 309 jz PCM_NoStealthDetection 310 call VIRUS_CheckForStealth 311 PCM_NoStealthDetection: 312 test CFG_DetectVirus, 1 313 jz PCM_NoVirusDetection 314 call VIRUS_CheckForVirus 315 PCM_NoVirusDetection: 316 317 318 ; ============================================ 319 ; Delay for some time and get Strg/Alt State 320 ; ============================================ 321 test CFG_CooperBars, 1 322 jnz PCM_ShortDelay 323 mov al, 27 ; About 1.5 seconds 324 test CFG_FloppyBootGetName, 1 325 jz PCM_LongDelay 326 PCM_ShortDelay: 327 328 mov al, 13 ; shorten delay,if floppy gets accessed 329 PCM_LongDelay: 330 331 call TIMER_WaitTicCount 332 333 ; First check, if any normal key got pressed... 334 mov ah, 1 335 int 16h 336 jz PCM_NoNormalKeyPressed 337 ; User doesn't know what to do...or he is crazy <g> so display message 338 mov si, offset TXT_HowEnterSetup 339 call MBR_Teletype 340 mov al, 54 ; about 3 seconds, delay again 341 342 call TIMER_WaitTicCount 343 344 PCM_NoNormalKeyPressed: 345 ; Now get keyboard Strg/Alt State 346 mov ah, 02h 347 int 16h 348 mov SETUP_KeysOnEntry, al 349 350 ; Copy device-name to the ContBIOSbootSeq-IPT entry 351 ; We may not do this before PRECRAP_CheckConfiguration, because otherwise 352 ; this check will fail. 353 call PART_UpdateResumeBIOSName 354 ret 355 PRECRAP_Main EndP 356 357 358 359 AFTERCRAP_Main Proc Near 360 ; =================================================== 361 ; Now get volume label of FloppyDrive, if wanted... 362 ; =================================================== 363 test CFG_FloppyBootGetName, 1 364 jz ACM_NoFloppyGetName 365 call DriveIO_UpdateFloppyName 366 or ax, ax 367 jnz ACM_NoFloppyGetName 368 ; Try a second time, if it failed to detect the Floppy 369 call DriveIO_UpdateFloppyName 370 ACM_NoFloppyGetName: 371 ret 372 AFTERCRAP_Main EndP 239 ; Huge Disk indicator 240 mov si, offset HugeBootDisk 241 call MBR_Teletype 242 mov al,[HugeDisk] 243 mov si, offset No 244 test al,al 245 jz MBR_HugeDriveIndicator 246 mov si, offset Yes 247 248 MBR_HugeDriveIndicator: 249 call MBR_Teletype 250 xor si,si 251 call MBR_TeletypeNL 252 253 254 ; 255 ; Phase 1 Indicator 256 ; 257 mov si, offset Phase1 258 call MBR_Teletype 259 260 mov si, offset eCS_InstallVolume 261 mov al, [si] 262 test al,al ; See if phase 1 is active 263 jnz MBR_Main_BootThrough 264 mov si, offset NotActive 265 266 MBR_Main_BootThrough: 267 call MBR_Teletype 268 xor si,si 269 call MBR_TeletypeNL 270 271 272 ; Calculate Cooper-Bar Tables 273 call FX_CalculateTables 274 275 ; Calculate LVM-CRC-Table 276 call LVM_InitCRCTable 277 278 ; Get HardDriveCount 279 call DriveIO_GetHardDriveCount 280 281 ; Calculate CHS/LBA Switch Table 282 call DriveIO_InitLBASwitchTable 283 284 ; Setup PartitionPointers-Table 285 call PART_CalculateStraightPartPointers 286 287 ; Setup Cyrillic Charset, if needed 288 IFDEF TXT_IncludeCyrillic 289 call CHARSET_IncludeCyrillic 290 ENDIF 291 292 293 ; This sets [CurIO_UseExtension] flag. 294 call PRECRAP_CheckFor13extensions 295 296 IFNDEF ReleaseCode 297 ret 298 ENDIF 299 300 301 call PRECRAP_CheckConfiguration 302 303 304 ; ======================================= 305 ; Checks for MBR Virii :) I love that job 306 ; ======================================= 307 test CFG_DetectStealth, 1 308 jz PCM_NoStealthDetection 309 call VIRUS_CheckForStealth 310 PCM_NoStealthDetection: 311 test CFG_DetectVirus, 1 312 jz PCM_NoVirusDetection 313 call VIRUS_CheckForVirus 314 PCM_NoVirusDetection: 315 316 317 ; ============================================ 318 ; Delay for some time and get Strg/Alt State 319 ; ============================================ 320 test CFG_CooperBars, 1 321 jnz PCM_ShortDelay 322 mov al, 27 ; About 1.5 seconds 323 test CFG_FloppyBootGetName, 1 324 jz PCM_LongDelay 325 PCM_ShortDelay: 326 327 mov al, 13 ; shorten delay,if floppy gets accessed 328 PCM_LongDelay: 329 330 call TIMER_WaitTicCount 331 332 ; First check, if any normal key got pressed... 333 mov ah, 1 334 int 16h 335 jz PCM_NoNormalKeyPressed 336 ; User doesn't know what to do...or he is crazy <g> so display message 337 mov si, offset TXT_HowEnterSetup 338 call MBR_Teletype 339 mov al, 54 ; about 3 seconds, delay again 340 341 call TIMER_WaitTicCount 342 343 PCM_NoNormalKeyPressed: 344 ; Now get keyboard Strg/Alt State 345 mov ah, 02h 346 int 16h 347 mov SETUP_KeysOnEntry, al 348 349 ; Copy device-name to the ContBIOSbootSeq-IPT entry 350 ; We may not do this before PRECRAP_CheckConfiguration, because otherwise 351 ; this check will fail. 352 call PART_UpdateResumeBIOSName 353 ret 354 PRECRAP_Main EndP 355 356 AFTERCRAP_Main Proc Near 357 ; =================================================== 358 ; Now get volume label of FloppyDrive, if wanted... 359 ; =================================================== 360 test CFG_FloppyBootGetName, 1 361 jz ACM_NoFloppyGetName 362 call DriveIO_UpdateFloppyName 363 or ax, ax 364 jnz ACM_NoFloppyGetName 365 ; Try a second time, if it failed to detect the Floppy 366 call DriveIO_UpdateFloppyName 367 ACM_NoFloppyGetName: 368 ret 369 AFTERCRAP_Main EndP 373 370 374 371 PRECRAP_CheckFor13extensions Proc Near 375 mov ah, 41h376 mov bx, 55AAh377 mov dl, 80h378 int 13h379 cmp bx, 0AA55h380 je PCCF13E_Found381 PCCF13E_NotFound:382 ret383 PCCF13E_Found:384 and cx, 1385 jz PCCF13E_NotFound386 mov CurIO_UseExtension, 1387 ret372 mov ah, 41h 373 mov bx, 55AAh 374 mov dl, 80h 375 int 13h 376 cmp bx, 0AA55h 377 je PCCF13E_Found 378 PCCF13E_NotFound: 379 ret 380 PCCF13E_Found: 381 and cx, 1 382 jz PCCF13E_NotFound 383 mov CurIO_UseExtension, 1 384 ret 388 385 PRECRAP_CheckFor13extensions EndP 386 389 387 390 388 ; Checks Configuration CheckSum...Displays message, if failed. 391 389 PRECRAP_CheckConfiguration Proc Near Uses ds si es di 392 mov si, offset Configuration393 xor bx, bx394 395 ; Changed from 5 to calculated value (not here, see compat. issue below)396 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"397 ; Size of the ab-configuration in 512 byte sectors398 ;mov cx, (MBR_BackUpMBR - Configuration) / 200h399 400 ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum.401 ; AB v1.0.8 *should* stores a 7 sector configuration with a402 ; 7 sector checksum.403 ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8404 ; config as corrupted, while this is not the case.405 ; So, for compatibility reasons, in v1.0.8, the checksum stored is over406 ; 5 sectors, to be compatible with v1.07.407 ; This may change (be corrected) in future versions !408 mov cx,5409 410 mov dx, CFG_CheckConfig411 mov CFG_CheckConfig, bx412 PCCC_Loop:413 call MBR_GetCheckOfSector414 loop PCCC_Loop415 cmp bx, dx416 jne PCCC_Failed417 mov CFG_CheckConfig, dx418 ret419 PCCC_Failed:420 mov si, offset TXT_ERROR_CheckConfig421 call MBR_Teletype422 mov si, offset TXT_ERROR_CheckFailed423 call MBR_Teletype424 jmp MBR_HaltSystem390 mov si, offset Configuration 391 xor bx, bx 392 393 ; Changed from 5 to calculated value (not here, see compat. issue below) 394 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 395 ; Size of the ab-configuration in 512 byte sectors 396 ; mov cx, (MBR_BackUpMBR - Configuration) / 200h 397 398 ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum. 399 ; AB v1.0.8 *should* stores a 7 sector configuration with a 400 ; 7 sector checksum. 401 ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8 402 ; config as corrupted, while this is not the case. 403 ; So, for compatibility reasons, in v1.0.8, the checksum stored is over 404 ; 5 sectors, to be compatible with v1.07. 405 ; This may change (be corrected) in future versions ! 406 mov cx,5 407 408 mov dx, CFG_CheckConfig 409 mov CFG_CheckConfig, bx 410 PCCC_Loop: 411 call MBR_GetCheckOfSector 412 loop PCCC_Loop 413 cmp bx, dx 414 jne PCCC_Failed 415 mov CFG_CheckConfig, dx 416 ret 417 PCCC_Failed: 418 mov si, offset TXT_ERROR_CheckConfig 419 call MBR_Teletype 420 mov si, offset TXT_ERROR_CheckFailed 421 call MBR_Teletype 422 jmp MBR_HaltSystem 425 423 PRECRAP_CheckConfiguration EndP 426 424 … … 430 428 ; Destroyed: SI 431 429 ; Fixme: Uses double writes to use attribute with teletype-function. 432 MBR_TeletypeBold Proc Near Uses ax bx cx 433 MBRT_LoopBold: 434 lodsb 435 or al, al 436 jz MBRT_EndBold 437 push ax 438 mov ah,09h 439 mov bx,15 440 mov cx,1 441 int 10h 442 pop ax 443 mov ah,0eh 444 mov bx,7 ; Does not do anything in text-modus 445 mov cx,1 446 int 10h 447 jmp MBRT_LoopBold 448 MBRT_EndBold: 449 ret 450 MBR_TeletypeBold EndP 430 MBR_TeletypeBold Proc Near Uses ax bx cx 431 MBRT_LoopBold: 432 lodsb 433 or al, al 434 jz MBRT_EndBold 435 push ax 436 mov ah,09h 437 mov bx,15 438 mov cx,1 439 int 10h 440 pop ax 441 mov ah,0eh 442 mov bx,7 ; Does not do anything in text-modus 443 mov cx,1 444 int 10h 445 jmp MBRT_LoopBold 446 MBRT_EndBold: 447 ret 448 MBR_TeletypeBold EndP 449 451 450 452 451 ; In: SI - Pointer to begin of string (EOS is 0) 453 452 ; Destroyed: SI 454 453 ; Fixme: Uses double writes to use attribute with teletype-function. 455 MBR_TeletypeVolName 456 mov cx, 11457 MBRT_LoopVolName:458 mov dx,cx ; Backup counter459 lodsb460 or al, al461 jz MBRT_EndVolName462 push ax463 mov ah,09h464 mov bx,15465 mov cx,1466 int 10h ; DX is preserved467 pop ax468 mov ah,0eh469 mov bx,7 ; Does not do anything in text-modus470 mov cx,1471 int 10h ; DX is preserved472 mov cx,dx ; Restore counter473 loop MBRT_LoopVolName474 MBRT_EndVolName:475 ret476 MBR_TeletypeVolName 454 MBR_TeletypeVolName Proc Near Uses ax bx cx 455 mov cx, 11 456 MBRT_LoopVolName: 457 mov dx,cx ; Backup counter 458 lodsb 459 or al, al 460 jz MBRT_EndVolName 461 push ax 462 mov ah,09h 463 mov bx,15 464 mov cx,1 465 int 10h ; DX is preserved 466 pop ax 467 mov ah,0eh 468 mov bx,7 ; Does not do anything in text-modus 469 mov cx,1 470 int 10h ; DX is preserved 471 mov cx,dx ; Restore counter 472 loop MBRT_LoopVolName 473 MBRT_EndVolName: 474 ret 475 MBR_TeletypeVolName EndP 477 476 478 477 ; Rousseau: added 479 478 ; Move cursor to next line 480 479 ; Just do a new-line if SI==0 481 MBR_TeletypeNL 482 test si,si483 jz MBR_TeletypeNL_NL484 call MBR_Teletype485 MBR_TeletypeNL_NL:486 push si487 mov si, offset NL488 call MBR_Teletype489 pop si490 ret491 MBR_TeletypeNL 480 MBR_TeletypeNL Proc Near Uses ax bx cx 481 test si,si 482 jz MBR_TeletypeNL_NL 483 call MBR_Teletype 484 MBR_TeletypeNL_NL: 485 push si 486 mov si, offset NL 487 call MBR_Teletype 488 pop si 489 ret 490 MBR_TeletypeNL EndP 492 491 493 492 ; Sync teletype position to VideoIO 494 493 MBR_TeletypeSyncPos Proc Near Uses ax bx cx dx 495 pushf496 movbh, 0497 movah, 02h498 movdh,[TextPosY]499 movdl,[TextPosX]500 int10h501 popf502 ret494 pushf 495 mov bh, 0 496 mov ah, 02h 497 mov dh,[TextPosY] 498 mov dl,[TextPosX] 499 int 10h 500 popf 501 ret 503 502 MBR_TeletypeSyncPos EndP -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r40 r43 1620 1620 1621 1621 1622 IFDEF AuxDebug 1623 ; call DEBUG_Dump2 1622 IFDEF AUX_DEBUG 1623 call DEBUG_Dump2 1624 call DEBUG_DumpBSSSectors 1624 1625 ENDIF 1625 1626 -
trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
r40 r43 29 29 30 30 PARTSCAN_ScanForPartitions Proc Near 31 ; Reset X-Reference 32 call PARTSCAN_ResetXref 33 34 mov dh, TotalHarddiscs 35 xor al, al 36 mov NewPartitions, al 37 38 mov CurIO_Scanning, 1 ; Set flag due scanning partitions 39 mov dl, 80h ; is first harddisc 40 PSSFP_HarddiscLoop: 41 push dx 42 call PARTSCAN_ScanDriveForPartitions 43 pop dx 44 inc dl 45 dec dh 46 jnz PSSFP_HarddiscLoop 47 mov CurIO_Scanning, 0 ; Reset flag due scanning complete 48 49 ; Use X-Reference to sync NewPartitionTable with Hide-Config 50 call PARTSCAN_SyncHideConfigWithXref 51 52 ; Now we copy the new IPT over the old one... 53 mov si, offset NewPartTable 54 mov di, offset PartitionTable 55 ;movzx ax, NewPartitions 56 mov al,NewPartitions 57 mov ah,0 58 59 mov CFG_Partitions, al 60 mov bl, LocIPT_LenOfIPT 61 mul bl 62 mov cx, ax 63 rep movsb 64 65 ; and the New Logical Drive Letter table as well... 66 mov si, offset NewDriveLetters 67 mov di, offset DriveLetters 68 mov cx, LocIPT_MaxPartitions 69 rep movsb 31 ; Reset X-Reference 32 call PARTSCAN_ResetXref 33 34 mov dh, TotalHarddiscs 35 xor al, al 36 mov NewPartitions, al 37 38 mov CurIO_Scanning, 1 ; Set flag due scanning partitions 39 mov dl, 80h ; is first harddisc 40 PSSFP_HarddiscLoop: 41 42 push dx 43 call PARTSCAN_ScanDriveForPartitions 44 pop dx 45 inc dl 46 dec dh 47 jnz PSSFP_HarddiscLoop 48 mov CurIO_Scanning, 0 ; Reset flag due scanning complete 49 50 ; Use X-Reference to sync NewPartitionTable with Hide-Config 51 call PARTSCAN_SyncHideConfigWithXref 52 53 ; Now we copy the new IPT over the old one... 54 mov si, offset NewPartTable 55 mov di, offset PartitionTable 56 ;movzx ax, NewPartitions 57 mov al,NewPartitions 58 mov ah,0 59 60 mov CFG_Partitions, al 61 mov bl, LocIPT_LenOfIPT 62 mul bl 63 mov cx, ax 64 rep movsb 65 66 ; and the New Logical Drive Letter table as well... 67 mov si, offset NewDriveLetters 68 mov di, offset DriveLetters 69 mov cx, LocIPT_MaxPartitions 70 rep movsb 70 71 71 72 ; [Linux support removed since v1.02] … … 86 87 ; mov GotLinux, dl ; Set Flag 87 88 88 ; ...and finally check, if we need to set a Drive-Letter89 mov dl, AutoDrvLetter90 or dl, dl91 jz PSSFP_NoAutoDriveLetter92 ;movzx cx, CFG_Partitions93 mov cl,CFG_Partitions94 mov ch,095 96 or cx, cx97 jz PSSFP_NoAutoDriveLetter98 mov si, offset PartitionTable99 mov di, offset DriveLetters100 mov ax, wptr [AutoDrvLetterSerial]101 mov bx, wptr [AutoDrvLetterSerial+2]102 PSSFP_AutoDrvLetterLoop:103 cmp ax, [si+LocIPT_Serial]104 jne PSSFP_AutoDrvLetterNoMatch105 cmp bx, [si+LocIPT_Serial+2]106 jne PSSFP_AutoDrvLetterNoMatch107 ; We got a match, so set Drive-Letter in DL108 or bptr [si+LocIPT_Flags], Flags_DriveLetter109 mov [di], dl110 111 add si, LocIPT_LenOfIPT112 inc di113 loop PSSFP_AutoDrvLetterLoop114 mov AutoDrvLetter, 0 ; Disable after processing...115 PSSFP_NoAutoDriveLetter:116 ret89 ; ...and finally check, if we need to set a Drive-Letter 90 mov dl, AutoDrvLetter 91 or dl, dl 92 jz PSSFP_NoAutoDriveLetter 93 ;movzx cx, CFG_Partitions 94 mov cl,CFG_Partitions 95 mov ch,0 96 97 or cx, cx 98 jz PSSFP_NoAutoDriveLetter 99 mov si, offset PartitionTable 100 mov di, offset DriveLetters 101 mov ax, wptr [AutoDrvLetterSerial] 102 mov bx, wptr [AutoDrvLetterSerial+2] 103 PSSFP_AutoDrvLetterLoop: 104 cmp ax, [si+LocIPT_Serial] 105 jne PSSFP_AutoDrvLetterNoMatch 106 cmp bx, [si+LocIPT_Serial+2] 107 jne PSSFP_AutoDrvLetterNoMatch 108 ; We got a match, so set Drive-Letter in DL 109 or bptr [si+LocIPT_Flags], Flags_DriveLetter 110 mov [di], dl 111 PSSFP_AutoDrvLetterNoMatch: 112 add si, LocIPT_LenOfIPT 113 inc di 114 loop PSSFP_AutoDrvLetterLoop 115 mov AutoDrvLetter, 0 ; Disable after processing... 116 PSSFP_NoAutoDriveLetter: 117 ret 117 118 PARTSCAN_ScanForPartitions EndP 118 119 … … 121 122 ; falls eine Extended Partition (DOS) gefunden wird, wird erneut gescannt. 122 123 PARTSCAN_ScanDriveForPartitions Proc Near 123 xor ax, ax124 xor bx, bx ; Location Absoluter Sektor 0125 mov cx, 0001h126 xor dh, dh ; Location Zylinder 0, Side 0, Sektor 1 MBR127 mov [ExtendedAbsPosSet], al128 mov wptr [ExtendedAbsPos+0], ax129 mov wptr [ExtendedAbsPos+2], ax130 PSSDFP_LoadThisPartition:131 132 call DriveIO_LoadPartition ; Load a partition record133 134 jc PSSDFP_InvalidPartition135 136 ; LVM Support - Reads LVM Information Sector137 call DriveIO_LoadLVMSector ; Load LVM sector138 139 call PARTSCAN_ScanPartition140 IFDEF ReleaseCode141 call DriveIO_SavePartition142 ENDIF143 call PARTSCAN_ScanPartitionForExtended144 jc PSSDFP_LoadThisPartition145 PSSDFP_InvalidPartition:146 ret124 xor ax, ax 125 xor bx, bx ; Location Absoluter Sektor 0 126 mov cx, 0001h 127 xor dh, dh ; Location Zylinder 0, Side 0, Sektor 1 MBR 128 mov [ExtendedAbsPosSet], al 129 mov wptr [ExtendedAbsPos+0], ax 130 mov wptr [ExtendedAbsPos+2], ax 131 PSSDFP_LoadThisPartition: 132 133 call DriveIO_LoadPartition ; Load a partition record 134 135 jc PSSDFP_InvalidPartition 136 137 ; LVM Support - Reads LVM Information Sector 138 call DriveIO_LoadLVMSector ; Load LVM sector 139 140 call PARTSCAN_ScanPartition 141 IFDEF ReleaseCode 142 call DriveIO_SavePartition 143 ENDIF 144 call PARTSCAN_ScanPartitionForExtended 145 jc PSSDFP_LoadThisPartition 146 PSSDFP_InvalidPartition: 147 ret 147 148 PARTSCAN_ScanDriveForPartitions EndP 148 149 … … 150 151 ; be set to this location and Carry will be set 151 152 PARTSCAN_ScanPartitionForExtended Proc Near Uses si 152 mov si, offset PartitionSector+446 ; DS:SI - 1st partition entry153 xor ax, ax154 PSSPFE_ScanLoop:155 mov al, [si+LocBRPT_SystemID]156 cmp al, 5 ; Is Partition EXTENDED ?157 je PSSPFE_ExtendedPartition158 cmp al, 0Fh ; Is Partition EXTENDED (M$) ?159 je PSSPFE_ExtendedPartition160 jmp PSSPFE_IgnorePartition161 PSSPFE_ExtendedPartition:162 mov ax, wptr [si+LocBRPT_RelativeBegin]163 mov bx, wptr [si+LocBRPT_RelativeBegin+2]164 add ax, wptr [ExtendedAbsPos+0] ; Adjust...165 adc bx, wptr [ExtendedAbsPos+2] ; (Shit Design!)166 test [ExtendedAbsPosSet], 1167 jnz PSSPFE_ExtendedMainKnown168 mov wptr [ExtendedAbsPos+0], ax169 mov wptr [ExtendedAbsPos+2], bx170 mov [ExtendedAbsPosSet], 1171 PSSPFE_ExtendedMainKnown:172 mov cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector173 mov dh, bptr [si+LocBRPT_BeginHead] ; Head174 mov dl, bptr [CurPartition_Location+4] ; Drive175 stc176 jmp PSSPFE_EndOfSearch177 PSSPFE_IgnorePartition:178 add si, LocBRPT_LenOfEntry179 cmp si, 500+offset PartitionSector180 jb PSSPFE_ScanLoop181 clc182 PSSPFE_EndOfSearch:183 ret153 mov si, offset PartitionSector+446 ; DS:SI - 1st partition entry 154 xor ax, ax 155 PSSPFE_ScanLoop: 156 mov al, [si+LocBRPT_SystemID] 157 cmp al, 5 ; Is Partition EXTENDED ? 158 je PSSPFE_ExtendedPartition 159 cmp al, 0Fh ; Is Partition EXTENDED (M$) ? 160 je PSSPFE_ExtendedPartition 161 jmp PSSPFE_IgnorePartition 162 PSSPFE_ExtendedPartition: 163 mov ax, wptr [si+LocBRPT_RelativeBegin] 164 mov bx, wptr [si+LocBRPT_RelativeBegin+2] 165 add ax, wptr [ExtendedAbsPos+0] ; Adjust... 166 adc bx, wptr [ExtendedAbsPos+2] ; (Shit Design!) 167 test [ExtendedAbsPosSet], 1 168 jnz PSSPFE_ExtendedMainKnown 169 mov wptr [ExtendedAbsPos+0], ax 170 mov wptr [ExtendedAbsPos+2], bx 171 mov [ExtendedAbsPosSet], 1 172 PSSPFE_ExtendedMainKnown: 173 mov cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector 174 mov dh, bptr [si+LocBRPT_BeginHead] ; Head 175 mov dl, bptr [CurPartition_Location+4] ; Drive 176 stc 177 jmp PSSPFE_EndOfSearch 178 PSSPFE_IgnorePartition: 179 add si, LocBRPT_LenOfEntry 180 cmp si, 500+offset PartitionSector 181 jb PSSPFE_ScanLoop 182 clc 183 PSSPFE_EndOfSearch: 184 ret 184 185 PARTSCAN_ScanPartitionForExtended EndP 185 186 186 187 ; The following routines have NOT *DS* set to CS, so we must address via ES 187 188 PARTSCAN_ScanPartition Proc Near Uses ax si 188 mov si, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry 189 PSSP_ScanLoop: 190 mov al, bptr [si+LocBRPT_SystemID] 191 cmp al, 5 ; Is Partition EXTENDED ? 192 je PSSP_IgnorePartition 193 cmp al, 0Fh ; Is Partition EXTENDED (M$-DOS7) ? 194 je PSSP_IgnorePartition 195 cmp al, 0 ; Is Partition EMPTY ? 196 je PSSP_IgnorePartition 197 ; Ignore these partitions, because there are no real Partitions 198 call PARTSCAN_CheckThisPartition 199 PSSP_IgnorePartition: 200 ; Lscht das Boot-Able Flag... 201 and byte ptr [si+LocBRPT_Flags], 7Fh ; Reset the Active-Flag 202 add si, LocBRPT_LenOfEntry ; 16 Bytes per partition entry 203 cmp si, 500+offset PartitionSector 204 jb PSSP_ScanLoop 205 ; If we are on first HDD and in primary partition table -> mark primary 206 cmp bptr [CurPartition_Location+4], 80h ; Drive 207 jne PSSP_NoMarkPrimary 208 cmp wptr [CurPartition_Location+0], 0 209 jne PSSP_NoMarkPrimary 210 cmp wptr [CurPartition_Location+2], 0 ; Absolute Location 211 jne PSSP_NoMarkPrimary 212 call PART_MarkFirstGoodPrimary 213 PSSP_NoMarkPrimary: 214 ret 189 mov si, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry 190 PSSP_ScanLoop: 191 mov al, bptr [si+LocBRPT_SystemID] 192 cmp al, 5 ; Is Partition EXTENDED ? 193 je PSSP_IgnorePartition 194 cmp al, 0Fh ; Is Partition EXTENDED (M$-DOS7) ? 195 je PSSP_IgnorePartition 196 cmp al, 0 ; Is Partition EMPTY ? 197 je PSSP_IgnorePartition 198 ; Ignore these partitions, because there are no real Partitions 199 call DEBUG_DumpBSSSectors 200 call PARTSCAN_CheckThisPartition 201 call DEBUG_DumpBSSSectors 202 PSSP_IgnorePartition: 203 ; Lscht das Boot-Able Flag... 204 and byte ptr [si+LocBRPT_Flags], 7Fh ; Reset the Active-Flag 205 add si, LocBRPT_LenOfEntry ; 16 Bytes per partition entry 206 cmp si, 500+offset PartitionSector 207 jb PSSP_ScanLoop 208 ; If we are on first HDD and in primary partition table -> mark primary 209 cmp bptr [CurPartition_Location+4], 80h ; Drive 210 jne PSSP_NoMarkPrimary 211 cmp wptr [CurPartition_Location+0], 0 212 jne PSSP_NoMarkPrimary 213 cmp wptr [CurPartition_Location+2], 0 ; Absolute Location 214 jne PSSP_NoMarkPrimary 215 call PART_MarkFirstGoodPrimary 216 PSSP_NoMarkPrimary: 217 ret 215 218 PARTSCAN_ScanPartition EndP 216 219 … … 223 226 ; In: SI - Points to Partition-Entry (16-Bytes) 224 227 PARTSCAN_CheckThisPartition Proc Near Uses di si 225 local PartSystemID:byte, PartTypeFlags:byte 226 local PartCRC:word, PartPtr:word 227 228 mov wptr [PartPtr], si ; Save Pointer to PartitionEntry 229 230 mov al, bptr [si+LocBRPT_SystemID] 231 mov PartSystemID, al 232 233 mov cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector 234 mov dh, bptr [si+LocBRPT_BeginHead] ; Head 235 mov dl, bptr [CurPartition_Location+4] ; Drive 236 mov ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector 237 mov bx, wptr [si+LocBRPT_RelativeBegin+2] 238 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 239 adc bx, wptr [CurPartition_Location+2] ; sectors 240 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !! 241 ; Sets up DS:SI - TmpSector 242 243 push si 244 mov bx, 4B4Dh ; Magic 'MK' :) 245 call MBR_GetCheckOfSector 246 mov PartCRC, bx ; Save Partition's-CRC 247 248 ; ------------------------------ Gets internal infos of partition type 249 mov al, PartSystemID 250 call PART_SearchFileSysName 251 ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSystemNamePtr 252 mov di, si 253 mov PartTypeFlags, ah 254 mov PartSystemID, al ; Use Unhidden-ID 255 pop si 256 257 ;================================ 258 ; AL - File System ID (Unhidden) 259 ; AH - File System Flags 260 ; SI - Boot-Record of Partition 261 ; DI - File System Name 262 ;================================ 263 264 cmp PartSystemID, 07h ; We got IFS here? 265 jne PCCTP_IFSdone 266 ; Check, if 'JFS ' is at DWORD offset 36h ; Rousseau: JFS check (LVM / IPT?) 267 cmp wptr [si+36h], 'FJ' 268 jne PCCTP_IFSnoJFS 269 cmp wptr [si+38h], ' S' 270 jne PCCTP_IFSnoJFS 271 mov PartSystemID, 0FCh ; FC is JFS internally 272 jmp PCCTP_IFSdone 273 PCCTP_IFSnoJFS: 274 ; Check, if 'HPFS' is at DWORD offset 36h 275 cmp wptr [si+36h], 'PH' 276 jne PCCTP_ProbablyNTFS 277 cmp wptr [si+38h], 'SF' 278 je PCCTP_IFSdone ; 07 is HPFS internally 279 PCCTP_ProbablyNTFS: 280 inc PartSystemID ; 08 is NTFS instead of 07 281 PCCTP_IFSdone: 282 283 ; First check, if LVM Information Sector is available and this partition 284 ; is supported. 285 push ax 286 push dx 287 push si 288 push di 289 mov si, wptr [PartPtr] 290 mov ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector 291 mov dx, wptr [si+LocBRPT_RelativeBegin+2] 292 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 293 adc dx, wptr [CurPartition_Location+2] ; sectors 294 mov si, offset LVMSector 295 call LVM_SearchForPartition ; Search for DX:AX partition 296 jnc PCCTP_CheckBootRecord 297 ; Check, if volume has driveletter assigned and remember it for later 298 mov al, [si+LocLVM_VolumeLetter] 299 or al, al 300 jnz PCCTP_HasVolumeLetter 301 mov al, 1 ; 0 would mean "not LVM supported" 302 PCCTP_HasVolumeLetter: 303 ; Save VolumeLetter in separate table 304 ;movzx bx, NewPartitions ; NewPartitions is one behind here, so 305 mov bl,NewPartitions ; NewPartitions is one behind here, so 306 mov bh,0 307 308 mov [PartitionVolumeLetters+bx], al ; it's already a zero-based offset 309 ; Now copy VolumeID and VolumeName to temporary space 310 mov di, offset MBR_NoName_Patched 311 mov ax, [si+LocLVM_PartitionID] 312 stosw 313 mov ax, [si+LocLVM_PartitionID+2] 314 stosw 315 ; Set Serial-Field to LVM-VolumeID 316 317 push di 318 add si, LocLVM_VolumeName ; Use LVM VolumeName 319 ;add si, LocLVM_PartitionName ; Use LVM PartitionName 320 mov cx, 5 321 rep movsw ; Copy LVM-PartitionName to Temp Space 322 movsb ; (11 bytes in total) 323 pop di 324 325 326 ; Check if this is an IBM-BM partition 327 cmp PartSystemID, 0ah 328 jne PCCTP_NoIbmBm 329 330 ; It is, so override the name given by IBM-BM by one that 331 ; fits in 11 chars. 332 mov si, offset ibm_bm_name 333 mov cx,5 334 rep movsw 335 movsb 336 337 338 339 PCCTP_NoIbmBm: 340 pop di 341 pop si 342 pop dx 343 pop ax 344 mov si, offset MBR_NoName_Patched 345 xor ah, ah ; no Flags_NoPartName 346 jmp PCCTP_NameSearchInIPT 347 348 PCCTP_CheckBootRecord: 349 pop di 350 pop si 351 pop dx 352 pop ax 353 test ah, FileSysFlags_NoName ; No-Name-Flag ? -> No Partition Name 354 355 jz PCCTP_ThereIsAName 356 jmp PCCTP_ThereIsNoName ; available 357 358 PCCTP_ThereIsAName: 359 360 ; We check for NTFS (got detected a little bit earlier in this routine) 361 cmp PartSystemID, 08h ; We got IFS/NTFS here? 362 jne PCCTP_IsNoNTFS 363 jmp PCCTP_ThereIsNoName ; NTFS has no volume label 364 PCCTP_IsNoNTFS: 365 add si, 2Bh ; DS:SI - Partition-Name 366 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting ? 367 368 jz PCCTP_ResumeNormal 369 370 add si, 1Ch ; Fix for FAT 32, shiat 371 PCCTP_ResumeNormal: 372 mov cx, 11 ; 11 bytes length 373 call PART_CheckForValidPartName 374 jc PCCTP_ThereIsAName2 375 376 jmp PCCTP_ThereIsNoName 377 378 PCCTP_ThereIsAName2: 228 local PartSystemID:byte, PartTypeFlags:byte 229 local PartCRC:word, PartPtr:word 230 231 mov wptr [PartPtr], si ; Save Pointer to PartitionEntry 232 233 mov al, bptr [si+LocBRPT_SystemID] 234 mov PartSystemID, al 235 236 mov cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector 237 mov dh, bptr [si+LocBRPT_BeginHead] ; Head 238 mov dl, bptr [CurPartition_Location+4] ; Drive 239 mov ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector 240 mov bx, wptr [si+LocBRPT_RelativeBegin+2] 241 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 242 adc bx, wptr [CurPartition_Location+2] ; sectors 243 244 ; Sets up DS:SI - TmpSector 245 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !! 246 247 248 249 push si 250 mov bx, 4B4Dh ; Magic 'MK' :) 251 call MBR_GetCheckOfSector 252 mov PartCRC, bx ; Save Partition's-CRC 253 254 ; ------------------------------ Gets internal infos of partition type 255 mov al, PartSystemID 256 call PART_SearchFileSysName 257 ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSystemNamePtr 258 mov di, si 259 mov PartTypeFlags, ah 260 mov PartSystemID, al ; Use Unhidden-ID 261 pop si 262 263 ;================================ 264 ; AL - File System ID (Unhidden) 265 ; AH - File System Flags 266 ; SI - Boot-Record of Partition 267 ; DI - File System Name 268 ;================================ 269 270 cmp PartSystemID, 07h ; We got IFS here? 271 jne PCCTP_IFSdone 272 ; Check, if 'JFS ' is at DWORD offset 36h ; Rousseau: JFS check (LVM / IPT?) 273 cmp wptr [si+36h], 'FJ' 274 jne PCCTP_IFSnoJFS 275 cmp wptr [si+38h], ' S' 276 jne PCCTP_IFSnoJFS 277 mov PartSystemID, 0FCh ; FC is JFS internally 278 jmp PCCTP_IFSdone 279 PCCTP_IFSnoJFS: 280 ; Check, if 'HPFS' is at DWORD offset 36h 281 cmp wptr [si+36h], 'PH' 282 jne PCCTP_ProbablyNTFS 283 cmp wptr [si+38h], 'SF' 284 je PCCTP_IFSdone ; 07 is HPFS internally 285 PCCTP_ProbablyNTFS: 286 inc PartSystemID ; 08 is NTFS instead of 07 287 PCCTP_IFSdone: 288 289 290 ; First check, if LVM Information Sector is available and this partition 291 ; is supported. 292 push ax 293 push dx 294 push si 295 push di 296 mov si, wptr [PartPtr] 297 mov ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector 298 mov dx, wptr [si+LocBRPT_RelativeBegin+2] 299 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 300 adc dx, wptr [CurPartition_Location+2] ; sectors 301 mov si, offset LVMSector 302 call LVM_SearchForPartition ; Search for DX:AX partition 303 jnc PCCTP_CheckBootRecord 304 ; Check, if volume has driveletter assigned and remember it for later 305 mov al, [si+LocLVM_VolumeLetter] 306 or al, al 307 jnz PCCTP_HasVolumeLetter 308 mov al, 1 ; 0 would mean "not LVM supported" 309 PCCTP_HasVolumeLetter: 310 ; Save VolumeLetter in separate table 311 ;movzx bx, NewPartitions ; NewPartitions is one behind here, so 312 mov bl,NewPartitions ; NewPartitions is one behind here, so 313 mov bh,0 314 315 mov [PartitionVolumeLetters+bx], al ; it's already a zero-based offset 316 ; Now copy VolumeID and VolumeName to temporary space 317 mov di, offset MBR_NoName_Patched 318 mov ax, [si+LocLVM_PartitionID] 319 stosw 320 mov ax, [si+LocLVM_PartitionID+2] 321 stosw 322 ; Set Serial-Field to LVM-VolumeID 323 324 push di 325 add si, LocLVM_VolumeName ; Use LVM VolumeName 326 ;add si, LocLVM_PartitionName ; Use LVM PartitionName 327 mov cx, 5 328 rep movsw ; Copy LVM-PartitionName to Temp Space 329 movsb ; (11 bytes in total) 330 pop di 331 332 333 ; Check if this is an IBM-BM partition 334 cmp PartSystemID, 0ah 335 jne PCCTP_NoIbmBm 336 337 ; It is, so override the name given by IBM-BM by one that 338 ; fits in 11 chars. 339 mov si, offset ibm_bm_name 340 mov cx,5 341 rep movsw 342 movsb 343 344 345 346 PCCTP_NoIbmBm: 347 pop di 348 pop si 349 pop dx 350 pop ax 351 mov si, offset MBR_NoName_Patched 352 xor ah, ah ; no Flags_NoPartName 353 jmp PCCTP_NameSearchInIPT 354 355 PCCTP_CheckBootRecord: 356 pop di 357 pop si 358 pop dx 359 pop ax 360 361 test ah, FileSysFlags_NoName ; No-Name-Flag ? -> No Partition Name 362 363 jz PCCTP_ThereIsAName 364 jmp PCCTP_ThereIsNoName ; available 365 366 PCCTP_ThereIsAName: 367 368 ; We check for NTFS (got detected a little bit earlier in this routine) 369 cmp PartSystemID, 08h ; We got IFS/NTFS here? 370 jne PCCTP_IsNoNTFS 371 jmp PCCTP_ThereIsNoName ; NTFS has no volume label 372 PCCTP_IsNoNTFS: 373 add si, 2Bh ; DS:SI - Partition-Name 374 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting ? 375 376 jz PCCTP_ResumeNormal 377 378 add si, 1Ch ; Fix for FAT 32, shiat 379 PCCTP_ResumeNormal: 380 mov cx, 11 ; 11 bytes length 381 call PART_CheckForValidPartName 382 jc PCCTP_ThereIsAName2 383 384 jmp PCCTP_ThereIsNoName 385 386 PCCTP_ThereIsAName2: 379 387 380 388 sub si, 4 ; DS:SI -> Serial&Name (15-Bytes) … … 382 390 ; jmp PCCTP_NameSearchInIPT 383 391 384 ;=======================================================385 ; NAME SEARCH in IPT-Table386 ; DS:SI - Serial&Name of Current Partition (15-Bytes)387 ; AH - NoPartName-Flag (!MUST! be merged with Flags)388 ;=======================================================389 390 xor ah, ah ; no Flags_NoPartName cause PartName valid391 mov di, offset PartitionTable ; ES:DI - IPT-Start392 mov dl, CFG_Partitions393 or dl, dl394 jnz PCCTP_SerialNameCompLoop395 jmp PCCTP_CompareFailed396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 dec dl417 jnz PCCTP_SerialNameCompLoop418 419 ; if we didn't find Serial&Name, let's try Name-only without Serial420 mov di, offset PartitionTable ; ES:DI - IPT-Start421 mov dl, CFG_Partitions422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 dec dl445 jnz PCCTP_NameCompLoop446 447 448 ; So finally we search for Location and PartitionID449 push si450 451 452 453 454 455 456 457 458 459 pop si460 mov di, offset PartitionTable ; ES:DI - IPT-Start461 mov dl, CFG_Partitions462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 dec dl485 jnz PCCTP_NameLocCompLoop486 ; None of the searches worked, so forget it...487 jmp PCCTP_CompareFailed488 489 PCCTP_ThereIsNoName:490 ; Try to find this partition by comparing location and PartitionID491 ; aka LocIPT_AbsoluteBegin:dword and LocIPT_SystemID492 ; If found, simply go to the normal match-routine, otherwise use the493 ; File-System-Name to build the Volume-Label for the New IPT Entry.494 mov dh, PartSystemID495 mov si, [PartPtr] ; DS:SI - Cur Partition Table496 ; Relative Sector to MBR/EPR497 mov cx, wptr [si+LocBRPT_RelativeBegin]498 mov bx, wptr [si+LocBRPT_RelativeBegin+2]499 add cx, [CurPartition_Location+0]500 add bx, [CurPartition_Location+2]501 ; Build a standard-Volume Label from FileSystemNamePtr502 ; We have to call SearchFileSysName again because of NTFS503 push ax504 push cx505 506 507 508 509 510 511 512 513 514 515 516 517 pop cx518 pop ax519 ;=======================================================520 ; LOCATION SEARCH in IPT-Table521 ; DH - PartitionID of Current Partition522 ; BX:CX - AbsoluteBegin of Current Partition523 ; AH - NoPartName-Flag (!MUST! be merged with Flags)524 ; DS:SI - Serial&Name of Current Partition (15-Bytes)525 ;=======================================================526 527 mov ah, Flags_NoPartName ;set Flags_NoPartName, PartName invalid528 mov di, offset PartitionTable ; ES:DI - IPT-Start529 mov dl, CFG_Partitions530 or dl, dl531 jz PCCTP_LocCompFailed532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 dec dl548 jnz PCCTP_LocCompLoop549 550 jmp PCCTP_CompareFailed551 552 ; ==================================553 ; =MATCH=, found partition in IPT...554 ; AH - NoPartName-Flag (!MUST! be merged with Flags)555 ; DL - IPT Partition Number from Loop (inverted)556 ; ES:DI - LocIPT-Pointer to found IPT-entry557 ; ==================================558 PCCTP_Match:559 mov ch, ah560 ; Save the new location of this partition in the Xref-Table561 ; for converting HideConfig.562 mov dh, dl563 mov dl, CFG_Partitions564 sub dl, dh565 mov dh, NewPartitions ; is actually a counter566 call PARTSCAN_DefXref ; DL-IPT-Partition, DH-NewPartition567 568 ; Get Saved-Flags...569 mov cl, bptr [di+LocIPT_Flags] ; Use saved Flags570 571 ; ...and Saved-CRC if available...572 mov ax, wptr [di+LocIPT_BootRecordCRC]573 or ax, ax574 jz PCCTP_UseNewComputedCRC575 mov PartCRC, ax ; Use saved IPT-CRC576 PCCTP_UseNewComputedCRC:577 ; ...and mark partition in IPT as already found578 or bptr [di+LocIPT_Flags], Flags_NowFound579 ; ...get Serial&Name from IPT-table...580 mov si, di581 add si, LocIPT_Serial ; DS:SI - LocIPT-Serial&Name582 jmp PCCTP_AddToNew583 584 ; =================================585 ; =FAILED= search, not found in IPT586 ; AH - NoPartName-Flag (!MUST! be merged with Flags)587 ; DS:SI - Serial&Name of Current Partition (15-Bytes)588 ; =================================589 PCCTP_CompareFailed:590 mov ch, ah591 ; Default Flags hinzufgen...592 mov cl, LocIPT_DefaultFlags593 594 mov al, PartTypeFlags595 ; May I auto-add partitions ?596 test CFG_PartitionsDetect, 1597 jz PCCTP_MayNotAddAny ; add, but non-bootable598 test al, FileSysFlags_BootAble ; AH kam von SearchFileSysName599 jnz PCCTP_PerhapsBootAble600 PCCTP_MayNotAddAny:601 mov cl, LocIPT_DefaultNonBootFlags602 PCCTP_PerhapsBootAble:603 604 ; On FAT32-partitions, default to P-Flag (which means using M$-hack)605 ; Anyway, this hack has to be globaly activated by the user manually...606 cmp PartSystemID, 09h ; Hardcoded: FAT32607 je PCCTP_NeedsExtMShack608 cmp PartSystemID, 0Bh609 je PCCTP_NeedsExtMShack610 cmp PartSystemID, 0Ch611 je PCCTP_NeedsExtMShack612 cmp PartSystemID, 0Eh ; FAT16 above 8 GB613 jne PCCTP_NoExtMShack614 ; We only get here, when the SystemID seems to be an M$ "invention"...615 616 or cl, Flags_ExtPartMShack617 PCCTP_NoExtMShack:618 619 ;================================================620 ; CL - IPT-Partition-Flags, CH - NoPartName-Flag621 ; DS:SI - PartSerial&Name (15-Bytes)622 ;================================================623 PCCTP_AddToNew:624 mov al, Flags_NoPartName ; Unset NoPartName625 not al626 and cl, al627 or cl, ch ; CL = Both CL and CH merged628 629 ; Calculate Pointer to IPT630 mov di, offset NewPartTable ; ES:DI - NewPartTable631 ;movzx ax, NewPartitions632 mov al,NewPartitions633 mov ah,0634 635 mov bl, LocIPT_LenOfIPT636 mul bl637 add di, ax ; ES:DI - Last+1 Entry of NewPartTable638 639 ; Now finally write this partition to our IPT640 ;=============================================641 push cx642 mov cx, 15 ; Copy Serial&Name...643 rep movsb644 pop cx645 646 mov si, [PartPtr] ; DS:SI - Cur Partition Entry647 mov al, bptr [CurPartition_Location+4] ; Drive648 stosb649 mov al, PartSystemID ; Unhidden SystemID650 stosb651 mov al, cl ; Partition-Flags from register...652 stosb653 mov ax, PartCRC ; BootRecordCRC...654 stosw655 mov al, bptr [si+LocBRPT_BeginHead]656 stosb657 mov ax, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector658 stosw659 mov al, bptr [CurPartition_Location+5] ; Head of Part-Table660 stosb661 mov ax, wptr [CurPartition_Location+6] ; Cylinder/Sector662 stosw663 mov ax, wptr [si+LocBRPT_RelativeBegin]664 mov bx, wptr [si+LocBRPT_RelativeBegin+2]665 mov cx, wptr [CurPartition_Location+0] ; +Partition-Absolute666 mov dx, wptr [CurPartition_Location+2] ; sectors667 add ax, cx668 adc bx, dx669 stosw670 mov ax, bx671 stosw672 mov ax, cx ; Absolute sector of partition table673 stosw674 mov ax, dx675 stosw676 inc NewPartitions ; NEW IPT Entry DONE677 678 cmp NewPartitions, LocIPT_MaxPartitions679 jbe PCCTP_NotTooManyPartitions680 681 mov si, offset TXT_TooManyPartitions682 call MBR_Teletype683 jmp MBR_HaltSystem684 685 686 PCCTP_NotTooManyPartitions:687 ; UNHIDE PARTITION, if it was hidden previously688 mov al, PartSystemID689 cmp al, 08h ; internally IFS/NTFS?690 je PCCTP_GotInternalIFS691 cmp al, 0FCh ; internally IFS/JFS?692 jne PCCTP_NoInternalIFS693 PCCTP_GotInternalIFS:694 mov al, 07h695 PCCTP_NoInternalIFS:696 mov bptr [si+LocBRPT_SystemID], al697 698 ; Calculate Size of this partition and put it into separate table...699 ;movzx ax, NewPartitions700 mov al,NewPartitions701 mov ah,0702 703 dec ax704 mov bx, ax705 shl ax, 1706 shl bx, 2707 add ax, bx ; My way [tm] of multiplying with 6708 mov di, offset PartitionSizeTable709 add di, ax ; DI - Partition Size-Element710 mov ax, wptr [si+LocBRPT_AbsoluteLength] ; Sector-Size711 mov bx, wptr [si+LocBRPT_AbsoluteLength+2]712 call PART_FillOutSizeElement713 ret392 ;======================================================= 393 ; NAME SEARCH in IPT-Table 394 ; DS:SI - Serial&Name of Current Partition (15-Bytes) 395 ; AH - NoPartName-Flag (!MUST! be merged with Flags) 396 ;======================================================= 397 PCCTP_NameSearchInIPT: 398 xor ah, ah ; no Flags_NoPartName cause PartName valid 399 mov di, offset PartitionTable ; ES:DI - IPT-Start 400 mov dl, CFG_Partitions 401 or dl, dl 402 jnz PCCTP_SerialNameCompLoop 403 jmp PCCTP_CompareFailed 404 PCCTP_SerialNameCompLoop: 405 mov al, [di+LocIPT_Flags] 406 test al, Flags_NowFound 407 jnz PCCTP_SerialNameAlreadyFound 408 ; Now compare IPT with current Partition 409 mov cx, 15 ; Serial&Name (15-Bytes) 410 push si 411 push di 412 repz cmpsb 413 pop di 414 pop si 415 416 jne PCCTP_NoMatchYet 417 418 jmp PCCTP_Match 419 420 PCCTP_NoMatchYet: 421 422 PCCTP_SerialNameAlreadyFound: 423 add di, LocIPT_LenOfIPT 424 dec dl 425 jnz PCCTP_SerialNameCompLoop 426 427 ; if we didn't find Serial&Name, let's try Name-only without Serial 428 mov di, offset PartitionTable ; ES:DI - IPT-Start 429 mov dl, CFG_Partitions 430 PCCTP_NameCompLoop: 431 mov al, [di+LocIPT_Flags] 432 test al, Flags_NowFound 433 jnz PCCTP_NameAlreadyFound 434 ; Now compare IPT with current Partition 435 mov cx, 11 ; Name only (11-Bytes) 436 push si 437 push di 438 add si, 4 439 add di, 4 ; Skip over Serial-Field 440 repz cmpsb 441 pop di 442 pop si 443 jne PCCTP_NameNoMatch 444 mov cx, [si+0] ; Get Serial 445 mov [di+0], cx 446 mov cx, [si+2] 447 mov [di+2], cx ; ...and put it into IPT 448 jmp PCCTP_Match 449 PCCTP_NameNoMatch: 450 PCCTP_NameAlreadyFound: 451 add di, LocIPT_LenOfIPT 452 dec dl 453 jnz PCCTP_NameCompLoop 454 PCCTP_NameCompFailed: 455 456 ; So finally we search for Location and PartitionID 457 push si 458 ; Initialize some stuff for Location-Search 459 mov dh, PartSystemID 460 mov si, [PartPtr] ; DS:SI - Cur Partition Table 461 ; Relative Sector to MBR/EPR 462 mov cx, wptr [si+LocBRPT_RelativeBegin] 463 mov bx, wptr [si+LocBRPT_RelativeBegin+2] 464 add cx, [CurPartition_Location+0] 465 add bx, [CurPartition_Location+2] 466 ; BX:CX - Absolute First Sector of Partition on HDD 467 pop si 468 mov di, offset PartitionTable ; ES:DI - IPT-Start 469 mov dl, CFG_Partitions 470 PCCTP_NameLocCompLoop: 471 mov al, [di+LocIPT_Flags] 472 test al, Flags_NowFound 473 jnz PCCTP_NameLocAlreadyFound 474 ; Now compare IPT with current Partition 475 cmp dh, [di+LocIPT_SystemID] 476 jne PCCTP_NameLocMismatch 477 cmp cx, [di+LocIPT_AbsoluteBegin] 478 jne PCCTP_NameLocMismatch 479 cmp bx, [di+LocIPT_AbsoluteBegin+2] 480 jne PCCTP_NameLocMismatch 481 ; We matched location, now copy the current PartitionID and Name to 482 ; the old IPT. 483 push di 484 add di, LocIPT_Serial ; DS:SI - LocIPT-Serial&Name 485 mov cx, 15 486 rep movsb ; Copy 15 bytes 487 pop di 488 jmp PCCTP_Match 489 PCCTP_NameLocMismatch: 490 PCCTP_NameLocAlreadyFound: 491 add di, LocIPT_LenOfIPT 492 dec dl 493 jnz PCCTP_NameLocCompLoop 494 ; None of the searches worked, so forget it... 495 jmp PCCTP_CompareFailed 496 497 PCCTP_ThereIsNoName: 498 ; Try to find this partition by comparing location and PartitionID 499 ; aka LocIPT_AbsoluteBegin:dword and LocIPT_SystemID 500 ; If found, simply go to the normal match-routine, otherwise use the 501 ; File-System-Name to build the Volume-Label for the New IPT Entry. 502 mov dh, PartSystemID 503 mov si, [PartPtr] ; DS:SI - Cur Partition Table 504 ; Relative Sector to MBR/EPR 505 mov cx, wptr [si+LocBRPT_RelativeBegin] 506 mov bx, wptr [si+LocBRPT_RelativeBegin+2] 507 add cx, [CurPartition_Location+0] 508 add bx, [CurPartition_Location+2] 509 ; Build a standard-Volume Label from FileSystemNamePtr 510 ; We have to call SearchFileSysName again because of NTFS 511 push ax 512 push cx 513 mov al, dh 514 call PART_SearchFileSysName ; We want SI here <- FileSystemNamePtr 515 mov di, offset MBR_NoName_Patched 516 xor ax, ax 517 stosw 518 stosw ; Set Serial-Field to "NUL" 519 mov cx, 4 520 rep movsw ; Copy FileSystemName to Temp Space 521 xor ax, ax 522 stosw 523 stosb ; Fill last 3 bytes with "NUL" 524 mov si, offset MBR_NoName_Patched 525 pop cx 526 pop ax 527 ;======================================================= 528 ; LOCATION SEARCH in IPT-Table 529 ; DH - PartitionID of Current Partition 530 ; BX:CX - AbsoluteBegin of Current Partition 531 ; AH - NoPartName-Flag (!MUST! be merged with Flags) 532 ; DS:SI - Serial&Name of Current Partition (15-Bytes) 533 ;======================================================= 534 PCCTP_LocSearchInIPT: 535 mov ah, Flags_NoPartName ;set Flags_NoPartName, PartName invalid 536 mov di, offset PartitionTable ; ES:DI - IPT-Start 537 mov dl, CFG_Partitions 538 or dl, dl 539 jz PCCTP_LocCompFailed 540 PCCTP_LocCompLoop: 541 mov al, [di+LocIPT_Flags] 542 test al, Flags_NowFound 543 jnz PCCTP_LocAlreadyFound 544 ; Now compare IPT with current Partition 545 cmp dh, [di+LocIPT_SystemID] 546 jne PCCTP_LocMismatch 547 cmp cx, [di+LocIPT_AbsoluteBegin] 548 jne PCCTP_LocMismatch 549 cmp bx, [di+LocIPT_AbsoluteBegin+2] 550 jne PCCTP_LocMismatch 551 jmp PCCTP_Match 552 PCCTP_LocMismatch: 553 PCCTP_LocAlreadyFound: 554 add di, LocIPT_LenOfIPT 555 dec dl 556 jnz PCCTP_LocCompLoop 557 PCCTP_LocCompFailed: 558 jmp PCCTP_CompareFailed 559 560 ; ================================== 561 ; =MATCH=, found partition in IPT... 562 ; AH - NoPartName-Flag (!MUST! be merged with Flags) 563 ; DL - IPT Partition Number from Loop (inverted) 564 ; ES:DI - LocIPT-Pointer to found IPT-entry 565 ; ================================== 566 PCCTP_Match: 567 mov ch, ah 568 ; Save the new location of this partition in the Xref-Table 569 ; for converting HideConfig. 570 mov dh, dl 571 mov dl, CFG_Partitions 572 sub dl, dh 573 mov dh, NewPartitions ; is actually a counter 574 call PARTSCAN_DefXref ; DL-IPT-Partition, DH-NewPartition 575 576 ; Get Saved-Flags... 577 mov cl, bptr [di+LocIPT_Flags] ; Use saved Flags 578 579 ; ...and Saved-CRC if available... 580 mov ax, wptr [di+LocIPT_BootRecordCRC] 581 or ax, ax 582 jz PCCTP_UseNewComputedCRC 583 mov PartCRC, ax ; Use saved IPT-CRC 584 PCCTP_UseNewComputedCRC: 585 ; ...and mark partition in IPT as already found 586 or bptr [di+LocIPT_Flags], Flags_NowFound 587 ; ...get Serial&Name from IPT-table... 588 mov si, di 589 add si, LocIPT_Serial ; DS:SI - LocIPT-Serial&Name 590 jmp PCCTP_AddToNew 591 592 ; ================================= 593 ; =FAILED= search, not found in IPT 594 ; AH - NoPartName-Flag (!MUST! be merged with Flags) 595 ; DS:SI - Serial&Name of Current Partition (15-Bytes) 596 ; ================================= 597 PCCTP_CompareFailed: 598 mov ch, ah 599 ; Default Flags hinzufgen... 600 mov cl, LocIPT_DefaultFlags 601 602 mov al, PartTypeFlags 603 ; May I auto-add partitions ? 604 test CFG_PartitionsDetect, 1 605 jz PCCTP_MayNotAddAny ; add, but non-bootable 606 test al, FileSysFlags_BootAble ; AH kam von SearchFileSysName 607 jnz PCCTP_PerhapsBootAble 608 PCCTP_MayNotAddAny: 609 mov cl, LocIPT_DefaultNonBootFlags 610 PCCTP_PerhapsBootAble: 611 612 ; On FAT32-partitions, default to P-Flag (which means using M$-hack) 613 ; Anyway, this hack has to be globaly activated by the user manually... 614 cmp PartSystemID, 09h ; Hardcoded: FAT32 615 je PCCTP_NeedsExtMShack 616 cmp PartSystemID, 0Bh 617 je PCCTP_NeedsExtMShack 618 cmp PartSystemID, 0Ch 619 je PCCTP_NeedsExtMShack 620 cmp PartSystemID, 0Eh ; FAT16 above 8 GB 621 jne PCCTP_NoExtMShack 622 ; We only get here, when the SystemID seems to be an M$ "invention"... 623 PCCTP_NeedsExtMShack: 624 or cl, Flags_ExtPartMShack 625 PCCTP_NoExtMShack: 626 627 ;================================================ 628 ; CL - IPT-Partition-Flags, CH - NoPartName-Flag 629 ; DS:SI - PartSerial&Name (15-Bytes) 630 ;================================================ 631 PCCTP_AddToNew: 632 mov al, Flags_NoPartName ; Unset NoPartName 633 not al 634 and cl, al 635 or cl, ch ; CL = Both CL and CH merged 636 637 ; Calculate Pointer to IPT 638 mov di, offset NewPartTable ; ES:DI - NewPartTable 639 ;movzx ax, NewPartitions 640 mov al,NewPartitions 641 mov ah,0 642 643 mov bl, LocIPT_LenOfIPT 644 mul bl 645 add di, ax ; ES:DI - Last+1 Entry of NewPartTable 646 647 ; Now finally write this partition to our IPT 648 ;============================================= 649 push cx 650 mov cx, 15 ; Copy Serial&Name... 651 rep movsb 652 pop cx 653 654 mov si, [PartPtr] ; DS:SI - Cur Partition Entry 655 mov al, bptr [CurPartition_Location+4] ; Drive 656 stosb 657 mov al, PartSystemID ; Unhidden SystemID 658 stosb 659 mov al, cl ; Partition-Flags from register... 660 stosb 661 mov ax, PartCRC ; BootRecordCRC... 662 stosw 663 mov al, bptr [si+LocBRPT_BeginHead] 664 stosb 665 mov ax, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector 666 stosw 667 mov al, bptr [CurPartition_Location+5] ; Head of Part-Table 668 stosb 669 mov ax, wptr [CurPartition_Location+6] ; Cylinder/Sector 670 stosw 671 mov ax, wptr [si+LocBRPT_RelativeBegin] 672 mov bx, wptr [si+LocBRPT_RelativeBegin+2] 673 mov cx, wptr [CurPartition_Location+0] ; +Partition-Absolute 674 mov dx, wptr [CurPartition_Location+2] ; sectors 675 add ax, cx 676 adc bx, dx 677 stosw 678 mov ax, bx 679 stosw 680 mov ax, cx ; Absolute sector of partition table 681 stosw 682 mov ax, dx 683 stosw 684 inc NewPartitions ; NEW IPT Entry DONE 685 686 cmp NewPartitions, LocIPT_MaxPartitions 687 jbe PCCTP_NotTooManyPartitions 688 689 mov si, offset TXT_TooManyPartitions 690 call MBR_Teletype 691 jmp MBR_HaltSystem 692 693 694 PCCTP_NotTooManyPartitions: 695 ; UNHIDE PARTITION, if it was hidden previously 696 mov al, PartSystemID 697 cmp al, 08h ; internally IFS/NTFS? 698 je PCCTP_GotInternalIFS 699 cmp al, 0FCh ; internally IFS/JFS? 700 jne PCCTP_NoInternalIFS 701 PCCTP_GotInternalIFS: 702 mov al, 07h 703 PCCTP_NoInternalIFS: 704 mov bptr [si+LocBRPT_SystemID], al 705 706 ; Calculate Size of this partition and put it into separate table... 707 ;movzx ax, NewPartitions 708 mov al,NewPartitions 709 mov ah,0 710 711 dec ax 712 mov bx, ax 713 shl ax, 1 714 shl bx, 2 715 add ax, bx ; My way [tm] of multiplying with 6 716 mov di, offset PartitionSizeTable 717 add di, ax ; DI - Partition Size-Element 718 mov ax, wptr [si+LocBRPT_AbsoluteLength] ; Sector-Size 719 mov bx, wptr [si+LocBRPT_AbsoluteLength+2] 720 call PART_FillOutSizeElement 721 ret 714 722 PARTSCAN_CheckThisPartition EndP 715 723 … … 721 729 722 730 ; Reset X-Reference 723 PARTSCAN_ResetXref Proc Near Uses ax cx di 724 mov di, offset PartitionXref ; X-Reference for later syncing 725 mov cx, LocIPT_MaxPartitions 726 mov ax, 0FFFFh ; Fill up with FFh 727 rep stosb 728 mov di, offset NewHidePartTable ; Temporary Hide-Config Table 729 mov cx, LocIPT_MaxPartitions * LocIPT_LenOfIPT 730 rep stosb ; Fill up with FFFFh 731 mov di, offset NewDriveLetters 732 mov cx, LocIPT_MaxPartitions ; Temporary Logical-Drive Letter Table 733 xor ax, ax 734 rep stosb ; Fill up with 0000h 735 ret 736 PARTSCAN_ResetXref EndP 731 PARTSCAN_ResetXref Proc Near Uses ax cx di 732 mov di, offset PartitionXref ; X-Reference for later syncing 733 mov cx, LocIPT_MaxPartitions 734 mov ax, 0FFFFh ; Fill up with FFh -- Influences OVERWRITE BUG ! 735 rep stosb 736 mov di, offset NewHidePartTable ; Temporary Hide-Config Table 737 ;~ mov cx, LocIPT_MaxPartitions * LocIPT_LenOfIPT 738 mov cx, LocIPT_MaxPartitions * LocHPT_LenOfHPT ; Checken !!! 739 rep stosb ; Fill up with FFFFh 740 mov di, offset NewDriveLetters 741 mov cx, LocIPT_MaxPartitions ; Temporary Logical-Drive Letter Table 742 xor ax, ax 743 rep stosb ; Fill up with 0000h 744 ret 745 PARTSCAN_ResetXref EndP 746 747 737 748 738 749 ; In: DL - Partition Number in IPT 739 750 ; DH - Partition Number in NewPartitionTable 740 751 ; Destroyed: None 741 PARTSCAN_DefXref Proc Near Uses ax bx cx dx si di 742 ;movzx bx, dl 743 mov bl,dl 744 mov bh,0 745 746 mov bptr [PartitionXref+bx], dh ; X-Reference 747 ; Copy Hide-Config of IPT partition to new location in new table 748 mov si, offset HidePartitionTable 749 mov di, offset NewHidePartTable 750 mov bl, LocIPT_MaxPartitions 751 mov al, dl 752 mul bl 753 add si, ax 754 mov al, dh 755 mul bl 756 add di, ax 757 mov cx, LocIPT_MaxPartitions 758 rep movsb ; Copy Hide-Config to NewHideTable 759 ; Process Logical-Drive-Letter table as well... 760 ;movzx bx, dl 761 mov bl,dl 762 mov bh,0 763 764 mov al, bptr [DriveLetters+bx] ; Get Drv-Letter from org. pos 765 ;movzx bx, dh 766 mov bl,dl 767 mov bh,0 768 769 mov bptr [NewDriveLetters+bx], al ; Put Drv-Letter to new pos 770 ret 771 PARTSCAN_DefXref EndP 752 PARTSCAN_DefXref Proc Near Uses ax bx cx dx si di 753 ;movzx bx, dl 754 mov bl,dl 755 mov bh,0 756 757 mov bptr [PartitionXref+bx], dh ; X-Reference 758 ; Copy Hide-Config of IPT partition to new location in new table 759 mov si, offset HidePartitionTable 760 mov di, offset NewHidePartTable 761 mov bl, LocIPT_MaxPartitions 762 mov al, dl 763 mul bl 764 add si, ax 765 mov al, dh 766 mul bl 767 add di, ax 768 mov cx, LocIPT_MaxPartitions 769 rep movsb ; Copy Hide-Config to NewHideTable 770 ; Process Logical-Drive-Letter table as well... 771 ;movzx bx, dl 772 mov bl,dl 773 mov bh,0 774 775 mov al, bptr [DriveLetters+bx] ; Get Drv-Letter from org. pos 776 ;movzx bx, dh 777 mov bl,dl 778 mov bh,0 779 780 mov bptr [NewDriveLetters+bx], al ; Put Drv-Letter to new pos 781 ret 782 PARTSCAN_DefXref EndP 783 784 772 785 773 786 ; In: DL - Partition Number in previous IPT 774 787 ; Out: DH - Partition Number in NewPartitionTable 775 788 ; Destroyed: None 776 PARTSCAN_GetXref Proc Near Uses bx 777 ;movzx bx, dl 778 mov bl,dl 779 mov bh,0 780 781 mov dh, bptr [PartitionXref+bx] ; X-Reference 782 ret 783 PARTSCAN_GetXref EndP 789 PARTSCAN_GetXref Proc Near Uses bx 790 ;movzx bx, dl 791 mov bl,dl 792 mov bh,0 793 794 mov dh, bptr [PartitionXref+bx] ; X-Reference 795 ret 796 PARTSCAN_GetXref EndP 797 798 784 799 785 800 ; This here updates the contents of the Hide-Configuration to the current IPT 786 801 ; table. 787 802 PARTSCAN_SyncHideConfigWithXref Proc Near Uses ax bx cx dx si di 788 mov si, offset NewHidePartTable 789 mov di, offset HidePartitionTable 790 mov ch, LocIPT_MaxPartitions 791 PSSHCWX_SyncPartLoop: 792 mov cl, LocIPT_MaxPartitions 793 xor dl, dl ; Partition Lost Counter 794 PSSHCWX_SyncLoop: 795 lodsb ; Get Part-Pointer from Hide-Cfg 796 cmp al, 0FFh 797 je PSSHCWX_SyncEmpty 798 ;movzx bx, al 799 mov bl,al 800 mov bh,0 801 802 mov al, [PartitionXref+bx] ; Translate it 803 cmp al, 0FFh 804 je PSSHCWX_PartLost 805 PSSHCWX_SyncEmpty: 806 stosb ; Put translated pointer to new table 807 dec cl 808 jnz PSSHCWX_SyncLoop 809 jmp PSSHCWX_SyncLoopEnd 810 PSSHCWX_PartLost: 811 inc dl ; One partition got lost... 812 dec cl 813 jnz PSSHCWX_SyncLoop 814 815 PSSHCWX_SyncLoopEnd: 816 or dl, dl 817 jz PSSHCWX_NothingLost 818 mov al, 0FFh 819 PSSHCWX_LostFillLoop: 820 stosb 821 dec cl 822 jnz PSSHCWX_LostFillLoop 823 PSSHCWX_NothingLost: 824 dec ch 825 jnz PSSHCWX_SyncPartLoop 826 ret 803 mov si, offset NewHidePartTable 804 mov di, offset HidePartitionTable 805 mov ch, LocIPT_MaxPartitions 806 PSSHCWX_SyncPartLoop: 807 mov cl, LocIPT_MaxPartitions 808 xor dl, dl ; Partition Lost Counter 809 PSSHCWX_SyncLoop: 810 lodsb ; Get Part-Pointer from Hide-Cfg 811 cmp al, 0FFh 812 je PSSHCWX_SyncEmpty 813 ;movzx bx, al 814 mov bl,al 815 mov bh,0 816 817 mov al, [PartitionXref+bx] ; Translate it 818 cmp al, 0FFh 819 je PSSHCWX_PartLost 820 PSSHCWX_SyncEmpty: 821 stosb ; Put translated pointer to new table 822 dec cl 823 jnz PSSHCWX_SyncLoop 824 jmp PSSHCWX_SyncLoopEnd 825 PSSHCWX_PartLost: 826 inc dl ; One partition got lost... 827 dec cl 828 jnz PSSHCWX_SyncLoop 829 830 PSSHCWX_SyncLoopEnd: 831 or dl, dl 832 jz PSSHCWX_NothingLost 833 mov al, 0FFh ; Influences OVERWRITE BUG ! (OUT OF BOUNDS !!) 834 PSSHCWX_LostFillLoop: 835 stosb 836 dec cl 837 jnz PSSHCWX_LostFillLoop 838 839 ; debug code 840 mov ax,di 841 call AuxIO_TeletypeHexWord 842 call AuxIO_TeletypeNL 843 844 PSSHCWX_NothingLost: 845 dec ch 846 jnz PSSHCWX_SyncPartLoop 847 ret 827 848 PARTSCAN_SyncHideConfigWithXref EndP 828 849 -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r42 r43 42 42 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Release Candidate 1>> (bld: 20120124)', 0 43 43 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Release Candidate 2>> (bld: 20120214)', 0 44 Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Internal Release 2 c>> (bld: 20120216)', 044 Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Internal Release 2f>> (bld: 20120220)', 0 45 45 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 1998-2012 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 46 46 -
trunk/BOOTCODE/SETUP/PART_SET.ASM
r40 r43 1306 1306 ; In: DL - Partition, where to save Hide-Config 1307 1307 ; Destroyed: None, but Locate-Pointer 1308 PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di 1308 PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di ; checken ! 1309 1309 ; First calculate, where to put Hide-Config 1310 1310 mov ax, LocIPT_MaxPartitions -
trunk/BOOTCODE/TEXT/FR/MBR.ASM
r29 r43 29 29 TXT_ERROR_CheckCode db ' - Le code', 0 30 30 TXT_ERROR_CheckFailed db ' de AiR-BOOT a t altr.', 13, 10 31 db ' Veuillez redmarrer avec la disquette AiR-BOOT afin de le restaurer.', 13, 10 32 db ' Systme arrt. Veuillez appuyez sur RESET.', 0 31 ;~ db ' Veuillez redmarrer avec la disquette AiR-BOOT afin de le restaurer.', 13, 10 32 ;~ db ' Systme arrt. Veuillez appuyez sur RESET.', 0 33 34 ; Had to shorten this to prevent overlap with double 'I13X' signature in MBR. 35 ; Hope it still makes sense... 36 db ' Veuillez redmarrer avec la disq AiR-BOOT pour restaurer.', 13, 10 37 db ' Systme arrt. Veuillez appuyez RESET.', 0 -
trunk/BOOTCODE/TEXT/TXTMBR.ASM
r41 r43 1 Include TEXT/EN/MBR.ASM 1 Include TEXT/EN/MBR.ASM -
trunk/BOOTCODE/TEXT/TXTMENUS.ASM
r41 r43 1 Include TEXT/EN/MENUS.ASM 1 Include TEXT/EN/MENUS.ASM -
trunk/BOOTCODE/TEXT/TXTOTHER.ASM
r41 r43 1 Include TEXT/EN/OTHER.ASM 1 Include TEXT/EN/OTHER.ASM -
trunk/INCLUDE/ASM.INC
r30 r43 35 35 EndM 36 36 37 38 ; 39 ; An ORG directive resets the location counter where code and data is 40 ; generated. If the location counter is reset back to a point where 41 ; code or data already has been generated, this will be overwritten 42 ; without warning. 43 ; This macro can be used with every ORG directive to check for this condition, 44 ; and when it occurs further assembly is terminated. 45 46 ; NOTE: Overlapchecking in JWasm is not as reliable as in Tasm. 47 ; Because it's a single pass assembler, the current location can be 48 ; incorrect. Tasm with multiple passes works correct. 49 ; FIXME: Get JWasm and Tasm use some common ECHO/%OUT method. 50 ; (Tasm only pases first word of non-quoted string to a macro) 51 check_overlap MACRO loc 52 53 ; Exit macro immediately if no overlap. 54 ; We don't want to assign values to z_last_... if there is no 55 ; overlap because they would then hold the values the last time this 56 ; macro was called and not those of the last overlap. 57 IF (loc - $) LE 0 58 ;~ IF ($ - loc) GE 0 59 EXITM 60 ENDIF 61 62 ; Calculate the overlap. 63 z_last_overlap_size = (loc - $) 64 z_last_overlap_location = loc - z_last_overlap_size 65 66 IFDEF JWASM 67 ; Output message. 68 ECHO 69 ECHO ** ERROR: LOCATION OVERLAP DETECTED [JWASM] ! ** 70 ECHO . THIS IS MOST LIKELY CAUSED BY CODE / DATA 71 ECHO . EXPANSION TOWARDS AN 'ORG' DIRECTIVE. 72 ECHO . LOOK AT 'z_last_overlap_location' TO SEE WHERE. 73 ECHO . LOOK AT 'z_last_overlap_size' TO SEE SIZE. 74 ECHO . FORCING ERROR... 75 ECHO 76 ENDIF 77 IFDEF TASM 78 IF2 79 ; Output message (only on pass2). 80 %OUT 81 %OUT ** ERROR: LOCATION OVERLAP DETECTED [TASM] ! ** 82 %OUT . THIS IS MOST LIKELY CAUSED BY CODE / DATA 83 %OUT . EXPANSION TOWARDS AN 'ORG' DIRECTIVE. 84 %OUT . LOOK AT 'z_last_overlap_location' TO WHERE. 85 %OUT . LOOK AT 'z_last_overlap_size' TO SEE SIZE. 86 %OUT . FORCING ERROR... 87 %OUT 88 ENDIF 89 ENDIF 90 91 ; Terminate assembly by forcing an error. 92 .ERR 93 94 ENDM 95 96 37 97 ; Shortcuts for pointer-types 38 98 bptr equ byte ptr -
trunk/TOOLS/INTERNAL/FIXCODE.ASM
r37 r43 39 39 db ' - (c) Copyright 2009 by M. Kiewitz', 13, 10, '$' 40 40 COM_LoadCode db ' - Loading bootcode from file...$' 41 COM_CodeName db ' air-boot.com', 041 COM_CodeName db 'AIR-BOOT.COM', 0 42 42 COM_LoadMBR db ' - Loading MBR-protection from file...$' 43 COM_MBRName db ' mbr-prot\mbr_prot.com', 043 COM_MBRName db 'MBR-PROT\MBR_PROT.COM', 0 44 44 COM_MergeMBR db ' - Merging MBR-protection into bootcode...$' 45 45 COM_CountCode db ' - Count code in bootcode-image...$'
Note:
See TracChangeset
for help on using the changeset viewer.