Jump to page: 1 2
Thread overview
Can D be used for operating system development ?
Jun 02, 2022
Jakob Jenkov
Jun 02, 2022
Adam D Ruppe
Jun 02, 2022
matheus
Jun 02, 2022
Sergey
Jun 02, 2022
max haughton
Jun 03, 2022
Paulo Pinto
Jun 03, 2022
Olivier Pisano
Jun 07, 2022
JakobJenkov
Jun 03, 2022
RazvanN
Jun 06, 2022
Siemargl
Jun 06, 2022
Ali Çehreli
Jun 07, 2022
IGotD-
Jun 07, 2022
Sergey
Jun 07, 2022
IGotD-
June 02, 2022

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?

June 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.
June 02, 2022
https://github.com/PowerNex/PowerNex

https://dlang.org/areas-of-d-usage.html

Matheus.
June 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

June 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.

June 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?

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&section=compilers&type=tutorial

https://www.progtools.org/article.php?name=safe_systems&section=compilers&type=tutorial

June 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?

There is no such thing as a VM in D, and yes D can be used for operating system development.

June 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?

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.

June 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?

Just add Serpent OS to list.
https://serpentos.com

Linux Kernel and userspace in D.

June 06, 2022
On 6/6/22 06:03, Siemargl wrote:
> 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

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.)

> Linux 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

« First   ‹ Prev
1 2