: nasmw -f coff inicio.asm -o inicio.o
: nasmw -f coff video.asm -o video.o
: ld -i -e inicio -Ttext 0x0500 --oformat binary -o kernel.bin inicio.o video.o
: (From NASM)
: inicio.asm:31: error: unrecognised directive [ORG]
IIRC the org directive is only applicable to certain output formats... perhaps only binary files.
: video.asm:27: error: COFF format does not support non-32-bit relocations
: video.asm:85: error: COFF format does not support non-32-bit relocations
It's true
If you want to output COFF objects, your asm file must be defined "bits 32"
: nasmw -f bin inicio.asm -o inicio.o
: nasmw -f bin video.asm -o video.o
: ld -i -e inicio -Ttext 0x0500 --oformat binary -o kernel.bin inicio.o video.o
: video.asm:27: error: binary output does not suport external references
: video.asm:85: error: binary output does not suport external references
Also true
The binary file format is just that; a flat, binary file. There is absolutely no formatting imposed on it, which means the binary file cannot have linking information in it (which means your global and extern are useless in binary files).
You can't (easily) link flat binaries together.
: inicio.o: file not recognized: File format not recognized
Not even ld can link flat binaries
:nasmw -f obj inicio.asm -o inicio.o
:nasmw -f obj video.asm -o video.o
:ld -i -e inicio -Ttext 0x0500 --oformat binary -o kernel.bin inicio.o video.o
:inicio.asm:31: error: unrecognised directive [ORG]
I would suggest getting rid of your org statements and using another mechanism (such as setting DS) to offset your code. Org's problematic, and unsupported by many object file formats.
: inicio.o: file not recognized: File format not recognized
ld doesn't support obf format objects.
Depending on your version of ld, it'll support coff, aout and/or elf. Since you seem to be compiling in windoze (yuck!
your version of ld will probably only support coff, but perhaps also a.out... it's been a while since I've crossed the m$ line
:nasmw -f oaut inicio.asm -o inicio.o
:nasmw -f oaut video.asm -o video.o
:ld -i -e inicio -Ttext 0x0500 --oformat binary -o kernel.bin inicio.o video.o
:inicio.asm:31: error: unrecognised directive [ORG]
Again, get rid of org. What do you intend to use it for?
And, since you got not ld warnings, obviously your ld supports a.out objects as well
:In the cases where the [ORG] directive cause an error if I disable it then I :get the folowing error message:
: (From LD)
: inicio.o: file not recognized: File format not recognized
That's not cause-and-effect... even if the org would've assembled, you still would've gotten the ld error. Your ld will only link coff or a.out objects, therefore, stick to assembling those objects types, and set DS instead of using ORG and you should be alright.
Jeff