Jump to page: 1 2 3
Thread overview
Experimental OS development using D
Jan 02, 2007
Harry Vennik
Jan 02, 2007
Lars Ivar Igesund
Jan 02, 2007
Alexander Panek
Jan 02, 2007
Harry Vennik
Jan 02, 2007
BCS
Jan 02, 2007
Harry Vennik
Jan 02, 2007
BCS
Jan 04, 2007
Harry Vennik
Jan 04, 2007
BCS
Jan 04, 2007
Harry Vennik
Jan 04, 2007
BCS
Jan 02, 2007
Alexander Panek
Jan 02, 2007
Lars Ivar Igesund
Jan 02, 2007
Walter Bright
Jan 04, 2007
Harry Vennik
Jan 02, 2007
bls
Jan 05, 2007
kris
Jan 05, 2007
John Reimer
Jan 30, 2008
Harry Vennik
Jan 30, 2008
Graham St Jack
Jan 31, 2008
Harry Vennik
Jan 30, 2008
Walter Bright
January 02, 2007
Hi,

At the beginning of this year I'd like to present a whole new idea that very much involves the D Programming Language. My idea is to start development of an experimental operating system, that should be constructed in an object-oriented way as much as possible, but no 'forcing of OOP at all cost'. Of course OS implementation involves a lot of low-level coding. The one and only suitable language to combine low-level coding and OOP appears to be D. (Don't argue it could be C++ too, that language is unusable because of it's immense complexity. I keep asing myself why so many people use it anyway...)

The OS should consist of a microkernel similar to L4, to be written in C (as much as possible) and Assembly (where necessary). And any number of services running on top of it, all to be written in D. It should be an OS that is inspired on UNIX, but not be a real UNIX implementation. Rather it should feel like an evolution of the UNIX-way of doing things.

I realize that the current performance of D might not be suitable for serious OS development, but I do not think of that as a real problem. I think that in the very first, highly experimental phase of development, the actual performance is not much of an issue. Later on, when it will become an issue, the D compiler will probably have been improved already to provide that optimization performance.

I chose the D Programming Language only for its bare language features, not anything else. It was simply the only language I could find that met my requirements. Any libraries or frameworks won't help in OS development anyway, because they are supposed to be used on top of an OS. Of course the interfaces of the OS should be optimized to make it as easy as possible to use it using the D standard library (be it Phobos, or Tango, or whatever will turn out to become some sort of standard). Also the development of the OS might influence the development of a D standard library at some points.

Is there anyone here who is interested in working with me to get that project going, and help by contributing in the development of a specification and/or in implementation of those (including PoC coding)?

Regards,

Harry Vennik
January 02, 2007
Harry Vennik wrote:
> 
> The OS should consist of a microkernel similar to L4, to be written in C (as much as possible) and Assembly (where necessary). And any number of services running on top of it, all to be written in D. It should be an OS that is inspired on UNIX, but not be a real UNIX implementation. Rather it should feel like an evolution of the UNIX-way of doing things.

Why would you want to write the kernel itself in C? AFAIK, there is no real problem in coding the kernel itself in D too.

