Changeset 154
- Timestamp:
- Apr 8, 2017, 12:27:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/special/lvm.asm
r153 r154 220 220 221 221 222 223 LVM_GetDriveLetter Proc Near Uses bx cx dx si di ds es 224 xor al, al 222 ;------------------------------------------------------------------------------ 223 ; Get the LVM drive-letter for a partition (if available) 224 ;------------------------------------------------------------------------------ 225 ; IN : SI - Pointer to IPT entry for partition 226 ; OUT : AL - LVM drive-letter 227 ; : SI - Pointer to LVM entry in loaded LVM record 228 ; : CF=1 - No valid LVM sector found, AL not valid 229 ; NOTE : Besides the drive-letter, AL can be 0 (LVM hidden) or '*' (LVM auto) 230 ;------------------------------------------------------------------------------ 231 LVM_GetDriveLetter Proc Near Uses bx cx dx di 232 233 IFDEF AUX_DEBUG 234 IF 0 235 DBG_TEXT_OUT_AUX 'LVM_GetDriveLetter:' 236 PUSHRF 237 call DEBUG_DumpRegisters 238 ;~ call AuxIO_DumpParagraph 239 ;~ call AuxIO_TeletypeNL 240 POPRF 241 ENDIF 242 ENDIF 243 244 ; Save IPT pointer 245 mov di, si 246 247 ; Get the LBA addresses of the MBR or EBR from the IPT entry 248 mov dl, [si+LocIPT_Drive] ; BIOS disk number 249 mov ax, [si+LocIPT_AbsolutePartTable+00h] ; LBA lo MBR/EBR 250 mov bx, [si+LocIPT_AbsolutePartTable+02h] ; LBA hi MBR/EBR 251 252 ; Try to load the corresponding LVM sector 253 mov si, offset [LVMSector] ; Pointer to buffer 254 call DriveIO_LoadLVMSectorXBR ; Try to load LVM sector 255 jc LVM_GetDriveLetter_no_lvm ; No success 256 257 ; Recall IPT pointer 258 mov si, di 259 260 ; Locate the LVM entry for the partition 261 mov ax, [si+LocIPT_AbsoluteBegin+00h] ; LBA lo of partition 262 mov dx, [si+LocIPT_AbsoluteBegin+02h] ; LBA hi of partition 263 mov si, offset [LVMSector] ; Loaded LVM sector 264 call LVM_SearchForPartition ; Locate entry 265 jnc LVM_GetDriveLetter_no_lvm ; Entry not found 266 267 ; Get the LVM drive-letter 268 mov al, [si+LocLVM_VolumeLetter] ; Can be 0,'*',letter 269 270 ; We're done, indicate success and return 225 271 clc 272 jmp LVM_GetDriveLetter_done 273 274 LVM_GetDriveLetter_no_lvm: 275 ; Indicate no LVM drive-letter found 276 xor ax, ax 277 mov si, ax 278 stc 279 280 LVM_GetDriveLetter_done: 281 282 IFDEF AUX_DEBUG 283 IF 0 284 DBG_TEXT_OUT_AUX 'lgdl_lvmsec' 285 PUSHRF 286 call DEBUG_DumpRegisters 287 mov si, offset [LVMSector] 288 call AuxIO_DumpSector 289 ;~ call AuxIO_DumpParagraph 290 ;~ call AuxIO_TeletypeNL 291 POPRF 292 ENDIF 293 ENDIF 294 226 295 ret 227 296 LVM_GetDriveLetter EndP
Note:
See TracChangeset
for help on using the changeset viewer.