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 205143
In Process

The Archive Base Latest Questions

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

Is it possible to compile a linux kernel(2.6) module that includes functionality defined by

  • 0

Is it possible to compile a linux kernel(2.6) module that includes functionality defined by non-kernel includes?

For example:


kernelmodule.h

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>   // printk()
// ...
#include <openssl/sha.h>
// ...

Makefile

obj-m := kernelmodule.o
all:
    $(MAKE) -C /lib/modules/`uname -r`/build M=`pwd` modules

clean:
    $(MAKE) -C /lib/modules/`uname -r`/build M=`pwd` clean
    $(RM) Module.markers modules.order

The kernel module I have written and are trying to compile contains functionality found in a number of openssl include files.

The standard makefile presented above doesn’t allow includes outside of the linux headers. Is it possible to include this functionality, and if so, could you please point me in the right direction.

Thanks,
Mike

  • 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-11T17:31:49+00:00Added an answer on May 11, 2026 at 5:31 pm

    The kernel cannot use userspace code and must stand alone (i.e. be completely self contained, no libraries), therefore it does not pick up standard headers.

    It is not clear what benefit trying to pick up userspace headers is. If there are things in there that it would be valid to use (constants, some macros perhaps provided they don’t call any userspace functions), then it may be better to duplicate them and include only the kernel-compatible parts that you need.

    It is not possible to link the kernel with libraries designed for userspace use – even if they don’t make any OS calls – because the linking environment in the kernel cannot pick them up.

    Instead, recompile any functions to be used in the kernel (assuming they don’t make any OS or library calls – e.g. malloc – in which case they’ll need to be modified anyway). Incorporate them into your own library to be used in your kernel modules.


    Recent versions of linux contain cryptographic functions anyway, including various SHA hashes – perhaps you can use one of those instead.


    Another idea would be to stop trying to do crypto in kernel-space and move the code to userspace. Userspace code is easier to write / debug / maintain etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To give some history, Executors were only added as part… May 11, 2026 at 11:46 pm
  • Editorial Team
    Editorial Team added an answer 450 tests in one class sounds like a lot, but… May 11, 2026 at 11:46 pm
  • Editorial Team
    Editorial Team added an answer When you clear your colour buffer are you also clearing… May 11, 2026 at 11:46 pm

Related Questions

Whilst learning the assembler language (in linux on a x86 architecture using the GNU
I would like a low-overhead method of monitoring the I/O of a Windows process.
I'm doing a little app that I want to distribute in different platforms, at
Is it possible to use shared object files in a portable way like DLLs

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.