Yeah! (statistically, more people are ignoring him than helping him now! :)
I think the only problem with "partcopy" is that you're asking it to read more than you've got in the file. Cut it down to:
partcopy test.bin 0 2C -f0 200
May work... An alternative... You've got the lame little program "writeit.asm":
; Your boot sector: DOS FILE: WRITEIT.ASM
; nasm -f bin -o writeit.com writeit.asm
[BITS 16]
[ORG 0x100]
mov ax,3D00h
mov dx,filename
int 21h
; check for errors here!
jc exit
mov bx,ax
mov ah,3Fh
mov dx,buffer
mov cx,512
int 21h
; check for errors here!
jc exit
; at an equivalent point, "partcopy" apparently checks the
; number of bytes actually read (in ax). We could do the same.
; ... but we won't :)
mov ah,3Eh ; close input file...
int 21h
push ds ; don't think we need this...
pop es ; won't hurt.
mov bx, buffer
mov dl, 00h
mov dh, 0
mov cl, 1 ; change this to 2 for sector 2
mov ch, 0
mov ah, 03h
mov al, 1
int 13h
exit:
mov ax, 4C00h
int 21h
filename db 'BOOT.BIN',0 ; change to "test.bin" or whatever
;buffer times 512 db 0 ; is this correct nasm syntax?
; yeah, the syntax is fine, but why clutter up our executable
; with zeros?
section .bss
buffer resb 512
;-----------------------
Copy "writeit.asm" to "writek.asm" or something, make those couple changes, and it might work for you. But it's strictly a "one trick pony" - will only write a single sector, etc. We could make it a lot more powerful... prompt for the filename, show the length read and how many sectors it will take up, ask which sector to start writing it at, display results, prompt for another filename... until done. Might make an interesting "project" - sector to CHS arithmetic is a PITA... (example in Deb Wiles' "bootsect.bin", which you've got). But it's "been done".
You could also copy multiple .bin files to a single "image.bin" and write it to floppy with "rawwrite" or such:
copy /b boot.bin+map.bin+root.bin+kernel.bin+shell.bin image.bin
rawwrite image.bin
There's more than one way to skin a cat (but it makes a really small fur coat :)
Best,
Frank