So how do you think they write the kernel if they don't use programming languages? The Linux Kernel is written in C but they have now opened up for new device drivers to be also written in Rust.
So how do you think they write the kernel if they don't use programming languages? The Linux Kernel is written in C but they have now opened up for new device drivers to be also written in Rust.
Why does the kernel need to be "opened up" to accept Rust programs? For the kernel these are just compiled binaries, why does it need to know what language it was written in?
Yes there is nothing stopping you from creating your own home-brew linker and Pascal compilter from achieving this but that is not the question that are being solved, what is being solved is the possibility to create a device driver in Rust and having that same driver being accepted upstream in the Linux kernel proper. This means that #1 the maintainers will accept that code (which they won't do with Pascal since they currently only accept code written in C and soon some new device drivers in Rust) and #2 t
Would that not be a task for the linker rather than for the compiler?
The compiler still needs to know the calling convention [wikipedia.org], meaning how to set up the stack and the registers when calling a function compiled by another compiler. Only code using compatible calling conventions can be linked together without some routine in the middle that acts as a shim to translate the calling convention. Historically, the popular Pascal compiler for a platform and the popular C compiler for the same platform have used different calling conventions.
One way to make your old car run better is to look up the price of a new model.
Programming language in OS kernel? (Score:1)
Is this only Rust, or do we already have other programming languages on the inside of the Linux kernel?
Re: (Score:2)
Re: (Score:2)
So how do you think they write the kernel if they don't use programming languages? The Linux Kernel is written in C but they have now opened up for new device drivers to be also written in Rust.
Why does the kernel need to be "opened up" to accept Rust programs? For the kernel these are just compiled binaries, why does it need to know what language it was written in?
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re:Programming language in OS kernel? (Score:2)
even if you managed to make Pascal bind to C
Would that not be a task for the linker rather than for the compiler?
And every single attempt to merge Pascal code would be rejected by the kernel maintainers
Of course, but that is a management issue.
(I'm not trying to be obnoxious, these are genuine questions and I appreciate the answer you and others have given.)
Re: (Score:2)
Yes there is nothing stopping you from creating your own home-brew linker and Pascal compilter from achieving this but that is not the question that are being solved, what is being solved is the possibility to create a device driver in Rust and having that same driver being accepted upstream in the Linux kernel proper. This means that #1 the maintainers will accept that code (which they won't do with Pascal since they currently only accept code written in C and soon some new device drivers in Rust) and #2 t
Calling convention (Score:2)
even if you managed to make Pascal bind to C
Would that not be a task for the linker rather than for the compiler?
The compiler still needs to know the calling convention [wikipedia.org], meaning how to set up the stack and the registers when calling a function compiled by another compiler. Only code using compatible calling conventions can be linked together without some routine in the middle that acts as a shim to translate the calling convention. Historically, the popular Pascal compiler for a platform and the popular C compiler for the same platform have used different calling conventions.