LinuxQuestions.org
Register a domain and help support LQ
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 08-30-2012, 11:49 PM   #1
arinsat
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Rep: Reputation: Disabled
First kernal module


Hi,
I try to build my own kernal module with simple init & cleanup functions.I create a make file.(both are taken from sample examples in internet).When i try to compile using 'make' command. The 'bash:command not found'error is displayed.
I dont know whether i missed any kernal package.
Help me to solve this issue.
 
Old 08-30-2012, 11:52 PM   #2
SIG_SEGV
Member
 
Registered: Jul 2012
Location: Banglore, INDIA
Distribution: Fedora-Core
Posts: 70

Rep: Reputation: 11
Try whether your system has 'make' using command 'whereis make'. If its not showing any path then you have to get it explicitly
 
Old 08-31-2012, 08:04 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Welcome to LQ.

Which "Linux OS" are you using ? ?
http://www.linuxquestions.org/linux/...Ask_a_Question
http://linuxsilo.net/docs/smart-questions_en.html
... Like Fedora 17, Ubuntu 12.04, etc.

A "standard" kernel module Makefile ( for hello.c ) :
Code:
obj-m    := hello.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
 
Old 09-01-2012, 12:34 PM   #4
arinsat
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
First kernal module

Hi,
The version is 2.6.15 as read by giving the command 'uname -a'.
when i try with 'whereis make' cmd, it shows 'make:'.Explicittly mean any package or...
 
Old 09-01-2012, 01:52 PM   #5
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by arinsat View Post
Hi,
The version is 2.6.15 as read by giving the command 'uname -a'.
when i try with 'whereis make' cmd, it shows 'make:'.Explicittly mean any package or...
That is the kernel version (and quite old at that).
What we need is what distribution you are using.
 
1 members found this post helpful.
Old 09-01-2012, 03:00 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
?

Could it be Fedora 5 ?

The command : 'cat /etc/redhat-release' will show.
 
Old 09-02-2012, 12:40 AM   #7
SIG_SEGV
Member
 
Registered: Jul 2012
Location: Banglore, INDIA
Distribution: Fedora-Core
Posts: 70

Rep: Reputation: 11
When its a "bash issue:", then its clear that the 'make' hasn't been installed yet
 
Old 09-02-2012, 07:14 AM   #8
arinsat
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
First Kernal module

Hi,
It is ubuntu...whether it is a seperate package or something...
 
Old 09-02-2012, 07:24 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
# 8

The command : cat /etc/issue
.. will usually reply with 'Ubuntu <version>'
 
Old 09-02-2012, 09:08 AM   #10
arinsat
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
First Kernal Module

Hi,
It shows ubuntu 6.06.1 LTS...for the command cat /etc/issue....
 
Old 09-02-2012, 02:52 PM   #11
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by arinsat View Post
Hi,
It shows ubuntu 6.06.1 LTS...for the command cat /etc/issue....
Why such an old version?
I would recommend atleast 8.04 LTS.

Last edited by smeezekitty; 09-02-2012 at 03:44 PM.
 
Old 09-02-2012, 03:23 PM   #12
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,260

Rep: Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948
Sounds like you need to install make
 
Old 09-02-2012, 03:44 PM   #13
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
In any case, try
Code:
apt-get install build-essential
 
Old 09-03-2012, 09:53 PM   #14
arinsat
LQ Newbie
 
Registered: Aug 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
First Kernal Module

Hi,
I will upgrade to latest soon...
But for the current issue, it shows that the package is missing or obsoleted...shall i get that package alone..
 
Old 09-03-2012, 10:14 PM   #15
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by arinsat View Post
Hi,
I will upgrade to latest soon...
But for the current issue, it shows that the package is missing or obsoleted...shall i get that package alone..
Do you have your sources.list set up to use the archive?
 
  


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
9.3 + kernal nat module berrance SUSE / openSUSE 0 10-13-2005 08:41 AM
rhel 4 ntfs kernal module toolapc22 Linux - Software 1 08-18-2005 03:00 AM
Module from old kernal sethgeekx86 Slackware 3 06-04-2004 03:27 PM
Mismatch between NVIDIA Kernal and X module ccin1492 Linux - Distributions 10 03-01-2004 01:14 PM
Kernal Module Programming herambshembekar Programming 2 02-22-2002 12:34 PM


All times are GMT -5. The time now is 11:06 AM.

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