LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-08-2010, 12:24 PM   #1
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Rep: Reputation: 33
No rule to make target `missing-syscalls'. Stop.


Hi, i've been inspired to have a play with kernel modules, following:

http://tldp.org/LDP/lkmpg/2.6/html/index.html

I've got through most of it, but various examples later and others i've found fail to compile, but all mentioning 'missing-syscalls'.

This is an example of such:

http://tldp.org/LDP/lkmpg/2.6/html/x1194.html

And the following is the compile output:
Quote:
# make
make -C /lib/modules/2.6.30.10-105.2.23.fc11.i686.PAE/build M= modules
make[1]: Entering directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.i686.PAE'
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
make[2]: *** No rule to make target `missing-syscalls'. Stop.
make[1]: *** [prepare0] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.i686.PAE'
make: *** [all] Error 2
Any solutions gratefully thanked...
 
Old 06-08-2010, 01:04 PM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by rubadub View Post
Code:
# make
make -C /lib/modules/2.6.30.10-105.2.23.fc11.i686.PAE/build M= modules
Your M= option doesn't point anywhere - it should point to the directory with the object modules you want to build, which should contain a makefile with obj-m set to the .o files you want to build modules with (e.g. usually M=`pwd` or M=$(pwd) for the current directory).
 
Old 06-08-2010, 02:49 PM   #3
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Original Poster
Rep: Reputation: 33
Thanks John,

This is what my Makefile looks like:
Code:
obj-m += kbleds.o
all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Somehow it is now passing that error... (how?)

But now i'm led into more errors...

The first one was about unable to find 'linux/config.h', after reading up, I believe that the file is no longer distributed / used with the source... So I commented that out...

Next my errors concerning 'fg_console', I included 'linux/vt_kern.h' which eliminated it.



Now make output looks like this:
Quote:
# make
make -C /lib/modules/2.6.30.10-105.2.23.fc11.i686.PAE/build M=/home/ai/z_kernel/kbleds modules
make[1]: Entering directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.i686.PAE'
CC [M] /home/ai/z_kernel/kbleds/kbleds.o
/home/ai/z_kernel/kbleds/kbleds.c: In function ‘my_timer_func’:
/home/ai/z_kernel/kbleds/kbleds.c:54: error: ‘struct tty_driver’ has no member named ‘ioctl’
/home/ai/z_kernel/kbleds/kbleds.c: In function ‘kbleds_cleanup’:
/home/ai/z_kernel/kbleds/kbleds.c:95: error: ‘struct tty_driver’ has no member named ‘ioctl’
make[2]: *** [/home/ai/z_kernel/kbleds/kbleds.o] Error 1
make[1]: *** [_module_/home/ai/z_kernel/kbleds] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.i686.PAE'
make: *** [all] Error 2
I've tried adding various headers, but all to no avail... Any solutions please?
 
Old 06-08-2010, 03:45 PM   #4
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Original Poster
Rep: Reputation: 33
Taking a slightly different tack, i'm trying another example:

Code:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <asm/io.h>

int retries = 0x100100;
int input;
char *str="hello";
struct tty_struct *my_tty;

int init_module(void)
{
  printk("This is a kernel module\n");
  while (--retries != 0)
  { 
    int oldinput=input; input=inb(0x60); if (oldinput!=input)
    {
      printk("got %i",input);

      // print directly to konsole
      // kernel 2.6.9+ required
      sprintf(str,"%i",input);

      my_tty = current->signal->tty;
      if (my_tty != NULL)
      {
        ((my_tty->driver)->write) (my_tty,str,strlen(str));
        ((my_tty->driver)->write) (my_tty,"\015\012",2);
      }
      
    }
  }
}

void cleanup_module(void)
{
  printk(KERN_ALERT "Au revoir\n");
}
Basically the same Makefile as above.

But still getting similar errors...

Quote:
make
make -C /lib/modules/2.6.30.10-105.2.23.fc11.i686.PAE/build M=/home/ai/z_kernel/keyb modules
make[1]: Entering directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.i686.PAE'
CC [M] /home/ai/z_kernel/keyb/keyb.o
/home/ai/z_kernel/keyb/keyb.c: In function ‘init_module’:
/home/ai/z_kernel/keyb/keyb.c:47: error: ‘struct tty_driver’ has no member named ‘write’
/home/ai/z_kernel/keyb/keyb.c:48: error: ‘struct tty_driver’ has no member named ‘write’
make[2]: *** [/home/ai/z_kernel/keyb/keyb.o] Error 1
make[1]: *** [_module_/home/ai/z_kernel/keyb] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.i686.PAE'
make: *** [all] Error 2

Having looked in tty_driver.h, both write and ioctl are defined...

So whats going on?





p.s. This example is from here
 
Old 06-08-2010, 05:14 PM   #5
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by rubadub View Post
Having looked in tty_driver.h, both write and ioctl are defined...
They are indeed defined, but not as members of tty_driver. They're defined as members of tty_operations, and tty_driver has a member `ops', a pointer to a const tty_operations.

So instead of my_driver->write, it looks like you want my_driver->ops->write, and similarly for ioctl.
 
1 members found this post helpful.
Old 06-08-2010, 05:31 PM   #6
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Original Poster
Rep: Reputation: 33
That's great Monsieur...
Many thanks!


Not seen any other ref to ops concerning this on all today's travels, so once again, thanks!
 
  


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
*** No rule to make target `modules'. Stop. Help heffo_j Linux - Hardware 7 06-05-2011 11:44 AM
make: *** No rule to make target `install-headers'. Stop. NightHorse Linux - Newbie 9 06-21-2009 05:16 AM
Belkin Wirless G RTL8185L make[1]: *** No rule to make target `Makefile'. Stop. SilverRock Linux - Wireless Networking 2 02-11-2007 07:25 AM
Error: *** No rule to make target 'all'. Stop aa2bi Linux - Newbie 6 06-08-2004 12:55 PM
*** No rule to make target `modules'. Stop. kmack2001 Linux - Newbie 9 02-16-2004 01:02 PM

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

All times are GMT -5. The time now is 08:26 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