www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Linux Kernel in D?

reply D.Rex <adam.lachlanarmstrong live.com.au> writes:
A D port of the Linux Kernel?

https://github.com/whatsthisnow/ProjectD

Any thoughts on the project?
Dec 16 2016
next sibling parent reply Jesse Phillips <jesse.k.phillips+D gmail.com> writes:
On Friday, 16 December 2016 at 16:12:38 UTC, D.Rex wrote:
 A D port of the Linux Kernel?

 https://github.com/whatsthisnow/ProjectD

 Any thoughts on the project?
I think the project should have started with a fork of the official source and should always build a working kernel, making conversions to D in pieces but always building. It is also a large project which could provide some entertainment.
Dec 17 2016
parent reply Whatsthisnow <armstronga94 hotmail.com> writes:
On Saturday, 17 December 2016 at 17:19:55 UTC, Jesse Phillips 
wrote:
 On Friday, 16 December 2016 at 16:12:38 UTC, D.Rex wrote:
 A D port of the Linux Kernel?

 https://github.com/whatsthisnow/ProjectD

 Any thoughts on the project?
I think the project should have started with a fork of the official source and should always build a working kernel, making conversions to D in pieces but always building. It is also a large project which could provide some entertainment.
Thats not a bad idea, once I figure out how to incorporate D into the original Source and build with make files I will give it a shot. Start with some basic Conversions, then branch out further to the bigger stuff. One of my main interests In converting it entirely to do is to see how much faster the kernel would compile. Hopefully the idea is to give it a much faster compile time and make changes faster and easier to implement. What are your thoughts on how I have implemented the strcpy type stuff?
Dec 17 2016
parent Jesse Phillips <jesse.k.phillips+D gmail.com> writes:
On Sunday, 18 December 2016 at 02:54:10 UTC, Whatsthisnow wrote:
 What are your thoughts on how I have implemented the strcpy 
 type stuff?
It looks like you are trying to wrap D types to interact with C. I think Walter's advice should be considered. Convert the files to match the original as closely as possible, and don't fix bugs or change any algorithm. Once that is complete and passing tests refactoring can take place.
Dec 18 2016
prev sibling next sibling parent Suliman <evermind live.ru> writes:
On Friday, 16 December 2016 at 16:12:38 UTC, D.Rex wrote:
 A D port of the Linux Kernel?

 https://github.com/whatsthisnow/ProjectD

 Any thoughts on the project?
Linux is too bloated and there is no any reasons to re-implement it.
Dec 17 2016
prev sibling parent reply sarn <sarn theartofmachinery.com> writes:
On Friday, 16 December 2016 at 16:12:38 UTC, D.Rex wrote:
 A D port of the Linux Kernel?

 https://github.com/whatsthisnow/ProjectD

 Any thoughts on the project?
Depends on how strictly you want to reimplement GNU/Linux, or whether something Posix-y is enough. Anyway, a D "libc" would be really awesome. Something like Newlib in pure D would be great for OS programming in D.
Dec 17 2016
parent reply Whatsthisnow <armstronga94 hotmail.com> writes:
On Sunday, 18 December 2016 at 00:10:47 UTC, sarn wrote:
 On Friday, 16 December 2016 at 16:12:38 UTC, D.Rex wrote:
 A D port of the Linux Kernel?

 https://github.com/whatsthisnow/ProjectD

 Any thoughts on the project?
Depends on how strictly you want to reimplement GNU/Linux, or whether something Posix-y is enough. Anyway, a D "libc" would be really awesome. Something like Newlib in pure D would be great for OS programming in D.
I am basing the kernel on Linux because, well, I like Linux, and its the only complete kernel with free source that I currently know of. Given that it is widely Used as an OS kernel, it kinda made sense to port it, give it a new engine under the hood so to speak. I would like to keep it as close to the original as possible such that linux programmers will still have a generally familiar environment to work with, rather than having to learn an entirely new kernel. As far as GlibD, well the point of the project is to give Linux, as a I said before, a metaphorical new engine under the hood, so it wouldn't be sensible to not convert libc and the coreutils etc to D as well since Linux requires them. Plus, this might be a good opportunity for the community, as well as the creators of D, to incorporate some features into the kernel that would benefit the D language itself. I think i remember reading somewhere, someone (maybe one of the creators) stated that garbage collection should be done in the Kernel, well I think this would be a perfect opportunity to test that as an experimental feature. Possibly pull GC out of the D libraries and put it in the kernel for this project. Anyway, thats some of my thoughts on the project.
Dec 17 2016
next sibling parent Whatsthisnow <armstronga94 hotmail.com> writes:
On Sunday, 18 December 2016 at 03:05:13 UTC, Whatsthisnow wrote:
 I am basing the kernel on Linux because, well, I like Linux, 
 and its the only complete kernel with free source that I 
 currently know of.  Given that it is widely
 Used as an OS kernel, it kinda made sense to port it, give it a 
 new engine under the hood so to speak.  I would like to keep it 
 as close to the original as possible such that linux 
 programmers will still have a generally familiar environment to 
 work with, rather than having to learn an entirely new kernel.

 As far as GlibD, well the point of the project is to give 
 Linux, as a I said before, a metaphorical new engine under the 
 hood, so it wouldn't be sensible to not convert libc and the 
 coreutils etc to D as well since Linux requires them.  Plus, 
 this might be a good opportunity for the community, as well as 
 the creators of D, to incorporate some features into the kernel 
 that would benefit the D language itself.  I think i remember 
 reading somewhere, someone (maybe one of the creators) stated 
 that garbage collection should be done in the Kernel, well I 
 think this would be a perfect opportunity to test that as an 
 experimental feature.
  Possibly pull GC out of the D libraries and put it in the 
 kernel for this project.

 Anyway, thats some of my thoughts on the project.
Having said that though, keeping it as familiar as possible, it would be a no brainer to make full use of D's features to make the kernel the best it can be. I am no master with D at the moment, so I was hoping some community members might be interested in putting their hands in the project and committing some good code ports.
Dec 17 2016
prev sibling parent reply lobo <swamplobo gmail.com> writes:
On Sunday, 18 December 2016 at 03:05:13 UTC, Whatsthisnow wrote:
 On Sunday, 18 December 2016 at 00:10:47 UTC, sarn wrote:
 [...]
I am basing the kernel on Linux because, well, I like Linux, and its the only complete kernel with free source that I currently know of. Given that it is widely Used as an OS kernel, it kinda made sense to port it, give it a new engine under the hood so to speak. I would like to keep it as close to the original as possible such that linux programmers will still have a generally familiar environment to work with, rather than having to learn an entirely new kernel. [...]
I'd be inclined to start with a smaller OS like Plan9. Even FreeBSD would be simpler, althoguh no less gargantuan than Linux, it is better organised and documented IMO. Anyway good luck with this, even if you don't finish you're bound to learn a lot in the process. bye, lobo
Dec 17 2016
parent reply Jacques =?UTF-8?B?TcO8bGxlcg==?= <jacques.mueller gmx.de> writes:
A Minix port could be interesting as well. The kernel seems to be 
pretty small.
Dec 18 2016
parent reply Whatsthisnow <armstronga94 hotmail.com> writes:
On Sunday, 18 December 2016 at 08:05:20 UTC, Jacques Müller wrote:
 A Minix port could be interesting as well. The kernel seems to 
 be pretty small.
Well if others want to work on porting those kernels they can, we could potentially look into expanding my repo to include all kinds of kernel projects, assuming there is enough interest in them, then we have a solid an entire project collection of potential D kernel solutions. That would be one heck of a boost for D I think.
Dec 18 2016
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 18/12/2016 11:13 PM, Whatsthisnow wrote:
 On Sunday, 18 December 2016 at 08:05:20 UTC, Jacques Müller wrote:
 A Minix port could be interesting as well. The kernel seems to be
 pretty small.
Well if others want to work on porting those kernels they can, we could potentially look into expanding my repo to include all kinds of kernel projects, assuming there is enough interest in them, then we have a solid an entire project collection of potential D kernel solutions. That would be one heck of a boost for D I think.
Alternatively help out Wild with his PowerNex project[0]. Pure D port isn't all that exciting, pure D OS that actually tries to do things on its own, now that's something to write home about! [0] https://github.com/Vild/PowerNex
Dec 18 2016
parent reply Whatsthisnow <armstronga94 hotmail.com> writes:
On Sunday, 18 December 2016 at 10:51:48 UTC, rikki cattermole 
wrote:
 Alternatively help out Wild with his PowerNex project[0].

 Pure D port isn't all that exciting, pure D OS that actually 
 tries to do things on its own, now that's something to write 
 home about!

 [0] https://github.com/Vild/PowerNex
If you read the README in the github master, you will notice that it isn't just porting the kernel, it is also porting glibc to D, as well as all the userland applications to D. Essentially making an entire D OS as you say, but using already established designs/technology as a base point. Linux is effective, powerful, widely used, and there are already thousands of programmers that program for Linux, so creating an entire OS in D based on Linux would encourage (hopefully) a lot of Linux programmers to also write for a D Linux. Since its largely familiar, the learning process would be relatively painless.
Dec 18 2016
parent Jesse Phillips <jesse.k.phillips+D gmail.com> writes:
On Sunday, 18 December 2016 at 11:22:49 UTC, Whatsthisnow wrote:
 thousands of programmers that program for Linux, so creating an 
 entire OS in D based on Linux would encourage (hopefully) a lot 
 of Linux programmers to also write for a D Linux.  Since its 
 largely familiar, the learning process would be relatively 
 painless.
I would put to much faith in Linux developers having an interest in supporting a language change. Now the idea that their is interest in having libc written in D, the project could be of use if the entire Linux kernel could be built and use it, talk about real world testing.
Dec 18 2016