I have been wondering if developing Linux kernel modules (drivers) with Python is possible. Is it?
3 Answers
Yes, it is possible:
Although not recommended in production machines, this can be really useful while prototyping your driver.
See here we have certain issues.
- We have to understand why Linus Torvalds himself preferred C and Assembly language.C is the only language that won't hinder your performance on raw hardware. The Operating System was designed to use as much minimal resources as possible.
- Coming to Python, we already know that it's an interpreted language. So thereby its slow as it runs on a virtual environment.
Yes you can definitely try some. Check this
Instead you can really look forward to filesystem programming and multilevel cache organization and such using python.
-
5#3 is not a kernel driver. It is reading from stdin and writing to stdout. This is user space code. My answer to this question is 'no', unless you can get Python code to compile to opcodes native to the processor(s) on which the OS is running.– Peter L.Mar 12, 2014 at 17:49
No; LKM on Linux have to be compiled down do a specific ELF object code format.
Of course you could make your own hack of Python that does compile down to kernel object code, but as far as I know, at this time there is no such Python publicly available.