中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 00:22
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » ****Compressed Volume! Sector/Image/Sector Reading and Writing] The Mini Hard Disk Reader and Writer is Completed B
Printable Version  26,669 / 93
Floor1 GOTOmsdos Posted 2006-07-08 02:29
铂金会员 Posts 1,827 Credits 5,154
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)
Floor2 asbai Posted 2006-07-08 03:26
高级用户 Posts 252 Credits 653
Give support to Brother GOTOmsdos!
Floor3 crshen Posted 2006-07-08 12:18
中级用户 Posts 126 Credits 447
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.
Floor4 GOTOmsdos Posted 2006-07-08 12:32
铂金会员 Posts 1,827 Credits 5,154
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 ]
Floor5 gmy Posted 2006-07-08 17:59
版主 Posts 392 Credits 1,113
Support
Floor6 MySOFT2006 Posted 2006-07-08 18:40
初级用户 Posts 22 Credits 55
It's hard work. Let's study.
Floor7 GOTOmsdos Posted 2006-07-08 23:49
铂金会员 Posts 1,827 Credits 5,154
Floor8 johnsonlam Posted 2006-07-09 02:03
银牌会员 Posts 497 Credits 1,410 From 九龍,香港
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!

Floor9 Michael Posted 2006-07-09 02:16
钻石会员 Posts 3,041 Credits 10,056
Go back to the upper floor, the USB flash drive is flash drive
Floor10 johnsonlam Posted 2006-07-09 02:33
银牌会员 Posts 497 Credits 1,410 From 九龍,香港
Thanks, we call it "finger" here.
Floor11 GOTOmsdos Posted 2006-07-09 03:32
铂金会员 Posts 1,827 Credits 5,154
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 ]
Floor12 DOSforever Posted 2006-07-09 04:43
金牌会员 Posts 2,239 Credits 4,639
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).
Floor13 johnsonlam Posted 2006-07-09 13:45
银牌会员 Posts 497 Credits 1,410 From 九龍,香港
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.
Floor14 GOTOmsdos Posted 2006-07-09 17:03
铂金会员 Posts 1,827 Credits 5,154
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 ]
Floor15 GOTOmsdos Posted 2006-07-09 17:08
铂金会员 Posts 1,827 Credits 5,154
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 47  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023