digitalmars.D - Can D be used for operating system development ?
- Jakob Jenkov (3/3) Jun 02 2022 Is it feasible / practical to use D to develop an operating
- Adam D Ruppe (13/16) Jun 02 2022 Sure, I've done a few bare metal applications with D in the past
- matheus (3/3) Jun 02 2022 https://github.com/PowerNex/PowerNex
- Sergey (5/8) Jun 02 2022 I don’t know
- max haughton (4/7) Jun 02 2022 There are some features you might want to avoid but if you look
- Paulo Pinto (12/15) Jun 02 2022 Surely, as the others have pointed out, there are some examples
- Olivier Pisano (3/6) Jun 02 2022 There is no such thing as a VM in D, and yes D can be used for
- JakobJenkov (2/8) Jun 07 2022 I should have written "GC" .. not "VM" ... sorry !!
- RazvanN (4/7) Jun 03 2022 This is an example of a device driver that has been ported to D
- Siemargl (4/7) Jun 06 2022 Just add Serpent OS to list.
- =?UTF-8?Q?Ali_=c3=87ehreli?= (9/15) Jun 06 2022 Very interesting. I've just learned that the lead developer is Ikey
- IGotD- (11/14) Jun 07 2022 Yes you can write operating systems in D. However you cannot use
Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?
Jun 02 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?Sure, I've done a few bare metal applications with D in the past (most recently, my little webassembly toys use the same technique, though webassembly isn't exactly the same on hardware level obviously, it still acts as a bare metal target as far as plain code goes). In my "D Cookbook" I had two examples, one for x86 and one for arm, showing it. It has gotten easier than it was back then, but you still have to do a lot yourself though, but that's true for any kind of OS dev. Not something you'd want to take on without already being pretty familiar with D, and knowledge its druntime internals help a lot if you want to take it to the next level using more language features.
Jun 02 2022
https://github.com/PowerNex/PowerNex https://dlang.org/areas-of-d-usage.html Matheus.
Jun 02 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?I don’t know But there are plenty of authors who could have some useful opinions: https://github.com/dlang-community/awesome-d#os
Jun 02 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?There are some features you might want to avoid but if you look at the instructions the compiler generates you can see that you can do basically anything.
Jun 02 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?Surely, as the others have pointed out, there are some examples already. A small secret when people talk about C being used to write OSes is that you aren't really using ISO C on the kernel, rather a language subset, and the full language is only available for the userspace stack. D can be used just as well, and don't let the GC put you off, here are some examples of OSes written in safe systems programming languages. https://www.progtools.org/article.php?name=oberon§ion=compilers&type=tutorial https://www.progtools.org/article.php?name=safe_systems§ion=compilers&type=tutorial
Jun 02 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?There is no such thing as a VM in D, and yes D can be used for operating system development.
Jun 02 2022
On Friday, 3 June 2022 at 06:33:52 UTC, Olivier Pisano wrote:On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:I should have written "GC" .. not "VM" ... sorry !!Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?There is no such thing as a VM in D, and yes D can be used for operating system development.
Jun 07 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?This is an example of a device driver that has been ported to D and integrated in the linux kernel: https://github.com/alexandrumc/d-virtio/pull/1.
Jun 03 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?Just add Serpent OS to list. https://serpentos.com Linux Kernel and userspace in D.
Jun 06 2022
On 6/6/22 06:03, Siemargl wrote:On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Very interesting. I've just learned that the lead developer is Ikey Doherty, a name I don't recognize. Does he appear on D forums? (To make it more interesting to me, there is some Turkish connection as well, which I had not heard of either.)Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?Just add Serpent OS to list. https://serpentos.comLinux Kernel and userspace in D.And many other parts but not the kernel, right? As I understand it, the kernel is being developed by a completely different group: https://en.wikipedia.org/wiki/Linux_kernel Ali
Jun 06 2022
On Thursday, 2 June 2022 at 20:36:59 UTC, Jakob Jenkov wrote:Is it feasible / practical to use D to develop an operating system from the ground up? Or does the VM / memory management get in the way?Yes you can write operating systems in D. However you cannot use many parts of druntime/phobos because 1. There is no "no OS" target to build druntime/phobos. 2. Many containers in D/Phobos use GC which makes them unsuitable for kernel development. You probably need to write all your container algorithms yourself. It doesn't though because they need to be special anyway. You are bascally using D without standard libraries. This about the same with C/C++.
Jun 07 2022
On Tuesday, 7 June 2022 at 11:27:18 UTC, IGotD- wrote:2. Many containers in D/Phobos use GC which makes them unsuitable for kernel development. You probably need to write all your container algorithms yourself. It doesn't though because they need to be special anyway. You are bascally using D without standard libraries. This about the same with C/C++.Actually there are LOT of different realisations.. not only containers, but Core libraries. And as a end-user I have no idea how all of them are different from each other. There are Mecca, Tanya, Hunt - core libraries. Emsi, ikod and collection-d containers. And of course there is the whole Mir world, with nogc and betterC paradigm inside.
Jun 07 2022
On Tuesday, 7 June 2022 at 11:57:58 UTC, Sergey wrote:Actually there are LOT of different realisations.. not only containers, but Core libraries. And as a end-user I have no idea how all of them are different from each other. There are Mecca, Tanya, Hunt - core libraries. Emsi, ikod and collection-d containers. And of course there is the whole Mir world, with nogc and betterC paradigm inside.What would be really interesting is if D had a library specifically targeted for low level/operating system development. That would include things like intrusive container algorithms, lock less data structures and so on. Even better if these also could use the Phobos range algorithms. Something that I think should be done with Phobos is to isolate the non OS dependent stuff such ranges, algorithms (must be GC free) so that it can be compiled separately. Today Phobos is like ball of thread where you cannot isolate the components from each other.
Jun 07 2022