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-08-01 03:22
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How to use assembly to read and write large hard disks with more than 1024 cylinders? [Attention] View 974 Replies 1
Original Poster Posted 2003-06-30 00:00 ·  中国 上海 静安区 电信
初级用户
Credits 161
Posts 14
Joined 2003-06-04 00:00
23-year member
UID 3453
Gender Male
Status Offline
Does anyone know how to use assembly to read and write large hard disks with more than 1024 cylinders? That is, the extended int 13h function calls.
Floor 2 Posted 2003-09-15 00:00 ·  中国 湖北 宜昌 电信
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
First, thanks to ATLaS. From the website he told me about, I found detailed information on extended INT13.
Read AH=42H, write AH=43H, get disk parameters AH=48, DS:SI=packet (instead of using registers)
Related knowledge:
We know that a hard disk's capacity and sectors are determined by three values: the number of cylinders (Cylinder), the number of heads (Head), and the number of sectors (Sector), abbreviated as CHS. The ATA specification defines the interface CHS register configuration as 28bit, that is C:16bit; H:8bit; S:4bit. We should all remember the 8.4GB hard disk limit from many years ago, right? At that time, operating systems needed to access hard disks through the INT13 API interface under DOS. Although the hard disk CHS registers are 28bit, the bottleneck was the INT13 API's C:10bit; H:8bit; S:6bit. So the maximum accessible capacity was only 210×28×(26-1)=16515072 sectors. The first sector cannot be 0, so subtract 1. Each sector is 512 bytes, so the maximum capacity is 8.46 GB (hard disk manufacturers all use 1000 as the conversion unit), and that is how the 8.4 capacity limit came about.
Forum Jump: