China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-30 19:07
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [Discussion] How do BIOS and partitioning software actually confirm the hard disk capacity DigestI View 15,554 Replies 40
Floor 16 Posted 2005-10-27 19:52 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 17 Posted 2005-10-27 22:37 ·  中国 湖北 武汉 联通
高级用户
★★★
Credits 587
Posts 302
Joined 2005-07-25 17:31
20-year member
UID 41046
Gender Male
Status Offline
The history of hard drive development can be found everywhere, and each time the hard drive develops, the limitations that are broken through are introduced in detail. I won't post it.

I want to say that this is a manifestation of the asynchrony between hardware and software development, just like running 16-bit programs on 64-bit CPUs, and many other hardware will have similar phenomena.

What is particularly obvious on the hard drive is that hard drive parameters are generally accessed through the BIOS. Then first, the number of data address bits that the BIOS can receive should be equal to or larger than the number that the hard drive can provide. Similarly, when software accesses the BIOS, the number of data address bits that the software can receive should also be greater than or equal to that of the BIOS.

So every time there is a breakthrough in disk platter technology, it will cause the existing software (including those固化 in ROM) to be updated.

As for the difference in capacity, it is caused by different calculation methods. In fact, they all use 28-bit registers, and there is not much difference. Setting the hard drive to different modes has no practical meaning.


PS: I also use an 80G hard drive, but my motherboard is a 430HX motherboard bought in 1997. It is already a miracle that the BIOS hard drive module can be modified to support 80G. Now the BIOS cannot be set manually, only AUTO.

[ Last edited by fdsiuha on 2005-11-1 at 20:17 ]
欢迎造访DOS的小屋!
http://risky.ik8.com
Floor 18 Posted 2005-10-28 00:46 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Originally posted by qwe1234567 at 2005-10-27 19:52:
Head Sector Cylinder Capacity

CHS 16 255 39236 39235

LARGE 240 255 2615 39235

LBA 255 63 9964 39235

First of all, thank you for collecting data for discussing the problem. But strangely, is this your 80G hard drive? Why does it look like 40G? And why does the capacity shown in all modes remain the same? Is your BIOS AWARD? What version number?
Floor 19 Posted 2005-10-28 01:21 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Re: fdsiuha

I have also searched a lot of information online regarding this issue, but almost all are similar, and I haven't found an answer that explains my confusion. What you said about addressing capacity is software > BIOS > HDD. I think it depends on the situation. When we can use it "stably" now, it's like that, but when the hard drive capacity breaks through, it's often the opposite.

Can you give a specific calculation example to illustrate the problem you mentioned that "the difference in capacity is caused by different calculation methods"?

Indeed, for current large hard drives, the BIOS can correctly access them. But as I said earlier, if our only purpose is to be able to use it, then we don't need to discuss this issue. From the perspective that we can use this hard drive alone, it doesn't really matter what mode it's set to, because no one cares about the difference of a few megabytes. But when you use the same hard drive on different machines, sometimes you will understand the significance. Or, some OS installation software changes your partitions beyond recognition on a hard drive that you have already partitioned, and your original drive letters are not recognized, and then you will experience the significance.

In addition, I want to ask how your BIOS cannot be set manually. Is there no such option, or does it not recognize it when using manual settings? What version of BIOS is your current upgraded one? What is the version number?
Floor 20 Posted 2005-10-28 07:17 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
My BIOS is AWARD V6.0PG. The BIOS shows the hard disk capacity as 81G, while Windows shows the hard disk capacity as 76.26G. Why can't the current BIOS manually set the hard disk? My BIOS can manually set the hard disk, and the BIOS date is 02/27/03.
Floor 21 Posted 2005-10-28 09:24 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
『Post 18』:
According to my calculation, the hard disk capacity is:
CHS 81962434560 bytes
LARGE 81939456000 bytes
LBA 81956689920 bytes
How do you think it's like 40G? Why are the capacities displayed in all modes the same? Obviously they are not the same!
Floor 22 Posted 2005-10-28 10:02 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
I rearranged the parameters you wrote in post 16 according to the corresponding columns

Head Sector Cylinder Capacity

CHS 16 255 39236 39235 (81962434560)

LARGE 240 255 2615 39235 (81939456000)

LBA 255 63 9964 39235 (81956689920)

It can be seen that the capacity shown in the Capacity column is all 39235, which is about 40G. I don't know where the 81G you mentioned later is displayed. The values in the parentheses are the capacities I calculated according to the CHS values in each mode, which are exactly the same as your calculation results, and it is an 80G hard disk. But why is the capacity shown as 40G in the Capacity column and the values are the same?
Floor 23 Posted 2005-10-28 14:19 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
It should be like this:
Head Sector Cylinder Landing zone

CHS 16 255 39236 39235 (81962434560)

LARGE 240 255 2615 39235 (81939456000)

LBA 255 63 9964 39235 (81956689920)
The 81G is in the same screen as the above data! Landing zone should not be the hard drive capacity. My hard drive is a single-platter 80G!
Floor 24 Posted 2005-10-28 15:27 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Then it seems you made a mistake yourself. Then why are you getting excited with me! I didn't care much about your few times of getting excited with me before! If it weren't for thinking you are cute, I...
You made a mistake now. It should be zone instead of zane!

Let me ask you again, how exactly is your 80G capacity displayed? Does it simply show "81G"? I don't think it would list specific numbers like we calculate.
Floor 25 Posted 2005-10-28 17:33 ·  中国 湖北 宜昌 电信
高级用户
★★★
Credits 587
Posts 302
Joined 2005-07-25 17:31
20-year member
UID 41046
Gender Male
Status Offline
My BIOS program has two patches. One of the patches clearly states that after patching, you can only use AUTO to detect the hard disk with the patching program. If you set it yourself, it will crash immediately or the power-on self-test will crash.

In fact, if the old BIOS relies on CHS/LARGE/LBA selection, even if you change the mode in the same machine, the hard disk cannot access normally. Not to mention using it on other machines.
欢迎造访DOS的小屋!
http://risky.ik8.com
Floor 26 Posted 2005-10-28 18:00 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
What you said is right, but this problem is not limited to old BIOS, in fact it is like this on all BIOS. And I think what you mean by not being able to access normally refers to on a hard disk that has already been partitioned. This is also one of the practical reasons why I put forward this question. Because if everyone can only use LBA mode, there would be no this problem. The problem is that there are other modes to choose from and it can also be used normally (指 once a mode is selected). So I'm back to the original question:

"What is the actual maximum available capacity of this hard disk? Is the maximum capacity recognized in CHS mode reliable? Will accessing the hard disk in this mode cause damage to it?"
Floor 27 Posted 2005-10-29 11:07 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Originally posted by DOSforever at 2005-10-28 15:27:
Then it seems that you made a mistake yourself. Then why are you still excited with me! I didn't care much about your previous few times of being excited with me! If it weren't for thinking you are cute, I...
You still made a mistake now, ...

It's my fault for not making it clear. It should be:
Head Sector Cylinder Landing zone Capacity

CHS 16 255 39236 39235 81G (81962434560)

LARGE 240 255 2615 39235 81G (81939456000)

LBA 255 63 9964 39235 81G (81956689920)
Floor 28 Posted 2005-10-29 16:52 ·  中国 湖北 武汉 联通
高级用户
★★★
Credits 587
Posts 302
Joined 2005-07-25 17:31
20-year member
UID 41046
Gender Male
Status Offline
In fact, there is no need to worry. Different access methods are all acceptable to the hard disk. It won't happen that when you issue an instruction to access an address of 80G on a 40G hard disk, the mechanical arm on the disk will move outside the disk. The different displays of capacity are just because the allocation methods of the free space on the hard disk are different.

The number of heads, sectors, and tracks in our logic is just a logical concept now, not really corresponding to the 3D structure on the disk. This is caused by the addressing conversion inside the hard disk. Moreover, even between these so-called allocated spaces, they are not continuous. For example, there are parts marked as bad sectors at the factory, and there are also sectors registered as unused by the hard disk (for backup to replace bad sectors that appear after use). These are all internal problems handled by the logic circuit of the hard disk.

In addition to the above situations, in fact, the available physical space on the hard disk platter is much larger than the range we actually use. Many times the mechanical arm can also move the magnetic head to these places, but these spaces are generally reserved for safety or other purposes, such as the so-called head PARK area, and will not be completely used up. But these are also controlled by the internal circuit of the hard disk and are invisible to software of any level (but some hard disks use non-public special instructions, which can enable some professional hard disk repair and detection software of their own manufacturers to operate).
欢迎造访DOS的小屋!
http://risky.ik8.com
Floor 29 Posted 2005-10-30 05:08 ·  中国 上海 闵行区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
The maximum available capacity of the hard disk we are discussing now certainly does not include its P-LIST, G-LIST, and other internal sectors used up. We are just discussing a "perfectly intact" hard disk from a logical perspective. Actually, I remember that starting from hard disks of several tens of megabytes, the CHS parameters in CMOS were no longer the actual physical parameters. At that time, if the manual parameter setting was incorrect, it could not be used normally. So, based on this idea, I'm thinking that although the hard disk can work normally no matter which addressing mode you choose now, could it be that if I choose an inappropriate mode, the sectors it addresses are unreliable relative to its "should-be" mode? Or the first part is relatively close, but the farther back it goes, the more it deviates from the "normal" position? Now, we don't have a theoretical basis or practical experience to prove that all three modes can work completely normally, that is to say, it's just that the addressing capacities are different. If that's the case, that's great. It seems that we haven't used the maximum capacity of our hard disks to the full. In the future, when installing a new hard disk, we should all choose the CHS mode. According to the data provided by qwe1234567, there is a difference of more than 20 megabytes between the CHS mode and the LARGE mode (81,962,434,560 - 81,939,456,000 = 22,978,560), and also a difference of more than 5 megabytes from the commonly used LBA mode (81,962,434,560 - 81,956,689,920 = 5,744,640). Even if someone has proven through practice that any mode can work completely normally, it's best if someone can explain theoretically why this phenomenon occurs and why we should use the CHS mode to achieve the maximum usable capacity of the hard disk.

