INT 13h, AH=42h - extended read sectors
INT 13h, AH=42h - extended read sectors
I have a question about subj function of BIOS. In LBA packet for BIOS call there is a place for 64-bit number of sector to read. Do modern BIOSes will actually read sectors beyond 2Tb (32-bit number) limit? Did anybody try this?
Re: INT 13h, AH=42h - extended read sectors
I think you've misinterpreted the last 8 bytes of the disk address packet...take a look at http://en.wikipedia.org/wiki/INT_13H#IN ... From_Drive, and note that the number of sectors to read is contained in a word at offset 2, while bytes 8-15 contain the LBA of the sector where the read should begin.
Those who understand Unix are doomed to copy it, poorly.
Re: INT 13h, AH=42h - extended read sectors
This Wikipedia link is almost my Prayer book . I didn't get what do you mean under misinterpretation. I need to check if the FULL 64-bit value in bytes 8-15 (start sector to read) works OK. In all code samples that I found high part of start sector is just zeroed and unused. I need to know if it really works if I try to read sectors beyond 2Tb.
Nobody knows?
Nobody knows?
Re: INT 13h, AH=42h - extended read sectors
The specification say that accept 64-bit sector index, so it is 64-bit.
I guess very few OS developer actually used BIOS to load disk sectors, except at early boot stages; and since it's not something people do often, very few people would actually test it on many machines for non-trivial case like >2TB.
So, if that BIOS call failed(you need to check the return code!) and the user(if any) complain on that, you just blame the BIOS, and replace that piece of boot code with more widely tested GRUB.
To summarize, the BIOS should take 64-bit LBA as parameter, it also have total right to reject the call and return fail.
I guess very few OS developer actually used BIOS to load disk sectors, except at early boot stages; and since it's not something people do often, very few people would actually test it on many machines for non-trivial case like >2TB.
So, if that BIOS call failed(you need to check the return code!) and the user(if any) complain on that, you just blame the BIOS, and replace that piece of boot code with more widely tested GRUB.
To summarize, the BIOS should take 64-bit LBA as parameter, it also have total right to reject the call and return fail.
Re: INT 13h, AH=42h - extended read sectors
Hope you are right!bluemoon wrote:To summarize, the BIOS should take 64-bit LBA as parameter, it also have total right to reject the call and return fail.
Re: INT 13h, AH=42h - extended read sectors
Sorry, I misunderstood your question -- I thought you were viewing bytes 8-15 as the number of sectors to read, not the starting point for the read. I see that bluemoon has already answered what you were really asking.Yoda wrote:This Wikipedia link is almost my Prayer book . I didn't get what do you mean under misinterpretation. I need to check if the FULL 64-bit value in bytes 8-15 (start sector to read) works OK. In all code samples that I found high part of start sector is just zeroed and unused. I need to know if it really works if I try to read sectors beyond 2Tb.
Nobody knows?
Those who understand Unix are doomed to copy it, poorly.
Re: INT 13h, AH=42h - extended read sectors
Soon a 3TB HDD will be available for me for a couple of days to play with it! I'll check accessing it through BIOS int 13h beyond 2TB limit and report here for your interest!
Re: INT 13h, AH=42h - extended read sectors
Most BIOS use only 48 bits out of 64 (bochs as well). Since it's still several terrabytes and extended BIOS read only used in early stages (real mode!) I don't think it's a real limitation.
-
- Member
- Posts: 141
- Joined: Thu Jun 17, 2010 2:36 am
Re: INT 13h, AH=42h - extended read sectors
BIOS support for addressing the upper portions of > 2TB HDD's is dodgy at best. My motherboard (Evga E760, X58 chipset for those interested) took at least a dozen BIOS updates to fully support it despite being released in March of 2009. Any BIOS will still support accessing the lower ~2TB though. For sanity's sake, I would ensure that any data that needs to be accessed through the BIOS INT13h interface reside below the ~2TB threshold.
Also keep in mind a lot of 3TB drives use 4KB sectors, so the whole drive might be accessible even with an older BIOS. You can't really rely on this though, because my 4KB sector drive has a jumper that emulates 512 byte sectors on it, so that can change even if the drive doesn't.
@Turdus
ATA\AHCI controllers only support 48 Bit LBA's. The extra 2 bytes in the address packet were for future proofing.
Also keep in mind a lot of 3TB drives use 4KB sectors, so the whole drive might be accessible even with an older BIOS. You can't really rely on this though, because my 4KB sector drive has a jumper that emulates 512 byte sectors on it, so that can change even if the drive doesn't.
@Turdus
ATA\AHCI controllers only support 48 Bit LBA's. The extra 2 bytes in the address packet were for future proofing.
Re: INT 13h, AH=42h - extended read sectors
My report.
Most BIOSes don't support LBA48 access on INT13. They just ignore the contents of higher 32 bit half. But I found one BIOS on a modern mainboard that really works with LBA48.
Most BIOSes don't support LBA48 access on INT13. They just ignore the contents of higher 32 bit half. But I found one BIOS on a modern mainboard that really works with LBA48.
- pauldinhqd
- Member
- Posts: 37
- Joined: Tue Jul 12, 2011 9:14 am
- Location: Hanoi
- Contact:
Re: INT 13h, AH=42h - extended read sectors
is it true that 3TB drives use 4KB sectors instead of 512bytes?Rudster816 wrote: Also keep in mind a lot of 3TB drives use 4KB sectors, so the whole drive might be accessible even with an older BIOS. You can't really rely on this though, because my 4KB sector drive has a jumper that emulates 512 byte sectors on it, so that can change even if the drive doesn't.
MBR is 4KB also? where's the source about this new standard for sector?
http://www.tomshardware.com/reviews/adv ... ,2759.html
i have to re-engineer the whole code written for my os
AMD Sempron 140
nVidia GTS 450
Transcend DDR2 2x1
LG Flatron L1742SE
nVidia GTS 450
Transcend DDR2 2x1
LG Flatron L1742SE
Re: INT 13h, AH=42h - extended read sectors
Large disks emulate 512-byte sectors. Just align partitions/clusters on 4 kb boundaries (8 sectors) for good performance.
If you have seen bad English in my words, tell me what's wrong, please.
Re: INT 13h, AH=42h - extended read sectors
Not necessarily. Only those series that are specially designed as 4k physical sectors, but they are not necessarily so huge. For example, WD EARS series use 4k sectors. But all these drives emulate logical 512 sectors. So you don't need to take special measures. The only thing is that the performance highly degrades on writing data chunks not divisible by 4k or data misaligned on 4k boundary since it reads 4k sector then updates it and writes it back. W7 creates partitions and formats them taking that into account. You also should make filesystems on that drives so that cluster size is at least 4k, data clusters are aligned on 4k boundary and all (or most) write operations are in 4k chunks. That's all you need.pauldinhqd wrote:is it true that 3TB drives use 4KB sectors instead of 512bytes?
No. MBR and all other structures are the same.pauldinhqd wrote:MBR is 4KB also?
I tried before to find an official documentation on 4k sectors but it seems that these docs are only HDD manufacturers specific, not OS developers.pauldinhqd wrote:where's the source about this new standard for sector?
-
- Member
- Posts: 141
- Joined: Thu Jun 17, 2010 2:36 am
Re: INT 13h, AH=42h - extended read sectors
The BIOS may decide to emulate 512 Byte sectors, but you have to use a jumper on the drive (which isn't on by default) to emulate 512 Byte sectors for buggy\legacy OS's in hardware. I'd venture to guess that most BIOS's probably end up loading all 4KB at 0x7C00 in these drives, might be interesting to check. I'm not sure if they just read one sector straight to 0x7C00, or to an internal buffer first. In any case, you couldn't exploit it anyways, unless you want to have zero portability.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: INT 13h, AH=42h - extended read sectors
A few drives are presenting a 4K logical sector size to the OS now. Here are a couple USB devices connected to OpenBSD systems.
umass0 at uhub3 port 1 configuration 1 interface 0 "Iomega eGo USB" rev 2.10/0.00 addr 3
umass0: using SCSI over Bulk-Only
scsibus3 at umass0: 2 targets, initiator 0
sd1 at scsibus3 targ 1 lun 0: <OEM, Ext Hard Disk, 0000> SCSI3 0/direct fixed
sd1: 953169MB, 4096 bytes/sector, 244011446 sectors
..
umass1 at uhub1 port 4 configuration 1 interface 0 "Apple Inc. iPod" rev 2.00/0.01 addr 2
umass1: using SCSI over Bulk-Only
scsibus4 at umass1: 2 targets, initiator 0
sd1 at scsibus4 targ 1 lun 0: <Apple, iPod, 1.62> SCSI0 0/direct removable
sd1: 7583MB, 4096 bytes/sector, 1941441 sectors