LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   First kernal module (https://www.linuxquestions.org/questions/linux-newbie-8/first-kernal-module-4175424883/)

arinsat 08-30-2012 10:49 PM

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.

SIG_SEGV 08-30-2012 10:52 PM

Try whether your system has 'make' using command 'whereis make'. If its not showing any path then you have to get it explicitly

knudfl 08-31-2012 07:04 AM

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


arinsat 09-01-2012 11:34 AM

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...

smeezekitty 09-01-2012 12:52 PM

Quote:

Originally Posted by arinsat (Post 4770000)
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.

knudfl 09-01-2012 02:00 PM

?

Could it be Fedora 5 ?

The command : 'cat /etc/redhat-release' will show.

SIG_SEGV 09-01-2012 11:40 PM

When its a "bash issue:", then its clear that the 'make' hasn't been installed yet

arinsat 09-02-2012 06:14 AM

First Kernal module
 
Hi,
It is ubuntu...whether it is a seperate package or something...

knudfl 09-02-2012 06:24 AM

# 8

The command : cat /etc/issue
.. will usually reply with 'Ubuntu <version>'

arinsat 09-02-2012 08:08 AM

First Kernal Module
 
Hi,
It shows ubuntu 6.06.1 LTS...for the command cat /etc/issue....

smeezekitty 09-02-2012 01:52 PM

Quote:

Originally Posted by arinsat (Post 4770574)
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.

suicidaleggroll 09-02-2012 02:23 PM

Sounds like you need to install make

smeezekitty 09-02-2012 02:44 PM

In any case, try
Code:

apt-get install build-essential

arinsat 09-03-2012 08:53 PM

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..

smeezekitty 09-03-2012 09:14 PM

Quote:

Originally Posted by arinsat (Post 4771901)
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?


All times are GMT -5. The time now is 11:01 PM.