so i have been following the meaty skeleton tutorial and wanted to implement interrupts. so i followed the tutorial on interrupts and now, how should i link the assembly to the c. I probably need to manipulate the kernel makefile, but i have no idea how.
sorry for asking a stupid question.
[solved] link nasm to c
- acccidiccc
- Member
- Posts: 38
- Joined: Sun Mar 21, 2021 1:09 pm
- Location: current location
[solved] link nasm to c
Last edited by acccidiccc on Tue Mar 23, 2021 2:25 pm, edited 1 time in total.
iustitiae iniustos iudicat
-
- Member
- Posts: 5568
- Joined: Mon Mar 25, 2013 7:01 pm
Re: link nasm to c
The makefile already supports assembly using GAS, so if you want to use NASM as well you'll have to specify another file extension for assembly using NASM instead of GAS. Add the suffix here:
And add a rule to build NASM assembly source files into object files right around the lines for building other source files into object files:
(I haven't tested this so the syntax may not be quite right.)
Code: Select all
.SUFFIXES: .o .c .S .asm
Code: Select all
.asm.o:
nasm -f elf -MD -o $@ $<
- acccidiccc
- Member
- Posts: 38
- Joined: Sun Mar 21, 2021 1:09 pm
- Location: current location
Re: link nasm to c
thanks a ton! this worked and now i can implement interrupts peacefully.
iustitiae iniustos iudicat