My problem only occurs when building on my laptop.
My makefile runs a few commands to compile my kernel. It first assembles the main assembly, which works fine.
It then tries to compile the main C file, with the following command:
Code: Select all
i686-elf-gcc -c kern.c -o build/kern.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
Code: Select all
/tmp/ccLtKHxr.s: Assembler messages:
/tmp/ccLtKHxr.s:52: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:55: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:57: Error: register save offset not a multiple of 8
/tmp/ccLtKHxr.s:74: Error: invalid instruction suffix for `pop'
/tmp/ccLtKHxr.s:78: Error: invalid instruction suffix for `pop'
/tmp/ccLtKHxr.s:99: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:102: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:104: Error: register save offset not a multiple of 8
/tmp/ccLtKHxr.s:185: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:194: Error: invalid instruction suffix for `pop'
/tmp/ccLtKHxr.s:197: Error: invalid instruction suffix for `pop'
make: *** [Makefile:4: all] Error 1
It also seems weird that it compiles fine on my main computer, but not my laptop.
I can provide the source files if necessary, but it's difficult to find a relevant piece of code. The entire source is available at https://github.com/j4cobgarby/atomic-kernel, if that helps.