LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-30-2014, 03:11 AM   #1
n.a.s
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Rep: Reputation: Disabled
adding hello system call in kernel 2.6.32


Hi,

I download kernel 2.6.32 ,and I want to add simple system call "hello world" , I followed steps - but while compiling I got these errors:

Make[1]: no rule to make target ('block/hello/sys_hello.o' needed by 'block/hello/built-in.o')
make ** [block/hello/]

Any help is much appreciated!

Thanks,
N.A.S
 
Old 04-30-2014, 04:19 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Can you show us your source code. What programming language are you using?
jdk
 
Old 04-30-2014, 04:22 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
This may be helpful to you in decoding the kernel error messages:
http://www.gnu.org/software/make/man...-Messages.html
 
Old 04-30-2014, 11:36 AM   #4
n.a.s
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jdkaye View Post
Can you show us your source code. What programming language are you using?
jdk
Thanks jdk, here is my code. I use c

#include <linux/kernel.h>

asmlinkage long sys_hello(void)
{
printk("Hello world\n");
return 0;
}


This is the Makefile where I update only one line:


ifeq ($(KBUILD_EXTMOD),)
core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/hello/

vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
$(net-y) $(net-m) $(libs-y) $(libs-m)))

vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
$(init-n) $(init-) \
$(core-n) $(core-) $(drivers-n) $(drivers-) \
$(net-n) $(net-) $(libs-n) $(libs-))))

init-y := $(patsubst %/, %/built-in.o, $(init-y))
core-y := $(patsubst %/, %/built-in.o, $(core-y))
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y))
net-y := $(patsubst %/, %/built-in.o, $(net-y))
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y))
libs-y := $(libs-y1) $(libs-y2)

....................
I created another Makefile inside the folder I created named as hello

obj-y := sys_hello.o

Last edited by n.a.s; 04-30-2014 at 12:33 PM.
 
Old 04-30-2014, 11:37 AM   #5
n.a.s
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TheIndependentAquarius View Post
This may be helpful to you in decoding the kernel error messages:
http://www.gnu.org/software/make/man...-Messages.html
Thank you ,I'll look at it..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding a system call to the Linux kernel SlackBuddy Linux - Kernel 2 10-05-2011 12:17 PM
Adding a system Call to Kernel kalyan.m Linux - Kernel 11 06-08-2011 02:01 AM
adding a new system call to kernel in LFS lfs_rocks Linux From Scratch 1 05-03-2008 11:12 PM
adding a new system call to kernel in LFS lfs_rocks Linux - Kernel 1 04-28-2008 10:17 AM
Adding new System Call to Kernel kurt_ram Linux - General 1 10-22-2002 04:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration