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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:06:42+00:00 2026-06-02T14:06:42+00:00

I have written a kernel driver hello_kernel which registers as a character device on

  • 0

I have written a kernel driver “hello_kernel” which registers as a character device on a custom node /dev/hello. In the hello_kernel.c file, after calling register_chrdev(), I tried to create a netlink socket using netlink_kernel_create() ( defined in netlink.h ) with a properly defined function to receive user space messages through this socket.

The code compiled perfectly and I made the device nod /dev/hello using mknod; but when I try to insmod this module ( hello_kernel.ko ), there is an error:

insmod: error inserting ‘hello_kernel.ko’: -1 No child processes

The dmesg command shows that there was a an error while socket creation, i.e with netlink_kernel_create().

Initially, I was trying to use this module to connect with a user space application solely suing a netlink socket which worked perfectly. My motivation for adding character device functionality was to enable another user application to open it like a regular device file and issue ioctl calls.

What can I do to make this work ? Or does the kernel not support merging both functionalities ?

Code given below:

result = register_chrdev(major_num, "hello", &hello_fops);
if( result < 0 )
{
 printk( KERN_INFO "Could not init hello_kernel" );
 return result;
} 
result=netlink_kernel_create(&init_net, NETLINK_USER, 0, hello_nl_recv_msg,NULL,
THIS_MODULE);
if(!result)
{
 unregister_chrdev(major_num, "memory");
 printk(KERN_ALERT "Error creating socket.\n");
 return -10;
}

Trying to insert module:

$sudo insmod hello_kernel.ko
insmod: error inserting 'hello_kernel.ko': -1 No child processes

Output of dmesg:

[ 1537.809491] Error creating socket.
  • 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-02T14:06:43+00:00Added an answer on June 2, 2026 at 2:06 pm

    The problem was with socket creation after registering the device. Now, I create the socket (netlink_kernel_create)before the device registration(register_chrdev) and after rebooting, it works 🙂

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

Sidebar

Related Questions

I have written a Linux kernel-module to act as an FPGA driver for a
I have written a kernel module which reads and writes /proc files, and it
I have written a toolbar that runs on the taskbar. Unfortunately, after it is
I have written a PHP application which requires storage of millions of integers between
I have previously written an application for Mac OSX that includes a kernel extension.
I am having a weird problem .. I have written a CUDA code which
I am trying to create a debugfs file using the debugfs_create_file(...). I have written
I'm learning Windows kernel mode driver development. I've written a small test driver that
I'm writing my first Linux kernel module, which actually is a RAM disk driver
I have written a kernel density estimator in Java that takes input in the

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.