中国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-23 13:28
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » Who has a small program that can read and write the boot sectors of floppy disks and hard disks
Printable Version  2,338 / 11
Floor1 nre Posted 2004-03-07 00:00
银牌会员 Posts 361 Credits 1,210
For use under DOS, as small as possible
Floor2 GOTOmsdos Posted 2004-03-08 00:00
铂金会员 Posts 1,827 Credits 5,154
Isn't debug the most suitable? Do you need anything else with it?
Floor3 Chrysalis Posted 2004-03-08 00:00
初级用户 Posts 10 Credits 152
I saw a book about CD burning mention a small software for reading sectors. Be careful to pay attention, maybe you can find it.
Floor4 Chrysalis Posted 2004-03-08 00:00
初级用户 Posts 10 Credits 152
I saw a book about CD burning mentioned a small software for reading sectors. Be careful and you might be able to find it.
Floor5 qzwqzw Posted 2004-03-09 00:00
银牌会员 Posts 636 Credits 2,343
Debug is the best, very small, and not hard to find.

Read disk boot sector
-L 100 0 0 1
-N boot.dat
-W
-Q


Write disk boot sector
-N boot.dat
-L
-W 100 0 0 1
-Q
100 refers to the memory address for saving or reading
The first 0 refers to drive A, drive C is 2, and so on
Floor6 nre Posted 2004-03-13 00:00
银牌会员 Posts 361 Credits 1,210
Thanks, may I ask how to use DEBUG to generate a program with parameters as above, for example, the file name is bs.com. I want the program to be able to achieve bs 0 boot.dat to A and bs 1 boot.dat to B.
Floor7 willsort Posted 2004-03-13 00:00
元老会员 Posts 1,512 Credits 4,432
Re nre:

You can use batch processing to create an interface. The following is a simple code:
::BOOTMAN.BAT - By Will Sort, 2004/03/13
@echo off
if == goto help
set file=%3
if == set file=boot_%2.dat
for %%a in (S s SAVE save) do if == goto save
for %%a in (L l load save) do if == goto load

:help
echo.
echo BOOTMAN.BAT - Boot sector save/restore tool
echo.
echo Usage: BOOTMAN specifies operation specifies disk
echo Operation: S s SAVE save are all for saving, L l LOAD load are all for restoring;
echo Disk: A is 0, B is 1, and so on
echo File: Complete file name, if not specified, it is boot_disk parameter.dat
goto end

:savepre
echo L 100 %2 0 1>%temp%.\bootman.asd
echo N %file%>>%temp%.\bootman.asd
echo W>>%temp%.\bootman.asd
echo Q>>%temp%.\bootman.asd
goto operate

:loadpre
echo L 100 %2 0 1>%temp%.\bootman.asd
echo N %file%>>%temp%.\bootman.asd
echo W>>%temp%.\bootman.asd
echo Q>>%temp%.\bootman.asd
goto operate

perate
if not exist %temp%.\bootman.asd
debug nul
echo Operation completed!
del %temp%.\bootmam.asd
set file=

:end

This is a command-line direct operation interface program. It can also be made into a wizard-type interface. You can refer to the following program
Written on the spot, not tested, please use it with caution, building!
http://model.chinajewelry.net/dos/dosbbs/dispbbs.asp?boardID=6&ID=9587


Floor8 nre Posted 2004-03-13 00:00
银牌会员 Posts 361 Credits 1,210
Thank you very much!!!
Floor9 Climbing Posted 2004-03-14 00:00
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
Bart's MKBT can read and write boot sectors, and it seems to support the boot sectors of NT/2k/2003 as well.

Link: http://www.nu2.nu/mkbt

Read: mkbt -x -c c: c:\bootsect.bin
Write: mkbt -x c:\bootsect.bin c:
Floor10 moroko Posted 2004-03-15 00:00
高级用户 Posts 198 Credits 919
The following is the speech of qzwqzw on 2004-3-9 21:43:16:
Debug is the best, also very small, and not to worry about not finding.

 Read disk boot sector
-L 100 0 0 1
-N boot.dat
-W
-Q


 Write disk boot sector
-N boot.dat
-L
-W 100 0 0 1
-Q
100 refers to the memory address for saving or reading
The first 0 refers to drive A, drive C is 2, and so on




Can the boot of a floppy disk be written to a hard disk? ? ?
Floor11 qzwqzw Posted 2004-03-15 00:00
银牌会员 Posts 636 Credits 2,343
Sure, and it's simpler.

-L 100 0 0 1
-W 100 2 0 1
-Q

The above is written to the C drive. For the D drive, change the 2 in the W line to 3, and so on for other drives.
Floor12 Kinglion Posted 2004-03-20 00:00
铂金会员 Posts 1,924 Credits 5,798 From 金獅電腦軟體工作室
Please go to http://model.chinajewelry.net/dos/dosbbs/dispbbs.asp?boardID=6&ID=9076 to take a look. There is a small program I wrote there, which has code for reading and writing the floppy disk boot sector. It may be helpful to the楼主.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023