Reading a LBA 28-bit sector with the int 13h extensions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Maqstcharub
Posts: 4
Joined: Thu Mar 31, 2022 1:39 pm
Libera.chat IRC: gimbo

Reading a LBA 28-bit sector with the int 13h extensions

Post by Maqstcharub »

I need to read a sector using LBA 28-bit in the BIOS and i've read (here: https://wiki.osdev.org/Disk_access_usin ... ended_Mode) that you can do that thanks to the "int 13h Extensions" with the function 0x42 but i need to set up a "Disk Address Packet Structure" but the article assumes that the address is 48-bit.
Is there a way to use the 28-bit counterpart?
Thanks in advance
Octocontrabass
Member
Member
Posts: 5562
Joined: Mon Mar 25, 2013 7:01 pm

Re: Reading a LBA 28-bit sector with the int 13h extensions

Post by Octocontrabass »

The article is wrong. The LBA in the disk address packet is always 64 bits, not 48 bits.

You don't need to specify 28-bit LBA. The BIOS is smart enough to figure that out on its own.
Maqstcharub
Posts: 4
Joined: Thu Mar 31, 2022 1:39 pm
Libera.chat IRC: gimbo

Re: Reading a LBA 28-bit sector with the int 13h extensions

Post by Maqstcharub »

Octocontrabass wrote:The article is wrong. The LBA in the disk address packet is always 64 bits, not 48 bits.

You don't need to specify 28-bit LBA. The BIOS is smart enough to figure that out on its own.
so, if i understand correctly, i have to use only the lower 32-bits in the DAP obliterating the last entry: the upper 16-bits
Octocontrabass
Member
Member
Posts: 5562
Joined: Mon Mar 25, 2013 7:01 pm

Re: Reading a LBA 28-bit sector with the int 13h extensions

Post by Octocontrabass »

Yep, if you want 28-bit LBA use only the lower 28 bits and set the remaining 36 bits to zero.
Post Reply