answersLogoWhite

0


Best Answer

A kernel module is a piece of the kernel that is not built as part of the kernel. This is largely to keep the kernel from having to initialize and run components it does not need.

By far the most common application of the loadable kernel modules is device drivers. If you have an nVidia card you likely won't need, for example, and Intel or AMD/ATI drivers loaded, but you *might* want Nouveau.

This allows the kernel to be smaller and more memory efficient, while still providing all the needed services required for the hardware on your computer.

The "life cycle" is usually something like, in the case of devce drivers.

1. The kernel catalogues all your hardware by probing all the buses.

2. Udev goes through everything the kernel has noticed and, through rulesets, determines what drivers to probe into the kernel and what permissions and nodes need to be created for device files in /dev.

3. The module should, by this point, have been loaded and run, initializing whatever hardware it supervises, and you use your computer. MOST device drivers don't get unloaded. They simply run for the whole time the system is up in case you need them, which in most cases you do. They can be unloaded, but often even after the hardware is disconnected, udev might notice, but still keep the driver loaded and simply adjust /dev to reflect the device removal.

In cases of non-device drivers, it is often more like this:

1. The user or a program with sufficient privileges realizes they need some specific service not built into the kernel. The user will usually issue the command "modprobe" with the module they need then proceed with their work. Software make make some system calls or some API calls to get a module loaded into the kernel for it so it can work, this is often what occurs with userspace filesystems: They immediately request that the fuse driver get loaded.

2. Whatever the user or software need to do gets done.

3. Often the module stays loaded like device drivers, but a user may issue "rmmod" to unload the driver if they are concerned about memory consumption.

Pretty much the only "common" time a module gets unloaded is if a new version of the module is installed. Thus you'd rmmod and modprobe the new module, but most times this use case won't even work (Most modules are updated as part of a kernel upgrade and therefore the kernel would reject the module as an "API mismatch.")

For most hardware this isn't really much of an issue. For video drivers, usually proprietary ones, it is, and you'll have to reboot to get the use of the new driver, one of the only two cases where restarting Linux might be "necessary," the other being a kernel upgrade.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a kernel module explain the life cycle of Linux kernel module?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you explain the model of destination life cycle?

explain the destination life cycle explain the destination life cycle


Explain what is sulfir cycle?

SUIFUR CYCLE


Explain the last stage in the beetle life cycle?

explain the last stage of the life cycle of a beetle


Explain what is meant by the fetch-execute cycle and describe its action in RLT?

Explain what is meant by the fetch-execute cycle and describe its action in RLT?" Explain what is meant by the fetch-execute cycle and describe its action in RLT?"


Explain the communication cycle with respect to an organisation?

how communication cycle in an organisation


What is the role of needs in business cycle?

explain the role of needs in the business cycle


How do you briefly explain the rock cycle?

hello


When a user-level thread executes a system call not only is that thread blocked but also all the threads within the process are blocked Why is that so?

A system call is actually a transition from user mode to kernel space to carry out a required operation.. For exp: Write() function resides in kernel space and can be accessed by a only corresponding wrapper function which was implemented in user space.. In case of Windows OS, Win32 API is the implementation to such as wrapper functions that make the actual system calls from user mode.. A kernel thread is created, scheduled and destroyed by the kernel.. Whereas a library thread (user thread) is created, scheduled and destroyed by a user level library like special threading libraries.. The kernel does know of nothing about library threads since they live in a process's boundaries and bound to its life cycle tightly.. Actually, a process is not the primary execution unit in all operating systems.. When a process is made by kernel, a new kernel thread is created and attached to that process in question.. So the library threads created in user mode by a user mode library must share the time slices given to the kernel thread by the scheduler arbitrarily during the lifetime of a process.. So a process actually has one kernel thread and all other library threads have to share the kernel thread's cycles.. Hence when a library thread makes a blocking call, all the threads within the process are blocked because as I said, actually process has only one kernel thread assigned to it and others try to make use of it.. So to prevent other threads from blocking, either you should use library threads that make use of kernel threads or you could just use the CreateThread() Win32 API system function for kernel threads but the synchronization mechanism must be provided by the programmer using events, signals, mutex, semaphore etc.. Sun, BSD Unix flavours, Windows etc follow the same threading architecture in their systems as POSIX standard.. However, a thread is a process in Linux.. That's why Linux is so powerful in server systems.. So the control is left to programmers to create a POSIX way of treading model by Clone(2) system call(s).. So address space and data etc can be shared by lightweight processes easily.. When a Linux kernel thread (child process) is crashed, it won't affect the rest of the threads belong to parent process.. This is just the opposite in other operating systems that a crashing thread will destroy all of the threads in the process.. NPTL is a great threading library that was implemented by using Linux clone(2) system call.. Linux also has another type of kernel thread only lives in kernel space that can be utilized by kernel code like modules.. User threads can't be run in parallel on the different CPUs because of this. However, they are portable.. Kernel threads can be scheduled by kernel to be run on a SMP system.. Hope this helps.. hsaq19@ TH Algan


Explain the origin of the defect distribution in a typical software development life cycle?

Explain the origin of the defect distribution in a typical software development life cycle.?


What is difference between classes and modules?

i think module life cycle manage program..


Explain why phosphates are a critical part of life?

how is the phosphorus cycle different from other biochemicals cycle


What is trade cycle and explain the various phases of trade cycle?

la la di da