OK, I will leave that topic alone and proceed.
@stevewoods1986, if you are still reading this: can you describe what your plan of attack on this is a bit more, please?
While NASM (and FASM, I think -
EDIT: yes, it does; you can use the
format binary and
use16 assembler directives together to get a real mode executable image) is perfectly capable of producing a binary image from a single assembly source (which could have includes of other NASM source files in it, I suppose), such an image cannot be then linked - not by
any tool I am aware of. You need to have them in a linkable object format in order to build the executable from separate
Object Files, regardless of the final target.
There really isn't any other way to do this with most toolchains - it is not specifically a GCC/GAS or NASM issue.
As an aside: it may be worth mentioning that it is not feasible to try to combine the boot block and the stage of the OS loaded by the boot block into a single image, even if they end up adjacent in the disk image. I don't know if this is something you are considering, but I made that mistake myself early on, and I've seen others do so as well.
The usual approach for producing a binary image from a composite program - regardless of the source code in the different parts - is to compile or assemble to a linkable format, then link them into a general relocatable executable format such as ELF or PE, then use a tool such as
objdump to produce the raw image file.
As has been mentioned, if you are using ELF files under Linux (and, I think, PE files in Windows with the Cygwin or MinGW toolchain ports) you can use a linker script to tell
ld to produce a binary image directly, but this would still need to be produced from one or more linkable object files. This may not be worth the trouble in this instance, as it sounds like your intent is to simply test a few aspects of things right now, but (depending on your toolchain) you will probably need to learn how to work with linker scripts at some point in order to get the fine control over the executables which you will need. Just a heads' up.
However, given that this seems to be a test, and one meant to run in real mode, using the binutils/GCC toolchain at all may present a problem, as they have only minimal support for targeting 16-bit real mode (I found
this blog post discussing the topic in greater detail, if you are curious). There are a number of other C compilers that can target real mode - the previously mentioned OpenWatcom, for example, or
Bruce's C Compiler (most Linux package managers will have it in their repos, and there's a short piece about using it
here) - but GCC cannot.