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-07-05 01:25
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » ****Compressed Volume! Sector/Image/Sector Reading and Writing] The Mini Hard Disk Reader and Writer is Completed B View 25,132 Replies 93
Original Poster Posted 2006-07-08 02:29 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
The mini hard disk reader and writer under DOS is finally completed!
Can read and write absolute sectors, support large hard disks, USB flash drives (need to load drivers), and floppy disks..
Due to high code efficiency, it is very fast.
Preliminarily passed the test.
Finally, a bold write test was carried out on my own machine, that is, writing bad data to the hard disk. After the hard disk crashed, the pre-backed-up data was restored to the hard disk with this program, and the hard disk was as good as new..

There is source code for everyone to play with...

Sorry: The first time I uploaded the wrong executable file, now I have re-uploaded it.
Just added a prompt for the reason if there is a reading or writing error
Replaced with C comments, so it can be compiled without TC3 (BC31), TC2
Just solved the BUG that the basic INT13 does not show the error prompt..
In addition to considering being able to read and write 2048GB, the detection of negative numbers for incorrect input of the starting sector and the number of sectors to be processed is not added (otherwise, it can only read and write about 1024GB). Detection has been carried out for the other several input parameters..

Considering the objective opinions of DOSFOREVER
Today, added that if the extended 13 interrupt is not supported, the parameters of the hard disk itself are first obtained and displayed, and the basic 13 interrupt is called to read and write with its CHS value, so that it is compatible with hard disks that are not 255 heads and 63 sectors (that is, very old hard disks), so that the compatibility of the program is very strong..

Also added the function of reading and writing "non-1.44mb" floppy disks, and the instructions are in the main post...

In addition, even if the extension is supported, the hard disk parameters are obtained according to the extended 48th function and displayed.
Displaying the hard disk parameters can make the user have a clear understanding..

In addition, the read-write buffer of the extended 13 is increased to the number of bytes of 100 sectors, so that the speed is faster!
(Can't exceed this anymore, otherwise, it will exceed the maximum number of file reads and writes)

The program is basically coming to an end here...
If you need to expand the program functions, you can add them to the program..

Everyone is welcome to download and play..
I hope it will be a little helpful for those who are interested..

***********************************
%%%%%%%%%%%%%%%%%%%%%%%%%%%

Successfully added compression and volume splitting functions! And adopted the Linux help style...

Preliminarily passed the test! Welcome to try out!..

The main post program has been updated!

[ Last edited by GOTOmsdos on 2006-8-8 at 12:14 ]
Attachments
mydisk.rar (170.57 KiB, Credits to download 1 pts, Downloads: 339)
Floor 2 Posted 2006-07-08 03:26 ·  中国 上海 杨浦区 电信
高级用户
★★
Credits 653
Posts 252
Joined 2006-04-16 19:48
20-year member
UID 53939
Status Offline
Give support to Brother GOTOmsdos!
Floor 3 Posted 2006-07-08 12:18 ·  中国 浙江 台州 椒江区 电信
中级用户
★★
Credits 447
Posts 126
Joined 2004-02-10 00:00
22-year member
UID 17150
Gender Male
Status Offline
Posting in the middle of the night, it seems you've put in quite some effort. It's estimated to be about the extended INT13 programming combining C language and assembly language. It might not be needed for now, but I'll still download it and support it.
从来不用别人的东西,要用,也先改成自己的再说!
Floor 4 Posted 2006-07-08 12:32 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
Thanks for your attention,

These days I've been working on hard disk reading and writing, both for DOS and 2K/XP, and just finished all of it, staying up late.

Mainly expanding INT13 and basic INT13, combining INT25 and INT26..

Since it's in command line mode, so if there are programs that need to read and write hard disk sectors in command line mode, this can solve the problem..

[ Last edited by GOTOmsdos on 2006-7-8 at 12:35 ]
Floor 5 Posted 2006-07-08 17:59 ·  中国 河北 唐山 中移铁通
版主
★★★
操作系统爱好者
Credits 1,113
Posts 392
Joined 2002-11-11 00:00
23-year member
UID 228
Gender Male
Status Offline
Support
DOS之家 http://doshome.com 站长 葛明阳
Floor 6 Posted 2006-07-08 18:40 ·  中国 四川 广元 电信
初级用户
Credits 55
Posts 22
Joined 2006-05-26 19:42
20-year member
UID 56051
Status Offline
It's hard work. Let's study.
Floor 7 Posted 2006-07-08 23:49 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
Floor 8 Posted 2006-07-09 02:03 ·  中国 香港 Cyber_Express通信公司
银牌会员
★★★
阿林
Credits 1,410
Posts 497
Joined 2004-06-28 00:00
22-year member
UID 27551
Gender Male
From 九龍,香港
Status Offline
Originally posted by GOTOmsdos at 2006-7-8 02:29 AM:
The mini hard disk reader/writer under DOS is finally completed!
Can read and write absolute sectors, support large hard disks, USB flash drives (need to load drivers), and floppy disks.
Due to high code efficiency, it is very fast.



Support! Thanks for your hard work, Brother gotoMSDOS, staying up late to program...

What is a USB flash drive?

Some suggestions:

1) I remember when playing Apple]



