Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Diskette image creation batch files (Emulation)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 15.12.2020, 22:38

Here's two variants of a batch file to do most of what you did. I didn't have the ROM-DOS files around so I made them with a few test files. Adjusting these scripts to install an actual DOS is left as an exercise to the reader. Likewise, using dd and bash for is easy to do based on this.

These scripts both assume that the source files are found in subdirectories of the DOS working directory. (All source files from my hg repos.) NASM and X need to be in the PATH. The directory testdir contains files that are all meant to be copied to the image. The ::empty keyword is a placeholder here, and could be replaced by actual files (found in the root directory not testdir).

Both scripts create almost the same output; the "large total sectors" field ends up initialised unnecessarily when using instsect. Still missing: File datetimes, file attributes.

=== makdx.bat

@echo %DEBUG%off
nasm -I lmacros/ ldosboot/boot.asm -D_COMPAT_LDOS -D_LOAD_NAME="'LDEBUG'" -o boot12.bin
x boot12.bin bootjump.bin 0 11
x boot12.bin bootcode.bin $3E
echo ; Auto-generated file, do not edit. > list.mac
echo %%define _BOOTJUMPFILE "bootjump.bin" >> list.mac
echo %%define _BOOTCODEFILE "bootcode.bin" >> list.mac
:: echo %%xdefine _PAYLOADFILE _PAYLOADFILE,::chdir,testdir >> list.mac
for %%i in (testdir\*.*) do echo %%xdefine _PAYLOADFILE _PAYLOADFILE,"%%i" >> list.mac
nasm -I lmacros/ bootimg/bootimg.asm -D_PAYLOADFILE=::empty -P list.mac -o diskette.img


=== makdinst.bat

@echo %DEBUG%off
nasm -I lmacros/ ldosboot/boot.asm -D_COMPAT_LDOS -D_LOAD_NAME="'LDEBUG'" -o boot12.bin
nasm -I lmacros/ instsect/instsect.asm -D_FAT16=0 -D_FAT32=0 -o inst12.com
echo ; Auto-generated file, do not edit. > list.mac
:: echo %%xdefine _PAYLOADFILE _PAYLOADFILE,::chdir,testdir >> list.mac
for %%i in (testdir\*.*) do echo %%xdefine _PAYLOADFILE _PAYLOADFILE,"%%i" >> list.mac
nasm -I lmacros/ bootimg/bootimg.asm -D_PAYLOADFILE=::empty -P list.mac -o diskette.img
inst12.com /M=diskette.img /S=boot12.bin
:: /SN
:: /F=ldebug.com

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 163 users online (0 registered, 163 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum