Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

convert .bin to .img using makefile

I was writing a simple bootloader,
I am using this make file command to convert the main.bin to a main_floppy.img

cp -f build/main.bin build/main_floppy.img

but I keep getting this error

nasm src/main.asm -f bin -o build/main.bin cp -f build/main.bin
build/main_floppy.img process_begin: CreateProcess(NULL, cp -f
build/main.bin build/main_floppy.img, ...) failed. make (e=2): The
system cannot find the file specified. make: *** [Makefile:3: setup]
Error 2

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Looks like you’re running Windows.
Try this instead:

all:
   nasm src\main.asm -f bin -o build\main.bin 
   rename build\main.bin main_floppy.img

If you’re indeed running Linux (we don’t know), try this:

all:
   nasm src/main.asm -f bin -o build/main.bin
   cp build/main.bin build/main_floppy.img

(I just splitted the two commands in two different lines)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading