Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; LBA
- ;
- ; Find the LBA of the active partition
- mov bx, 0x7dbe ; Address of partition table in memory
- ; (0x7c00 + 446).
- .ptable_loop:
- mov ah, [bx] ; Partition status byte.
- cmp ah, 0x80
- je .bootable_found ; Found bootable partition.
- add bx, 16 ; Next entry.
- jmp .ptable_loop
- .bootable_found:
- mov ax, [bx + 0x0c]
- mov [dap.offset], ax
- ;
- ; CHS
- ;
- ; Find the CHS of the active partition.
- mov bx, 0x7dbe ; Address of partition table in memory
- .ptable_loop:
- mov ah, [bx] ; Partition status byte.
- cmp ah, 0x80
- je .bootable_found ; Found bootable partition.
- add bx, 16 ; Next entry.
- jmp .ptable_loop
- .bootable_found:
- mov ax, [bx + 0x01]
- mov [stage2_chs], ax
Advertisement
Add Comment
Please, Sign In to add comment