So, I'm making a desperate attempt to write an operating system kernel in x86 Assembly and I've been getting this error that, whilst being common amongst others, the solutions given don't apply. I may know what is causing this error (keyword: may) though I'm not quite sure how to resolve it, leading me to asking this question. Basically, the file that I am assembling is including another assembly file, and both files have a boot signature. I'm believing that the assembler thinks that the second file (the one I'm actually assembling) is writing to the same sector, going over the 512 byte limit and therefore giving me this error. This may not be the problem, but to me, it seems to be the most rational one. Also, even if I don't get errors from linking both files with the GNU linker, the disk image still comes out bad and can't boot, so that's why I've resolved to including files.
As mentioned in the details of said problem, I've tried linking it with the GNU linker, but that just made a corrupted image that I just, couldn't use. I tried looking in to other problems but, as mentioned, none of the solutions worked. I was expecting that after trying everything mentioned it would of worked, but nothing worked. If the solution I'm using to write this is faulty, I'd agree, so I'd assume that there is (obviously) better solutions to this.
EDIT: Since My question doesn't show a minimal example, I've edited the question to show the code given in the second file. Sorry for that.
%include 'boot.s'
mov ah, 0Eh
mov al, 'H'
mov bh, 1
mov bl, 15
int 0x10
times (510 - $ + $$) db 0
dw 0AA55h