Writing a module to a linux kernel

Click For Summary

Discussion Overview

The discussion revolves around the motivations and reasons for writing modules for the Linux kernel. Participants explore various aspects of kernel modules, including their purpose, functionality, and the context in which they are used.

Discussion Character

  • Exploratory, Technical explanation, Conceptual clarification

Main Points Raised

  • One participant inquires about the reasons for writing Linux kernel modules, seeking a general explanation.
  • Another participant suggests that device handlers requiring fast execution without interruptions should be implemented in the kernel.
  • A third participant provides a link to an external resource discussing how to write kernel modules and the associated risks.
  • It is proposed that writing a driver is necessary when integrating a new device designed for another operating system into Linux.
  • One participant notes that the Linux kernel is designed in a minimalistic way, allowing for additional functionality to be added through modules without the need for recompilation.

Areas of Agreement / Disagreement

Participants express various viewpoints on the reasons for writing kernel modules, but there is no consensus on a single explanation or approach. Multiple perspectives remain present in the discussion.

Contextual Notes

Some claims depend on specific definitions of kernel modules and their functionality, which may not be universally agreed upon. The discussion does not resolve the potential dangers of writing kernel modules as mentioned by one participant.

mech-eng
Messages
826
Reaction score
13
I was wondering about "writing a module to a linux kernel." This question haven't asked yet. Would you please explain why linuxers write such modules to a linux kernel? What is the reason?

Thank you.
 
Computer science news on Phys.org
A device handler that needs to run fast with no interruptions should be in the kernel.
 
  • Like
Likes   Reactions: QuantumQuest and jedishrfu
Simple answer: You have a new device originally designed for another OS, you need to have it work with Linux. You write a driver.
 
  • Like
Likes   Reactions: QuantumQuest and mech-eng
mech-eng said:
I was wondering about "writing a module to a linux kernel." This question haven't asked yet. Would you please explain why linuxers write such modules to a linux kernel? What is the reason?

Linux kernel is built in a barebones fashion. The extra functionality we need is added in a modular way i.e. writing modules "on top" of that. This is an easy way to extend the functionality of the kernel without having to rebuild / recompile the kernel each time.
 
  • Like
Likes   Reactions: mech-eng

Similar threads

Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 24 ·
Replies
24
Views
4K
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 31 ·
2
Replies
31
Views
3K