www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Making an OS with D?(!)

reply Will <Will_member pathlink.com> writes:
Is it possible to create an operating system with D? They made Unix with C, so
it *should* be possible IMO. (Don't tell me I would have to implement all
hardware access myself, I'm well aware of that)
Jun 28 2005
next sibling parent reply Brad Beveridge <brad somewhere.net> writes:
Will wrote:
 Is it possible to create an operating system with D? They made Unix with C, so
 it *should* be possible IMO. (Don't tell me I would have to implement all
 hardware access myself, I'm well aware of that)
 
 
I don't see why not, somebody on the list has started a D kernel that boots on a x86 emulator. I'm interested in doing this kind of thing myself. But my idea is to take an existing open OS (linux, BSD, etc), get D code working at the kernel level and then replace select files that are written in C with D. If all that works, then it might be worth pursuing further. I have in the back of my mind that I would like to do this with Linux, because it has the widest hardware support for peripherals. Brad
Jun 28 2005
parent reply Hytak <Hytak_member pathlink.com> writes:
Brad's idea seem quite interesting... probably saving a lot of trouble. To do
this with Linux, I don't know much about all the license things and what they
permit or not, but I *think* (not sure) that *BSD licence is more permitive...
Of course, porting a *BSD to D would only give a *BSD coded in D. It's not the
really same thing than Linux. More hardware and periphereals. 
A good thing would probably to take only the good things in Linux and to build
new part to replace other and slowly get an entire other thing... but where the
license stop? 
Do somebody know well the GNU license (for Linux) or BSD one (For *BSD) ?


In article <d9scgs$21go$1 digitaldaemon.com>, Brad Beveridge says...
Will wrote:
 Is it possible to create an operating system with D? They made Unix with C, so
 it *should* be possible IMO. (Don't tell me I would have to implement all
 hardware access myself, I'm well aware of that)
 
 
I don't see why not, somebody on the list has started a D kernel that boots on a x86 emulator. I'm interested in doing this kind of thing myself. But my idea is to take an existing open OS (linux, BSD, etc), get D code working at the kernel level and then replace select files that are written in C with D. If all that works, then it might be worth pursuing further. I have in the back of my mind that I would like to do this with Linux, because it has the widest hardware support for peripherals. Brad
Jun 28 2005
parent reply Brad Beveridge <brad somewhere.net> writes:
Hytak wrote:
 Brad's idea seem quite interesting... probably saving a lot of trouble. To do
 this with Linux, I don't know much about all the license things and what they
 permit or not, but I *think* (not sure) that *BSD licence is more permitive...
 Of course, porting a *BSD to D would only give a *BSD coded in D. It's not the
 really same thing than Linux. More hardware and periphereals. 
 A good thing would probably to take only the good things in Linux and to build
 new part to replace other and slowly get an entire other thing... but where the
 license stop? 
 Do somebody know well the GNU license (for Linux) or BSD one (For *BSD) ?
 
Under the GNU license, any changes that you make you'd have to distribute. The Linux kernel maintainers do not consider that writing a binary-only kernel module violates the GPU (nVidia does this). Any changes to mainstream kernel would need to be under GPL. BSD license only requires that you leave credit notes in the source code. If I wanted to write a non-free OS in D that had maximum support for hardware, I suspect that I would try and conform to the API/ABI that the linux kernel has for drivers, then you could use GPL drivers to support your kernel. Personally I am not interested in writing a kernel for commercial purposes, so anything I did would probably be compatible with the GPL. Also, I would probably choose to hack on the Linux kernel because I am familiar with it & have written drivers/hacked on it in the past. If there are others on the list that are keen to do what I have described with the linux kernel, I might be interested in making an effort to help (rather than my current "just thinking about it" status) Brad
Jun 28 2005
parent reply Trevor Parscal <trevorparscal hotmail.com> writes:
 If there are others on the list that are keen to do what I have 
 described with the linux kernel, I might be interested in making an 
 effort to help (rather than my current "just thinking about it" status)
 
 Brad
I have been working on (well.. more like you.. "just thinking about it") an os for 3 years now. I have decided that D is what I want to use. However, writing an OS is harder to do than think about. I am more of an interface guy... BUT, I love a challenge and I am very ambitious in this kind of feild. Anyone who wants to get something like this going, I am your guy. -- Thanks, Trevor Parscal www.trevorparscal.com trevorparscal hotmail.com
Jun 28 2005
parent brad beveridge <brad nowhere.com> writes:
Trevor Parscal wrote:
 
 I have been working on (well.. more like you.. "just thinking about it") 
 an os for 3 years now. I have decided that D is what I want to use. 
 However, writing an OS is harder to do than think about.
 
 I am more of an interface guy... BUT, I love a challenge and I am very 
 ambitious in this kind of feild.
 
 Anyone who wants to get something like this going, I am your guy.
 
Well, I certainly don't want to write my own OS from scratch - that is just way too much work. But I think my "pilot program" strategy could be good, the Linux kernel isn't that large when you take out the periperhals and architechture specific stuff. If some (or all) of the following could be shown to be true, then it could be worth writing an OS kernel in D. a) a garbage collected kernel is performant b) a GC kernel is more robust c) a modern language is faster to develop in d) D actually can be used right on the bare metal Brad
Jun 28 2005
prev sibling next sibling parent J C Calvarese <technocrat7 gmail.com> writes:
In article <d9sc3j$2191$1 digitaldaemon.com>, Will says...
Is it possible to create an operating system with D? They made Unix with C, so
it *should* be possible IMO. (Don't tell me I would have to implement all
hardware access myself, I'm well aware of that)
It should be possible. Others have looked into it. See http://www.prowiki.org/wiki4d/wiki.cgi?KernelWithD for more info. jcc7
Jun 28 2005
prev sibling parent Peri Hankey <mpah thegreen.co.uk> writes:
Will wrote:
 Is it possible to create an operating system with D? They made Unix with C, so
 it *should* be possible IMO. (Don't tell me I would have to implement all
 hardware access myself, I'm well aware of that)
 
 
A good starting point would be the Xen virtualisation project - http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ This allows several different operating systems to share the same machine, with a thin 'hypervisor' layer sitting just above the hardware. Access to hardware is virtualised for 'guest domains'(a domain is a unit of virtualisation, the resources that are required for a guest operating system). Last time I looked the distribution included stubs for experimentation. The code is I believe slowly finding its way into the kernel source tree. In any case it was easy to build and install last time I tried, and you can finish up running a standard Linux distribution on a platform that can run several other operating systems without much damage to performance - I have only tried Linux operating systems, but that was my preference and laziness. Peri
Jun 30 2005