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

  • Home
  • SEARCH
  • 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 8438603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:45:40+00:00 2026-06-10T07:45:40+00:00

I have: A C program main.c with the main function that has the function

  • 0

I have:

  1. A C program main.c with the main function that has the function call.
  2. Another C program test.c with function definitions.
  3. A header test.h has the common declarations.

Pls read Carefully my objective
my objective is to have a kernel object and a appliction that uses it.
and i need to give some inputs to the function at runtime and process with that.

i’m using it in terminal.
Can anyone please help me out?

  • 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-06-10T07:45:41+00:00Added an answer on June 10, 2026 at 7:45 am

    For compiling kernel module, you can write this basic makefile :

    obj-m += <your_obj_file>.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
    

    After that, you’ll have to build and load your module with

    make
    insmod <your_module>.ko
    

    But when I read you, I guess that what you really want to do is not a kernel module.
    I think you want to build a shared library (.so file or .dll), isn’t it ?

    If it’s a linux shared library you want to build here’s the commands to invoke :

    gcc -c -fPIC test.c
    gcc -shared test.o -o libtest.so
    
    gcc -c main.c
    gcc main.o -o <binary name> -ltest
    

    But if you just want to build a static binary in the classical way :

    gcc -c test.c
    gcc -c main.c
    
    gcc test.o main.o -o <binary name>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have program with two files; main.py that has my main logic and class.py
We have a program with a main() that parses certain CLPs but does not
I have a program that uses three JTextField fields as the main data entry
How would I get the main program to recognize that I have an outside
I have a program that runs in a few threads. The main thread shares
I have a program that starts constantly juggles between 3 separate timers. The main
I have an update program that is completely independent of my main application. I
I'm building a program that has several functions that need to read data from
I have a Perl program that has a GTK2 GUI (via the Gtk2 package).
I have written a program that has a class with a constructor and destructor

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.