I'm not going to volunteer on this project, but I wish you good luck. Source distributions would be so much more interesting with a language as quickly compiled as D.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
January 02, 2007
Harry Vennik wrote:
> Hi,
> 
> At the beginning of this year I'd like to present a whole new idea that very much involves the D
> Programming Language. My idea is to start development of an experimental operating system, that
> should be constructed in an object-oriented way as much as possible, but no 'forcing of OOP at all
> cost'. Of course OS implementation involves a lot of low-level coding. The one and only suitable
> language to combine low-level coding and OOP appears to be D. (Don't argue it could be C++ too, that
> language is unusable because of it's immense complexity. I keep asing myself why so many people use
> it anyway...)
> 
> The OS should consist of a microkernel similar to L4, to be written in C (as much as possible) and
> Assembly (where necessary). And any number of services running on top of it, all to be written in D. It
> should be an OS that is inspired on UNIX, but not be a real UNIX implementation. Rather it should feel
> like an evolution of the UNIX-way of doing things.
> 
> I realize that the current performance of D might not be suitable for serious OS development, but I do
> not think of that as a real problem. I think that in the very first, highly experimental phase of
> development, the actual performance is not much of an issue. Later on, when it will become an issue,
> the D compiler will probably have been improved already to provide that optimization performance.
> 
> I chose the D Programming Language only for its bare language features, not anything else. It was
> simply the only language I could find that met my requirements. Any libraries or frameworks won't help
> in OS development anyway, because they are supposed to be used on top of an OS. Of course the
> interfaces of the OS should be optimized to make it as easy as possible to use it using the D standard
> library (be it Phobos, or Tango, or whatever will turn out to become some sort of standard). Also the
> development of the OS might influence the development of a D standard library at some points.
> 
> Is there anyone here who is interested in working with me to get that project going, and help by
> contributing in the development of a specification and/or in implementation of those (including PoC
> coding)?
> 
> Regards,
> 
> Harry Vennik

Hello Harry,

I'm doing a research project with pretty similar approaches, with just one difference: the kernel shall be totally in D and necessary parts in assembly (may it be inline assembly, or nasm/yasm/gas/whatever - just the right tool for each individual job). I have a very little code base already in a public Subversion repository, if you want to take a look. The base idea of this project was meant to be implemented in C, but I'm trying to push through a D version for the proof of the statement, that D is a system programming language - and it is, a great one even!

Unfortunately there's not too much information or documentation yet, as it's just a hobby project I'm doing with a friend of mine in our spare time (got too little of that lately :( ).

Anyways, here's the URL of the C code base we have so far implemented and running: http://trac.brainsware.org/ocb
The D version is just some testing code, a sketch if you want. I'm working on a better implementation of the basic things at the moment. Apart from that, I haven't got interrupts or exceptions to work yet - still some research to do there. http://trac.brainsware.org/ocd/

Great to see that I'm not the only one (together with the Titan folks, of course ;) ) who thinks that D would be the perfect language for OS development! :)

Best regards,
Alex

P.S.: What do you mean with "PoC coding"? Proof of Concept?
January 02, 2007
Hi Harry,
Why C and ASM.
Have a look at TANGO ( New library announcement) you may find some very
interesting infos. POSIX just to name something.
Good luck Bjoern

"Harry Vennik" <htvennik@zonnet.nl> schreef in bericht news:endnt7$fe7$1@digitaldaemon.com...
> Hi,
>
> At the beginning of this year I'd like to present a whole new idea that
very much involves the D
> Programming Language. My idea is to start development of an experimental
operating system, that
> should be constructed in an object-oriented way as much as possible, but
no 'forcing of OOP at all
> cost'. Of course OS implementation involves a lot of low-level coding. The
one and only suitable
> language to combine low-level coding and OOP appears to be D. (Don't argue
it could be C++ too, that
> language is unusable because of it's immense complexity. I keep asing
myself why so many people use
> it anyway...)
>
> The OS should consist of a microkernel similar to L4, to be written in C
(as much as possible) and
> Assembly (where necessary). And any number of services running on top of
it, all to be written in D. It
> should be an OS that is inspired on UNIX, but not be a real UNIX
implementation. Rather it should feel
> like an evolution of the UNIX-way of doing things.
>
> I realize that the current performance of D might not be suitable for
serious OS development, but I do
> not think of that as a real problem. I think that in the very first,
highly experimental phase of
> development, the actual performance is not much of an issue. Later on,
when it will become an issue,
> the D compiler will probably have been improved already to provide that
optimization performance.
>
> I chose the D Programming Language only for its bare language features,
not anything else. It was
> simply the only language I could find that met my requirements. Any
libraries or frameworks won't help
> in OS development anyway, because they are supposed to be used on top of
an OS. Of course the
> interfaces of the OS should be optimized to make it as easy as possible to
use it using the D standard
> library (be it Phobos, or Tango, or whatever will turn out to become some
sort of standard). Also the
> development of the OS might influence the development of a D standard
library at some points.
>
> Is there anyone here who is interested in working with me to get that
project going, and help by
> contributing in the development of a specification and/or in
implementation of those (including PoC
> coding)?
>
> Regards,
>
> Harry Vennik


