OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 16, 2024 8:04 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [solved] link nasm to c
PostPosted: Mon Mar 22, 2021 2:44 am 
Offline
Member
Member
User avatar

Joined: Sun Mar 21, 2021 1:09 pm
Posts: 38
Location: current location
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.

_________________
iustitiae iniustos iudicat


Last edited by acccidiccc on Tue Mar 23, 2021 2:25 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: link nasm to c
PostPosted: Tue Mar 23, 2021 2:14 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5134
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:
Code:
.SUFFIXES: .o .c .S .asm


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:
Code:
.asm.o:
   nasm -f elf -MD -o $@ $<


(I haven't tested this so the syntax may not be quite right.)


Top
 Profile  
 
 Post subject: Re: link nasm to c
PostPosted: Tue Mar 23, 2021 2:25 pm 
Offline
Member
Member
User avatar

Joined: Sun Mar 21, 2021 1:09 pm
Posts: 38
Location: current location
thanks a ton! this worked and now i can implement interrupts peacefully.

_________________
iustitiae iniustos iudicat


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 584 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group