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 19:44
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How to directly read and write to the hard disk using BIOS's IO? View 1,548 Replies 8
Original Poster Posted 2006-03-13 21:27 ·  中国 内蒙古 呼和浩特 教育网
高级用户
★★
Credits 506
Posts 187
Joined 2005-12-04 22:41
20-year member
UID 46500
Gender Male
Status Offline
Floor 2 Posted 2006-03-13 23:01 ·  中国 广东 中山 电信
高级用户
★★★
Credits 972
Posts 420
Joined 2004-05-16 00:00
22-year member
UID 24467
Gender Male
Status Offline
ATA Command
BIOS INT13
DOS INTXX

Never heard of BIOS IO
平生进退如飙风
Floor 3 Posted 2006-03-14 12:19 ·  中国 湖北 宜昌 电信
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
Reading and writing to I/O ports in QBASIC is very simple. OUT is for writing to a port. INP is for reading from a port. I don't know if the original poster knows how to use QBASIC.
Floor 4 Posted 2006-03-22 11:56 ·  中国 北京 联通
高级用户
★★
Credits 506
Posts 187
Joined 2005-12-04 22:41
20-year member
UID 46500
Gender Male
Status Offline
Brothers, int13 and interrupts under DOS are all very simple. I just want to bypass Lenovo's protection system and how to write to a sector. I think if I directly issue instructions to the CPU, can that work? How should I do it? How to handle the ATA Command?
Floor 5 Posted 2006-03-22 13:31 ·  中国 湖北 宜昌 电信
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
It's very simple. If you know a programming language, it's very simple. Do you know qbasic!
If you do, you can take a look at the post I wrote about getting the hard disk serial number. That program directly uses I/O ports.

Because the BIOS doesn't provide the service of the hard disk serial number, so you must send instructions to the hard disk's ports such as (&H170......) by yourself, and then read the serial number. Note that this serial number is not the number of each partition of the hard disk. Some netizens say that the C drive, D drive, etc. all have serial numbers. In fact, that's the volume label!

The advantage of reading and writing the hard disk through I/O instructions is: you can bypass the services provided by the BIOS, so you can break through restoration software, and you can read and write hard disks no larger than 137GB on old 486 computers!
Of course, the more important use is not here. There are many hard disk-specific commands that must be implemented through I/O instructions, such as writing negative tracks, adding bad sectors to the G table, etc.
All powerful hard disk repair software use I/O instructions, such as the PC3000 and MHDD that we are familiar with.

It is recommended that you learn a programming language. C language is the best choice! Although I don't know C language, I only know qbasic!
Floor 6 Posted 2006-03-22 14:48 ·  中国 北京 联通
高级用户
★★
Credits 506
Posts 187
Joined 2005-12-04 22:41
20-year member
UID 46500
Gender Male
Status Offline
To be honest, C language is acceptable. Or directly using assembly can also be done roughly.
I'll first look for your post. Thanks qb45.
By the way, is the qb moderator in programfan you? The names are the same.
Floor 7 Posted 2006-03-22 15:35 ·  中国 北京 联通
高级用户
★★
Credits 506
Posts 187
Joined 2005-12-04 22:41
20-year member
UID 46500
Gender Male
Status Offline
qb45: I can't find your post. I saw your post about the restore card before, but it's okay without the restore card, but it doesn't work after installing it. What should I do?
Floor 8 Posted 2006-03-23 11:58 ·  中国 浙江 宁波 鄞州区 电信
中级用户
★★
Credits 300
Posts 137
Joined 2005-11-04 02:00
20-year member
UID 44559
Gender Male
Status Offline
Why not name it QB71? Isn't there a version 7.1?
Floor 9 Posted 2006-03-27 15:59 ·  中国 河北 唐山 联通
版主
★★★
操作系统爱好者
Credits 1,113
Posts 392
Joined 2002-11-11 00:00
23-year member
UID 228
Gender Male
Status Offline
If only writing the hard disk hidden sector, HDSECT is enough (it's in the Super Emergency Disk)
DOS之家 http://doshome.com 站长 葛明阳
Forum Jump: