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 20:21
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [Discussion] How do BIOS and partitioning software actually confirm the hard disk capacity DigestI View 15,559 Replies 40
Original Poster Posted 2005-10-14 15:26 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
This is a problem that has troubled me for a long time.

I'll start with the issue of the 504M capacity limit. After hard drives with a capacity exceeding 500M appeared, many 386 and 486 machines couldn't recognize them. Later, I learned that support from a BIOS with LBA addressing mode was required. Since then, it seems an inevitable choice to select LBA in the BIOS for large-capacity hard drives. Then there was the problem of the 8G capacity limit (I skipped some other less common limits in between), and I learned that a BIOS with extended Int 13h support was needed. Pay attention, from this time on, my problem came up. I'll take AWARD BIOS as an example. In version 4.5, when I use its own hard drive parameter detection function, when a hard drive exceeding 8G, such as 10G, 20G, 40G, the BIOS detection can give three parameters: NORMAL mode (which I think is actually the traditional CHS mode), LARGE mode, and LBA mode. I think most of us will unhesitatingly choose the LBA mode, then partition, format, install the system, and it's OK! There's no problem with this. If our purpose is just that the machine can be used and we don't care about what's going on inside, then we don't need to come here or discuss this problem.

My problem is: I once tried other modes and could still use it normally. So is it indifferent to the hard drive which mode is used now? If we compare carefully, we will find that the capacities of the hard drive recognized in the three modes are not completely the same, but they are quite close, only a little different. This is not like before when there was a "qualitative" difference. And interestingly, the LBA, which could recognize the largest capacity mode in the past, can now recognize the smallest, while the CHS mode, which could recognize the smallest capacity in the past, can actually recognize the largest capacity, and the LARGE in the middle still remains in the middle level. Then what is the actual maximum available capacity of this hard drive? Is the largest capacity recognized in the CHS mode reliable? Will accessing the hard drive in this mode cause damage to it? Since I have never found an answer to these questions, I have always used the LBA mode out of caution. The BIOS also defaults to recommending this mode while giving the hard drive parameters in these three modes. In addition, in the user manuals of some brand computers, users are also instructed to use this mode. I don't know whether they do this really with scientific basis or just follow suit without investigation and research for convenience.

Later, when the BIOS developed to version 6.0, the situation changed again. Even the step of manually detecting hard drive parameters was omitted. As long as the hard drive is connected and the computer is turned on, it can automatically recognize the capacity and addressing mode (of course, you can also manually set other modes). Moreover, in the AUTO mode in the BIOS, the automatically detected hard drive mode and parameters are all in accordance with the CHS mode, but strangely, the hard drive mode reported in the hardware information summary displayed during self-test almost all becomes LBA?! (Except for special cases, which I will explain below) So it seems that LBA should be the only and correct choice? According to reason, the (maximum) capacity of the hard drive is fixed, and the BIOS recognizes the hard drive capacity according to the information in the hard drive firmware. But it seems that the current BIOS is too "smart". It seems that it can judge the hard drive parameters, addressing mode and capacity according to the partition table information again. I said "again" because the BIOS seems to have two detections. The first time is when you enter the BIOS setup, you can see that it recognizes the default addressing mode (almost all CHS, and later it actually becomes LBA). And when displaying the hardware configuration information during startup (not necessarily at this time, just when we see it), it has to detect again. Why do I say this? If your hard drive is brand new and repartitioned, you can't see the significance of the two changes. You may think that this change is just an illusion, just a "routine" of the BIOS. But when your hard drive was partitioned in CHS mode on another machine and then installed on this machine, you will see that the configuration information also shows the CHS mode instead of also becoming the LBA mode. In addition, I once encountered such a situation: an old 4G hard drive, which was indeed recognized as 4G in the BIOS, but became 1G during startup. Later, it has been 1G in the BIOS all the time. I let it re-detect in the BIOS and it was still 1G?! After clearing the CMOS each time to let the BIOS recognize it correctly again, it became 1G again during each startup?! Later, after I cleared the MBS, this strange phenomenon no longer occurred. Although I don't know how the BIOS recognizes the hard drive exactly, through the above two examples, I think that the current BIOS, in addition to using the information in the firmware, will also "intelligently" determine the addressing mode and capacity of the hard drive by reading the partition information of the hard drive before booting the OS during startup. Of course, these are just my guesses. Please friends who are familiar with the internal structure of the BIOS to explain what's going on.

Now let's talk about the problem of partition software recognizing capacity. The traditional FDISK can't show anything, so I won't talk about it first. I usually use DM to partition now, and usually always operate in the manual mode with the /M parameter. I find that DM and FDISK have the same minimum partition unit in cylinder units, but strangely, I often encounter that the hard drive partitioned by DM often shows 1% unused space under FDISK's view. (Actually, it's only a few megabytes, not really 1% of the hard drive capacity) So I've been wondering whether DM recognizes the hard drive in LBA mode, while FDISK recognizes it in CHS mode, so it can recognize more sectors than DM? I estimate that other partition software such as PM also uses cylinder units. UNIX can use track units, and I'm not sure about LINUX.
Floor 2 Posted 2005-10-14 15:48 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 3 Posted 2005-10-14 16:34 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
But why does DM keep one cylinder?
There is also a key question: which addressing mode should be used exactly? Or can any be used?
Floor 4 Posted 2005-10-14 16:52 ·  中国 山西 临汾 联通
中级用户
★★
Credits 241
Posts 131
Joined 2005-09-28 19:01
20-year member
UID 42920
Gender Male
Status Offline
There are two ways for partition software to view the hard disk capacity: one is through BIOS, and the other is direct viewing! But unfortunately, both DM and FDISK are direct viewing! What I said still can't solve your doubts, just to say it! Hehe...
房东说:这娃是个好孩子!
Floor 5 Posted 2005-10-14 16:55 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Directly view? How is it directly viewed? Is it directly accessing the ATA interface? Also, which software views through the BIOS? I believe that DM is directly viewed, but I find it strange that FDISK is also directly viewed. Because if you set the hard disk to NONE in CMOS, DM can still recognize it, but FDISK will think "No fixed disk". Hee-hee, with your words, I have more questions now.

[ Last edited by dosforever on 2005-10-14 at 17:03 ]
Floor 6 Posted 2005-10-15 18:37 ·  中国 山西 太原 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re dosforever:

The new INT13 does not use the operating system's register to pass hard disk addressing parameters. It uses an address packet stored in the operating system's memory. The address packet stores a 64-bit LBA address. If the hard disk supports LBA addressing, the lower 28 bits are directly passed to the ATA interface. If not, the operating system first converts the LBA address to CHS address and then passes it to the ATA interface. In this way, the maximum capacity for CHS addressing on the ATA bus is 136.9GB, and the maximum capacity for LBA addressing is 137.4GB.


Based on this, your statement about CHS>LBA may be an empirical error, which affects your judgment.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 7 Posted 2005-10-16 13:17 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
What I mean by CHS>LBA is not their respective maximum addressable capacities, but the addressable capacities recognized by each for the same hard disk. This is not an error in my experience but what the BIOS reported to me. If your BIOS is also AWARD (I'm not sure about AMI), you can now restart the machine and immediately enter the BIOS setup to check. If your hard disk is relatively large, you may not see much difference. The following are several examples I collected, showing the parameters and addressable capacities under three modes. It can be seen that CHS has the maximum, and LBA has the minimum. The BIOS is AWARD 6.0.

An 8G hard disk

Head Sector Cylinder Capacity

CHS 16 63 16708 8623

LARGE 240 63 1113 8616

LBA 255 63 1048 8620


A 10G hard disk

Head Sector Cylinder Capacity

CHS 16 63 19852 10246

LARGE 240 63 1323 10242

LBA 255 63 1245 10241


But strangely, for hard disks of 60G and above, this difference is not obvious. I think maybe it's just that the subtle differences can't be shown.

A 60G disk

Head Sector Cylinder Capacity

CHS 16 255 29437 61496

LARGE 240 255 1962 61482

LBA 255 63 7476 61496
Floor 8 Posted 2005-10-16 15:12 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
The unallocated capacity of one cylinder is caused by the partitioning software dm. You can use pqmagic to move the unallocated capacity of one cylinder to the last partition!
Floor 9 Posted 2005-10-16 16:48 ·  中国 上海 电信
金牌会员
★★★★
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-16 15:12:
The unallocated capacity of one cylinder is caused by the partition software dm. You can use pqmagic to move the unallocated capacity of one cylinder to the last partition!

I want to ask, have you ever encountered such a problem yourself
Floor 10 Posted 2005-10-19 08:46 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
I have also encountered such a problem. There is a similar problem when using Ghost to clone the hard disk!
Floor 11 Posted 2005-10-19 09:39 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
But you can't just conclude that this must be caused by DM or ghost, because I also saw that when using DM to partition, FDISK didn't report that there was still 1% of unused space. Also, on the hard disk where FDISK thinks there is still 1% of unused space, it's simply impossible to use what you said about using PQMagic to "move the unallocated cylinder capacity to the last partition"! Because PQMagic didn't think there was any unused space at all! Another point is that what we are now discussing is why this phenomenon occurs, not just telling others that this phenomenon exists, because everyone has seen the phenomenon. So it returns to my previous question, even if it's caused by DM, but why does DM reserve one cylinder unallocated?

Although my doubts haven't been resolved, I still express my gratitude for everyone's enthusiastic participation. I hope everyone can also speak out with any definite information or bold and reasonable assumptions for discussion. Don't be afraid of saying something wrong, because the forum is a place for everyone to discuss problems.
Floor 12 Posted 2005-10-20 12:03 ·  中国 江苏 苏州 吴江区 电信
初级用户
★★
Credits 125
Posts 72
Joined 2005-09-13 06:10
20-year member
UID 42467
Status Offline
study.....................................
Floor 13 Posted 2005-10-21 16:59 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Who is using large hard drives, such as 80G, 120G, 160G? Could you please post the parameters according to the format I wrote on the 7th floor?
Floor 14 Posted 2005-10-21 17:35 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 15 Posted 2005-10-24 13:01 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
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-21 17:35:
I'm using an 80G

Are you replying to this post just to tell us that you're using an 80G hard drive?
Forum Jump: