-2

Im trying to objcopy two files together but its just not working...

I tried the following: objcopy -I bootloader.bin extendedprogram.bin -O bootloader.flp The result was: llvm-objcopy: error: 'extendedprogram.bin': The file was not recognized as a valid object file

Before i created kernel.bin and i successfully combined them but with extendedprogram.bin it is not working.

Here is the contents of extendedprogram.asm (source of .bin) (compiled with nasm): [org 0x7e00]

mov bx, ExtendedSpaceSuccess call PrintString

jmp $

%include "print.asm"

ExtendedSpaceSuccess: db 'We are successfully in extended space', 0

times 2048-($-$$) db 0 ~

7
  • What do you expect objcopy to do? If those are two plain binary files just cat them together. Anyway, you are missing the argument for the -I switch. How do you create the bin files and what was the objcopy command that worked previously?
    – Jester
    Commented Jul 6 at 14:00
  • i create bin files with nasm, and objcopy -I bootloader.bin kernel.bin -O binary bootloader.flp worked
    – hav0x
    Commented Jul 6 at 14:09
  • Yeah but what is the exact command line for nasm. What is the output format. Anyway that should not have worked because -I requires a format name (should give error message "Invalid bfd target")
    – Jester
    Commented Jul 6 at 14:12
  • nasm -o extendedprogram.bin extendedprogram.asm
    – hav0x
    Commented Jul 6 at 14:13
  • and llvm-objcopy -I bootloader.bin kernel.bin -O binary kernel.flp worked
    – hav0x
    Commented Jul 6 at 14:15

0

Browse other questions tagged or ask your own question.