Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6943749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:11:49+00:00 2026-05-27T13:11:49+00:00

I’m trying to get the examples from Linux Device Drivers, ed 3 (ldd3) working

  • 0

I’m trying to get the examples from Linux Device Drivers, ed 3 (ldd3) working before I start working with the book so that I can have a set of working examples that I can use…. I’m getting the following errors (seeing error in Debian squeeze and also Crunchbang Linux):

inp.c:33:20: error: [u]asm/io.h:[/u] No such file or directory

when I looked at the makefile I found this (which I think is the problem):

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
INCLUDEDIR = $(KERNELDIR)/include

contents of /lib/modules/uname -r/build which is a link to /usr/src/linux-headers-2.6.39-bpo.2-486/

    $ uname -r
    2.6.39-bpo.2-486

$ ls /lib/modules/`uname -r`/build
arch  include  Makefile  Module.symvers  scripts

$ ls /lib/modules/`uname -r`/build/include
config  generated  linux

The directory that make is looking does not have the required files. I found the files required under /usr/src/linux-headers-2.6.39-bpo.2-common/ and the missing asm/io.h file @ /usr/src/linux-headers-2.6.39-bpo.2-common/include/asm-generic/

$ ls /usr/src/linux-headers-2.6.39-bpo.2-common/
arch  include  Kbuild  Makefile  scripts

$ ls /usr/src/linux-headers-2.6.39-bpo.2-common/include/
acpi         crypto  Kbuild  linux     media  net     rdma   scsi   staging  trace  xen
asm-generic  drm     keys    math-emu  mtd    pcmcia  rxrpc  sound  target   video

Do I have to install any package to get the files in that directory… I’ve already installed linux-headers-uname -r package (in both Debian and Crunchbang)… In gnewsense I found the files in /lib/modules/$(shell uname -r)/build… but it was a older kernel… so not sure if the directory structure under linux change… or is it distro specific… please let me know how do I get the compilation going…. I’m not very good with Makefiles so how can I change the makefile so that it will look for the header files in the other directories….

Thanks,
asp5

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:11:50+00:00Added an answer on May 27, 2026 at 1:11 pm

    First things first, LDD3 is quite old and I wouldn’t be surprised if header files might have moved around. Javier Martinez Canillas has updated the LDD3 sources for more modern kernels.

    When investigating this a little further, I found that the asm symlink has been broken for a while. (io.h appears to have stored in asm-generic/ for some reason.) In case you’re curious, I filed a bug report at Ubuntu for the broken symlinks.

    For whatever it’s worth, I can build a module referencing either <asm/io.h> or <asm-generic/io.h> (though as Hasturkun reminds me, you shouldn’t use asm-generic directly):

    $ cat > Makefile
    obj-m = foo.o
    $ cat > foo.c
    #include <linux/module.h>
    #include <linux/sched.h>
    #include <asm/io.h>
    int init_module() { return 0; }
    void cleanup_module() { }
    $ make -C /lib/modules/`uname -r`/build M=$PWD
    make: Entering directory `/usr/src/linux-headers-2.6.38-12-generic'
      LD      /home/sarnold/tmp/module/built-in.o
      CC [M]  /home/sarnold/tmp/module/foo.o
      Building modules, stage 2.
      MODPOST 1 modules
      CC      /home/sarnold/tmp/module/foo.mod.o
      LD [M]  /home/sarnold/tmp/module/foo.ko
    make: Leaving directory `/usr/src/linux-headers-2.6.38-12-generic'
    $ cat > foo.c
    #include <linux/module.h>
    #include <linux/sched.h>
    #include <asm-generic/io.h>
    int init_module() { return 0; }
    void cleanup_module() { }
    $ make -C /lib/modules/`uname -r`/build M=$PWD
    make: Entering directory `/usr/src/linux-headers-2.6.38-12-generic'
      CC [M]  /home/sarnold/tmp/module/foo.o
      Building modules, stage 2.
      MODPOST 1 modules
      CC      /home/sarnold/tmp/module/foo.mod.o
      LD [M]  /home/sarnold/tmp/module/foo.ko
    make: Leaving directory `/usr/src/linux-headers-2.6.38-12-generic'
    $ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.