Changeset 254 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot
- Timestamp:
- Feb 18, 2012, 2:51:54 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Boot
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuInfo.asm
r253 r254 7 7 8 8 ;-------------------------------------------------------------------- 9 ; Creates new BOOT NFO struct for detected hard disk.9 ; Creates new BOOTMENUINFO struct for detected hard disk. 10 10 ; 11 ; Boot Info_CreateForHardDisk11 ; BootMenuInfo_CreateForHardDisk 12 12 ; Parameters: 13 13 ; DL: Drive number … … 15 15 ; ES:SI: Ptr to 512-byte ATA information read from the drive 16 16 ; Returns: 17 ; ES:BX: Ptr to BOOT NFO (if successful)17 ; ES:BX: Ptr to BOOTMENUINFO (if successful) 18 18 ; Corrupts registers: 19 ; AX, BX, CX, DX, DI , SI19 ; AX, BX, CX, DX, DI 20 20 ;-------------------------------------------------------------------- 21 Boot Info_CreateForHardDisk:22 call Boot Info_ConvertDPTtoBX ; ES:BX now points to new BOOTNFO23 push bx ; Preserve for return21 BootMenuInfo_CreateForHardDisk: 22 call BootMenuInfo_ConvertDPTtoBX ; ES:BX now points to new BOOTMENUINFO 23 push bx ; Preserve for return 24 24 25 mov di, bx ; Starting pointer at beginning of structure25 mov di, bx ; Starting pointer at beginning of structure 26 26 27 ; 28 ; Store Drive Name 29 ; 30 push ds ; Preserve RAMVARS 31 push si ; Preserve SI for call to GetTotalSectorCount... 27 ; Store Drive Name 28 push ds ; Preserve RAMVARS 29 push si 32 30 33 push es ; ES copied to DS31 push es ; ES copied to DS 34 32 pop ds 35 33 36 add si, BYTE ATA1.strModel ; DS:SI now points drive name37 lea di, [bx+BOOT NFO.szDrvName]; ES:DI now points to name destination38 mov cx, LEN_BOOTNFO_DRV / 2; Max number of WORDs allowed34 add si, BYTE ATA1.strModel ; DS:SI now points drive name 35 lea di, [bx+BOOTMENUINFO.szDrvName] ; ES:DI now points to name destination 36 mov cx, MAX_HARD_DISK_NAME_LENGTH / 2 ; Max number of WORDs allowed 39 37 .CopyNextWord: 40 38 lodsw 41 xchg al, ah ; Change endianness39 xchg al, ah ; Change endianness 42 40 stosw 43 41 loop .CopyNextWord 44 xor ax, ax ; Zero AX and clear CF45 stosw ; Terminate with NULL42 xor ax, ax ; Zero AX and clear CF 43 stosw ; Terminate with NULL 46 44 47 45 pop si … … 53 51 54 52 ;-------------------------------------------------------------------- 55 ; Boot Info_GetTotalSectorCount53 ; BootMenuInfo_GetTotalSectorCount 56 54 ; Parameters: 57 55 ; DS:DI: DPT Pointer … … 62 60 ;-------------------------------------------------------------------- 63 61 ALIGN JUMP_ALIGN 64 Boot Info_GetTotalSectorCount:62 BootMenuInfo_GetTotalSectorCount: 65 63 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA 66 64 jnz SHORT .ReturnFullCapacity … … 71 69 72 70 ;-------------------------------------------------------------------- 73 ; Returns offset to BOOT NFO based on DPT pointer.71 ; Returns offset to BOOTMENUINFO based on DPT pointer. 74 72 ; 75 ; Boot Info_ConvertDPTtoBX73 ; BootMenuInfo_ConvertDPTtoBX 76 74 ; Parameters: 77 75 ; DS:DI: DPT Pointer 78 76 ; Returns: 79 ; BX: Offset to BOOT NFO struct77 ; BX: Offset to BOOTMENUINFO struct 80 78 ; Corrupts registers: 81 79 ; AX 82 80 ;-------------------------------------------------------------------- 83 81 ALIGN JUMP_ALIGN 84 Boot Info_ConvertDPTtoBX:82 BootMenuInfo_ConvertDPTtoBX: 85 83 mov ax, di 86 sub ax, RAMVARS_size ; subtract off base of DPTs87 mov bl, DPT_BOOT NFO_SIZE_MULTIPLIER ; BOOTNFO's are a whole number multiple of DPT size84 sub ax, RAMVARS_size ; subtract off base of DPTs 85 mov bl, DPT_BOOTMENUINFO_SIZE_MULTIPLIER ; BOOTMENUINFO's are a whole number multiple of DPT size 88 86 mul bl 89 add ax, BOOTVARS.rgBootNfo ; add base of BOOTNFO87 add ax, BOOTVARS.rgBootNfo ; add base of BOOTMENUINFO 90 88 xchg ax, bx 91 89 ret -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r252 r254 27 27 28 28 call FindDPT_ForDriveNumber ; if it is one of ours, print the string in bootnfo 29 call Boot Info_ConvertDPTtoBX29 call BootMenuInfo_ConvertDPTtoBX 30 30 mov si, g_szDriveNumBOOTNFO ; special g_szDriveNum that prints from BDA 31 31 jmp .go … … 197 197 198 198 ; Get and push total LBA size 199 call Boot Info_GetTotalSectorCount199 call BootMenuInfo_GetTotalSectorCount 200 200 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 201 201 jmp BootMenuPrintCfg_ForOurDrive
Note:
See TracChangeset
for help on using the changeset viewer.