LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-20-2014, 07:03 AM   #1
dzaku
LQ Newbie
 
Registered: Jun 2011
Location: POLAND BOAT CITY
Distribution: ARCH-LINUX, DEBIAN, FEDORA, UBUNTU
Posts: 9

Rep: Reputation: Disabled
Unhappy lkm COMPILE WITH <bcm2835.h>


Hi all :")

i have trouble
Code:
usr/lib/gcc/arm-linux-gnueabihf/4.7/include/stdint.h:3:26: error: no include path in which to search for stdint.h


I try write LKM with <bcm2835.h> (http://www.airspayce.com/mikem/bcm28...8h_source.html)

my make file is

Code:
obj-m :=  gpio.o
LIBS = -lbcm2835 -lrt
DEPS=bcm2835.h
all:
        make -C /lib/modules/3.12-1-rpi/build  M=/home/pi/module modules

my example code

Code:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <bcm2835.h>



MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void) {
  printk("<1> Hello world!\n");
  return 0;
}

static void hello_exit(void) {
  printk("<1> Bye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);
i read somwhere kernel modules, and thus have no access to glibc (or its headers).

Code:
make -C /lib/modules/3.12-1-rpi/build  M=/home/pi/module modules
make[1]: WejÅcie do katalogu '/usr/src/linux-headers-3.12-1-rpi'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
  CC [M]  /home/pi/module/gpio.o
/home/pi/module/gpio.c:4:21: fatal error: bcm2835.h: Nie ma takiego pliku ani katalogu
compilation terminated.
/usr/src/linux-headers-3.12-1-common/scripts/Makefile.build:314: polecenia dla obiektu '/home/pi/module/gpio.o' nie powiodÅy siÄ
make[4]: *** [/home/pi/module/gpio.o] BÅÄd 1
/usr/src/linux-headers-3.12-1-common/Makefile:1245: polecenia dla obiektu '_module_/home/pi/module' nie powiodÅy siÄ
make[3]: *** [_module_/home/pi/module] BÅÄd 2
Makefile:130: polecenia dla obiektu 'sub-make' nie powiodÅy siÄ
make[2]: *** [sub-make] BÅÄd 2
Makefile:8: polecenia dla obiektu 'all' nie powiodÅy siÄ
make[1]: *** [all] BÅÄd 2
make[1]: Opuszczenie katalogu '/usr/src/linux-headers-3.12-1-rpi'
Makefile:5: polecenia dla obiektu 'all' nie powiodÅy siÄ
make: *** [all] BÅÄd 2

Help?

Last edited by dzaku; 10-20-2014 at 07:09 AM.
 
Old 10-20-2014, 11:47 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The answers are in the (closed) duplicate thread :

http://www.linuxquestions.org/questi...-h-4175522738/
 
  


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
LKM gvassallo Linux - Newbie 5 09-05-2011 12:00 AM
Lkm sci3ntist Programming 1 11-27-2007 03:18 PM
LKM talking to another LKM? Ljunge Programming 4 11-13-2007 01:29 PM
Some prob's getting LKM's to compile right hadding Programming 1 11-06-2003 06:40 AM
chkrootkit and lkm Crashed_Again Linux - Security 3 06-08-2003 08:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:38 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
Open Source Consulting | Domain Registration