dolba

Example:

Read to file: dolba r 2 0 254 c:\backup
Write from file: dolba w 2 0 c:\backup


Thanks for sharing!

我 的 網 站 - http://optimizr.dyndns.org
Floor 9 Posted 2006-07-09 02:16 ·  中国 山东 济宁 联通
钻石会员
★★★★★
Credits 10,046
Posts 3,039
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
Go back to the upper floor, the USB flash drive is flash drive
简单就是美
Floor 10 Posted 2006-07-09 02:33 ·  中国 香港 Cyber_Express通信公司
银牌会员
★★★
阿林
Credits 1,410
Posts 497
Joined 2004-06-28 00:00
22-year member
UID 27551
Gender Male
From 九龍,香港
Status Offline
Thanks, we call it "finger" here.
我 的 網 站 - http://optimizr.dyndns.org
Floor 11 Posted 2006-07-09 03:32 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
Thanks for your attention
dolba
This doesn't seem appropriate
Because only when w, can sectorToDo be omitted

So writing two lines is clearer:
dolba r|w driveNum startSector sectorToDo file
dolba w driveNum startSector file

[ Last edited by GOTOmsdos on 2006-7-9 at 03:33 ]
Floor 12 Posted 2006-07-09 04:43 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
After downloading, I tested it. Taking reading the master boot sector of the first hard drive as an example, the process is shown as follows:


dolba r 2 0 1 sec0
dolba version 1.0 Copyright (c) 2006 by GOTOmsdos Email: tdaim@sina.com
Read :
Drive 2
Starting sector 0
1 Sectors
To :
File "sec0" ? (Y/N)y

Extended int13 supported.
Press Esc to stop.
100% sectors done.
Done.



Unexpectedly, the content read is not the content of the master boot sector, and I don't know which sector it is. But if the default DOS environment is used, that is, the memory configuration environment without config.sys and autoexec.bat is used, the read content is normal. In addition,按理说 an operation of one sector should be a very quick thing. Even if there are several sectors, it should be completed in an instant on the current machine, but the test process of my reading the MBR to a file this time can be perceived by people with a noticeable delay (in the memory configuration environment with config.sys and autoexec.bat).
Floor 13 Posted 2006-07-09 13:45 ·  中国 香港 Cyber_Express通信公司
银牌会员
★★★
阿林
Credits 1,410
Posts 497
Joined 2004-06-28 00:00
22-year member
UID 27551
Gender Male
From 九龍,香港
Status Offline
Originally posted by GOTOmsdos at 2006-7-9 03:32 AM:
Thanks for your attention
dolba
This doesn't seem appropriate
Because only when w can sectorToDo be omitted



My original intention was to enclose the parameters, but it was not clear without enclosing. Having examples for reference is less error-prone.
我 的 網 站 - http://optimizr.dyndns.org
Floor 14 Posted 2006-07-09 17:03 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
TO DOSforever

After reading the situation you described, I don't know the reason. If your input is correct, it might be related to what you mentioned about CONFIG.SYS and AUTOEXEC.BAT.
If this is true, it's a bit strange. Logically speaking, the configurations of CONFIG.SYS and AUTOEXEC.BAT shouldn't have an impact on the hard disk structure (I've been using such configurations all the time).

不妨 put your "influencing" CONFIG.SYS and AUTOEXEC.BAT configurations here for us to take a look.
Also, it's best to retry to confirm that the operation input is correct..

It is suggested that you do a small test:
Under the same CONFIG.SYS and AUTOEXEC.BAT configurations, try using other tools that read and write hard disk sectors to do the same thing and see the result? If this tool succeeds and my program doesn't, then it means there's an issue with my program.

As for the speed,
My computer is 733, which is relatively old. The speed is not extremely fast, (it feels a bit faster than SPFDISK, DISKEDIT, maybe because I didn't introduce write verification, because I don't think it's necessary, and it affects the speed)
For example, writing ten thousand sectors takes only about 2 or 3 seconds. Writing one hundred thousand sectors takes about half a minute.

I've been testing these days. First, I save with SPFDISK, then with my program, then FC /B them,
they are all the same. And I've done several write operations, and there are no problems at present (a few bugs have been fixed).

Other forum users, if interested, can test the read operation. See how the result is?
Finally, testing beyond 8.4g is, that is, exceeding 16434494 sectors.

Just updated the code with improvements again.

[ Last edited by GOTOmsdos on 2006-7-9 at 20:02 ]
Floor 15 Posted 2006-07-09 17:08 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
Originally posted by johnsonlam at 2006-7-9 01:45 PM:


I originally intended to enclose the parameters, but without enclosing them makes it unclear. Having examples for reference is less likely to make mistakes.


But square brackets indicate optional, not for aesthetics!
1 2 3 7 Next ›
Forum Jump: