LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-09-2014, 06:42 AM   #1
daf1kpp
LQ Newbie
 
Registered: Feb 2013
Posts: 19

Rep: Reputation: Disabled
How to add header file


Hey,

I wanted to do some linux kernel modifications to learn it for myself.

I edited file /usr/src/linux/drivers/block/ide.c and added there function call, I also added header myLib.h to ide.c file. It looks like that:

ide.c
Code:
...
#include "myLib.c"
...
doTest1();
...
myLib.h
Code:
void doTest1(void);
myLib.c
Code:
void doTest1()
{
 printk(KERN_INFO "DONE ITS WORKING");
}
myLib.h and myLib.c are both blaced in /usr/src/linux/drivers/block/

While compiling kernel i get some kind of info of missing reference for doTest1() function.

So far I have found that i should modify /usr/src/linux/drivers/block/Makefile Is it right way or something else is wrong ? Is modifying Makefile is right then how to modify it ?


Thanks!
 
Old 03-09-2014, 07:58 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you need to include .h files, therefore #include "myLib.c" is definitely not ok.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
add header to sk_buff and send rrlangly Programming 3 10-07-2013 01:20 PM
Want to add data in the header field of tcp/ip header Maitrikkshah Linux - Networking 1 08-06-2011 06:07 AM
How to check missing header files included from another header file adisan82 Linux - Software 1 01-28-2011 03:57 AM
Apache config file to add header and footer mindstormsguy Linux - Software 2 05-02-2004 12:48 PM
I think I want to add C header files to my KDevelop project? Scrag Programming 3 03-26-2004 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration