![]() Our concern was the build system, and how everything can be glued together. We too, had the same feeling that it should be possible to do, based on the ABI and `-betterC`. (I think trying to refactor the build system to work with dpp would be a total waste of time.) The interface would have to provide alternatives to the various Linux preprocessor macros. > If I had to write a Linux module in D, I'd write an interface layer in C that gets built using the normal Linux build system and can be linked to my D code. The difficulty is the same difficulty you get trying to write Linux kernel modules in C++: the Linux build system is a mess of make files that are only designed for C, and don't represent a stable API between kernel source versions. > On Tuesday, 23 October 2018 at 12:06:48 UTC, Eduard Staniloiu wrote: On Wednesday, 24 October 2018 at 06:36:51 UTC, sarn wrote: Now you can write C type libraries with subset of D. There is a compiler flag -betterC that removes D runtime but you also loose all functionality that depends on runtimes. And if its not convenient then there is another option. I am not familiar with driver architectures and dont know how convenient it is to add that init call but if its easy then what is left to do is to sprinkle your code with extern (c) and it should link and work. Before C can use D code D runtime needs to be initialized by calling this function: ![]() If you want to call D code from C then it gets more tricky. If you want to call C code from D then its easy. Is it possible to write Linux driver in D? Yes. ![]() > We, here at UPB, were thinking if it would be possible to write a simple Linux driver. On Tuesday, 23 October 2018 at 12:06:48 UTC, Eduard Staniloiu wrote:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |