Is inline assembly required on Linux?
1 answer
Inline assembly has nothing to do with the kernel. So the answer is no.
Anyone can write an inline assembly and compile it into a program. It is no different from the compiler-generated code.
As for your comment, no answer is possible due to memory protection . As soon as you try to access memory that is not mapped or not allowed (whether in C or through inline assembly), you will get a seg error.
In other words, the level of protection is not between the C code and the compiler. It is between the compiled code and the operating system.
This way, you cannot damage the kernel with C or inline assembly - unless you have permission to do so.
+7
source to share