January 02, 2007
Hi,

Thanks for the quick replies.

In general, most mentioned already is the question 'why C instead of D for the microkernel?'. The answer is that there is no OOP involved in the microkernel at all, and the added value of D would probably be nothing there. If any advantages of using D also for the microkernel become obvious, I'll likely change my mind, and indeed implement it in D too. Anyway, keep in mind: a micro kernel should really be micro! It would only implement page level memory management, a scheduler and an IPC meganism. The rest is up to the services.

@Alex: Very nice to hear there are more people with approximately the same idea. I haven't really
looked at your source yet, but I will soon. And yes, you got it right: PoC is short for 'Proof of Concept'.

@Lars: What do you mean to say by 'Source distributions would be so much more interesting with a language as quickly compiled as D.'?

@Bjoern: Yes, I read the announcement of Tango just before I composed my initial post. Haven't really looked what the lib is like yet, but I will. POSIX is probaly not much of interest, because it is a C interface, and thus not OO. However, something like a POSIX compatibility library programmed on top of the OO system may be done some day to make it possible to compile existing apps for the new OS. (I know that is a real change of roles. With current OSs you'd rather code an OO-style framework on top of POSIX.)

Regards,

Harry
January 02, 2007
Harry Vennik wrote:
> Hi,
> 
> Thanks for the quick replies.
> 
> Anyway, keep in mind: a micro kernel should
> really be micro! It would only implement page level memory management, a scheduler and an IPC
> meganism. The rest is up to the services.
> >

What about I/O? mmap the file from a service for block devices? shared memory for the buffer for stream? I have thought this would be an interesting way to go.

> Regards,
> 
> Harry
January 02, 2007
Harry Vennik wrote:
> Hi,
> 
> Thanks for the quick replies.
> 
> In general, most mentioned already is the question 'why C instead of D for the microkernel?'. The
> answer is that there is no OOP involved in the microkernel at all, and the added value of D would
> probably be nothing there. If any advantages of using D also for the microkernel become obvious, I'll
> likely change my mind, and indeed implement it in D too. Anyway, keep in mind: a micro kernel should
> really be micro! It would only implement page level memory management, a scheduler and an IPC
> meganism. The rest is up to the services.

Oh, trust me. OO does a good job here, too. Actually, if you take a look at OCB, it's already doing it in an object oriented way, as far as possible in C.

> 
> @Alex: Very nice to hear there are more people with approximately the same idea. I haven't really
> looked at your source yet, but I will soon. And yes, you got it right: PoC is short for 'Proof of Concept'.
> 

Great. Wanted to mention that phrase too, but didn't quite get a good sounding sentence formulated.. X-P

> Regards,
> 
> Harry

Best regards,
Alex
January 02, 2007
Harry Vennik wrote:
> 
> @Lars: What do you mean to say by 'Source distributions would be so much more interesting with a language as quickly compiled as D.'?

With source distributions, I mean Linux distributions like Gentoo, and others, where part of the installation process is to compile everything using flags to make an OS that fits your computer very well. What put me off using Gentoo, was mostly that it took at least a couple of days to set up a system with a full desktop. D is so much faster to compile, that the installation likely would become much more endurable.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
January 02, 2007
> What about I/O? mmap the file from a service for block devices? shared memory for the buffer for stream? I have thought this would be an interesting way to go.

Indeed, might be something like the shared memory buffer. Such would allow very good performance. There may be some process isolation problems / security risks. But I think those will be solvable.
January 02, 2007
Harry Vennik wrote:
> In general, most mentioned already is the question 'why C instead of D for the microkernel?'. The
> answer is that there is no OOP involved in the microkernel at all, and the added value of D would
> probably be nothing there.

I'd turn the question around and ask what advantage there is to writing in C?
« First   ‹ Prev
1 2 3