- Timestamp:
- Feb 18, 2012, 2:51:54 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc
r127 r254 1 1 ; Project name : XTIDE Universal BIOS 2 ; Description : Equates used in Boot Menu.2 ; Description : Equates and structs used in Boot Menu. 3 3 %ifndef BOOTMENU_INC 4 4 %define BOOTMENU_INC … … 17 17 18 18 19 ; Boot Menu Information Table. These are generated for all XTIDE Universal 20 ; BIOS drives. Available only until boot is successfull. 21 MAX_HARD_DISK_NAME_LENGTH EQU 26 ; Bytes reserved for drive name 22 23 struc BOOTMENUINFO 24 .szDrvName resb MAX_HARD_DISK_NAME_LENGTH 25 resb 2 ; Zero word (ensures string terminates) 26 resb 8 ; padding to make BOOTMENUINFO size an even multiple of DPT size 27 endstruc 28 29 DPT_BOOTMENUINFO_SIZE_MULTIPLIER equ BOOTMENUINFO_size / LARGEST_DPT_SIZE 30 31 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 32 33 %if BOOTMENUINFO_size % LARGEST_DPT_SIZE <> 0 34 %error "BOOTMENUINFO's size must be an even multiple of DPT's size. Add or remove padding at the bottom of BOOTMENUINFO to bring the two sizes into alignment. As BOOTMENUINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here." 35 %endif 36 37 %if BOOTMENUINFO.szDrvName <> 0 38 %error "BOOTMENUINFO.szDrvName is assumed to be the first member of struc BOOTMENUINFO, in BootMenuPrint_RefreshItem" 39 %endif 40 41 %endif 42 43 19 44 %endif ; BOOTMENU_INC -
trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
r252 r254 8 8 BOOT_READ_RETRY_TIMES EQU 3 9 9 10 11 ; Boot Menu Information Table. These are generated for all XTIDE Universal12 ; BIOS drives. Available only until boot is successfull.13 LEN_BOOTNFO_DRV EQU 26 ; Bytes reserved for drive name14 struc BOOTNFO15 .szDrvName resb LEN_BOOTNFO_DRV ; Drive name16 resb 2 ; Zero word (ensures string terminates)17 resb 8 ; padding to make BOOTNFO size an even multiple of DPT size18 endstruc19 20 DPT_BOOTNFO_SIZE_MULTIPLIER equ BOOTNFO_size / LARGEST_DPT_SIZE21 22 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS23 24 %if BOOTNFO_size % LARGEST_DPT_SIZE <> 025 %error "BOOTNFO's size must be an even multiple of DPT's size. Add or remove padding at the bottom of BOOTNFO to bring the two sizes into alignment. As BOOTNFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."26 %endif27 28 %if BOOTNFO.szDrvName <> 029 %error "BOOTNFO.szDrvName is assumed to be the first member of struc BOOTNFO, in BootMenuPrint_RefreshItem"30 %endif31 32 %endif33 10 34 11 -
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 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r242 r254 143 143 call CreateDPT_FromAtaInformation 144 144 jc SHORT DetectDrives_DriveNotFound 145 call Boot Info_CreateForHardDisk145 call BootMenuInfo_CreateForHardDisk 146 146 jmp short DetectPrint_DriveNameFromBootnfoInESBX 147 147 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r244 r254 105 105 ; DetectPrint_DriveNameFromBootnfoInESBX 106 106 ; Parameters: 107 ; ES:BX: Ptr to BOOT NFO (if drive found)107 ; ES:BX: Ptr to BOOTMENUINFO (if drive found) 108 108 ; Returns: 109 109 ; Nothing … … 115 115 push bx 116 116 117 lea si, [bx+BOOT NFO.szDrvName]117 lea si, [bx+BOOTMENUINFO.szDrvName] 118 118 mov bx, es 119 119 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI … … 123 123 pop di 124 124 ret 125 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r248 r254 29 29 %include "RomVars.inc" ; For ROMVARS and IDEVARS structs 30 30 %include "RamVars.inc" ; For RAMVARS struct 31 %include "BootVars.inc" ; For BOOTVARS and BOOTNFO structs31 %include "BootVars.inc" ; For BOOTVARS struct 32 32 %include "BootMenu.inc" ; For Boot Menu 33 33 %include "IDE_8bit.inc" ; For IDE 8-bit data port macros … … 167 167 %include "FindDPT.asm" ; For finding DPTs 168 168 %include "AccessDPT.asm" ; For accessing DPTs 169 %include "Boot Info.asm" ; For creating BOOTNFO structs169 %include "BootMenuInfo.asm" ; For creating BOOTMENUINFO structs 170 170 %include "AtaID.asm" ; For ATA Identify Device information 171 171 %include "DetectDrives.asm" ; For detecting IDE drives
Note:
See TracChangeset
for help on using the changeset viewer.