Here I will tell another relevant example:
The famous PC Tools 5.0 I believe everyone must have used it. I don't know if you still have it now. I have been keeping it all the time, and there are several versions of it. Hehe (I also want to post a thread later to specifically discuss this matter). We know that its disk editing function was very powerful at that time. Before the appearance of the BIOS and hard disk with LBA addressing mode, it could easily edit each logical sector or a certain cluster of the logical disk, as well as each logical area defined by the FAT12/16 system. For example, it could directly jump to the BOOT area, the first FAT sector, the first FDT sector, and the first data sector. After the emergence of the BIOS that broke through 528M capacity, that is, the BIOS supporting LBA, the positioning problem of the disk editing of PC Tools 5.0 came up: when I specified to let it jump to the first FAT sector or the first FDT sector, the actual position it jumped to was not that area, that is, the sector calculation position was wrong. I think this is probably because PC Tools was designed according to the CHS addressing mode, but the actual hard disk was addressing according to LBA, so this phenomenon occurred. But it's strange that after Ext int13h appeared, such an ancient PC Tools could actually position normally?! Why did two different results occur in the same LBA mode?

The example I gave is not the same as the sector positioning problem I suspected earlier. The earlier one I suspected was physical positioning, that is, suspected of deviating from the real physical position of the sector, and this example I think is logical positioning problem, that is, the physical position of a certain sector is correct, but it's not the sector I'm looking for. Of course, there may also be both logical positioning deviation and physical position deviation as the position of the sector to be found moves back.
Floor 30 Posted 2005-10-31 10:48 ·  中国 湖北 武汉 联通
高级用户
★★★
Credits 587
Posts 302
Joined 2005-07-25 17:31
20-year member
UID 41046
Gender Male
Status Offline
Oh oh

CHS and LBA are not the same calculation method...
The 28-bit register is like this (taking your previous 60G hard disk as an example):
CHS and LBA are respectively:
10000/111 11111/11001011111101
11111 111/11111/11110100110100
Because CHS is three different registers of C, H, S, so each register has its own maximum value, and the number of heads is fixed at 10000.
But LBA is the entire 28 bits transmitted to the BIOS as a whole, so it can be 2^28 = 137G.

In the process of calculating the capacity, the increment of LBA capacity is
LBA = 255 (number of heads, fixed) * 63 (sectors, fixed) * 512 / 1024 = 8032.5K
That is, the minimum unit of the disk is 8M.
The advantage of this is that users don't need to know what their CHS parameters are, and directly convert to linear addresses(Modified: This sentence is really %$^&@#, which is misleading. Actually, what I want to say is "The advantage of this is that users don't need to know what their CHS parameters are because it is directly converted from the linear address").

But the calculation method of CHS is not like this. Because it corresponds to physical parameters (and later it is also the internal address conversion of the hard disk), so all three register values can be changed. The value calculated in this way will naturally have a slight difference from LBA (less than 8M). Even if the first two registers reach the maximum (the way all current hard disks use), the increment is
CHS = 16 (number of heads, fixed) * 255 (sectors, fixed) * 512 = 2040K
Which is different from the increment of LBA.

In this way, a fixed disk space has to be represented by two parameters that cannot be reduced to the same, and can only sacrifice a little (<6M) disk space for addressing. Due to the popularity of linear addressing, this work is uniformly completed by the internal circuit of the disk.

What you call achieving maximum space utilization with CHS does make sense. After all, the minimum increment of LBA is larger, which is easy to leave "scraps". But LBA is a more advanced feature. Especially for system-level software, it will gradually abandon the CHS method. Moreover, for current 120G, 160G or even larger hard disks, the <6M space is of no significance. And in the future, a larger unit storage method may be adopted. In addition, although LBA also has a 137G limit, it represents a larger address range (the maximum capacity is about 500MB more than CHS), and it is extremely easy to expand to a larger space.

As for LARGE, I don't have relevant information yet, so I don't know its working method, so I can't say.

[ Last edited by fdsiuha on 2005-11-1 at 20:23 ]
欢迎造访DOS的小屋!
http://risky.ik8.com
Forum Jump: