JamesMolloy tutorial fails to compile
Posted: Thu Mar 03, 2022 11:15 am
Trying to compile this http://www.jamesmolloy.co.uk/tutorial_h ... nesis.html
I get:
The makefile is:
I have gcc: gcc (GCC) 11.2.0
nasm: 2.15.05
and ld: 2.38
What is the problem? How do I tell ld to output in the correct format?
I get:
Code: Select all
ld -Tlink.ld -o kernel boot.o main.o
ld: i386 architecture of input file `boot.o' is incompatible with i386:x86-64 output
make: *** [Makefile:18: link] Error 1
Code: Select all
SOURCES=boot.o main.o
CFLAGS=-nostdlib -nostdinc -fno-builtin -fno-stack-protector
LDFLAGS=-Tlink.ld
ASFLAGS=-felf
all: $(SOURCES) link
clean:
-rm *.o kernel
link:
ld $(LDFLAGS) -o kernel $(SOURCES)
.s.o:
nasm $(ASFLAGS) $<
nasm: 2.15.05
and ld: 2.38
What is the problem? How do I tell ld to output in the correct format?