digitalmars.D - Can i use D for OS develop.
- knott (2/2) Aug 16 2007 Hello. Before i start, i must apologize for my poor English.
- Paul Collier (7/10) Aug 16 2007 If you're talking about OS development, there are at least two projects
- knott (3/13) Aug 16 2007 Im talking about a userspace development in system which in early stage ...
- Paul Collier (7/22) Aug 16 2007 OK, you may have to omit some bits of the standard library then. (Or
- Kyle Furlong (4/30) Aug 16 2007 If the new platform has a standard C malloc, you can modify the runtime
- knott (2/26) Aug 16 2007 Can i disagree standart library and write my own one?
- BCS (2/4) Aug 16 2007 That's more or less what Tango is. So yes.
- kris (7/22) Aug 16 2007 Tango would rather not have the full C lib either. It rather
- BCS (13/43) Aug 16 2007 How hard would it be to Have tango be running in D right up to the when ...
- kris (5/24) Aug 16 2007 Not very hard at all.
- Sean Kelly (9/35) Aug 16 2007 For what it's worth, the only standard C lib call of note used by the
- Brad Roberts (17/55) Aug 16 2007 There's others, file apis, socket apis, time apis, etc.. the list is qui...
- kris (5/63) Aug 16 2007 Perhaps not a question of moving "off" libc? An option to link with
- Walter Bright (2/5) Aug 16 2007 Yes.
- Alexander Panek (2/8) Aug 17 2007 Oh great, I thought I would have to come up with that answer. ;)
Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?
Aug 16 2007
knott wrote:Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Paul Collier Wrote:knott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
knott wrote:Paul Collier Wrote:OK, you may have to omit some bits of the standard library then. (Or just not use it.) Whether you use phobos or tango or whatever you like, the source is provided, so it's pretty easy to add version() statements to stick in workarounds if you want. Is the system using ulibc or something of the sort? I wonder how compatible that is... (Also, this thread might be better to post on D.learn, but I'm not sure)knott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Paul Collier wrote:knott wrote:If the new platform has a standard C malloc, you can modify the runtime to use it fairly easily. I'm not sure if there are any other dependencies in the runtime.Paul Collier Wrote:OK, you may have to omit some bits of the standard library then. (Or just not use it.) Whether you use phobos or tango or whatever you like, the source is provided, so it's pretty easy to add version() statements to stick in workarounds if you want. Is the system using ulibc or something of the sort? I wonder how compatible that is... (Also, this thread might be better to post on D.learn, but I'm not sure)knott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Paul Collier Wrote:knott wrote:Can i disagree standart library and write my own one?Paul Collier Wrote:OK, you may have to omit some bits of the standard library then. (Or just not use it.) Whether you use phobos or tango or whatever you like, the source is provided, so it's pretty easy to add version() statements to stick in workarounds if you want. Is the system using ulibc or something of the sort? I wonder how compatible that is... (Also, this thread might be better to post on D.learn, but I'm not sure)knott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Reply to knott,Can i disagree standart library and write my own one?That's more or less what Tango is. So yes.
Aug 16 2007
knott wrote:Paul Collier Wrote:Tango would rather not have the full C lib either. It rather deliberately uses only a handful of clib calls, and a (small) replacement for those has been on the cards for years. We just never got the time to do that. We'd be very interested in a lightweight replacement for those few clib calls, written in Dknott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Reply to kris,knott wrote:How hard would it be to Have tango be running in D right up to the when system calls jump into kernel space? with templates you could wrap the nitty gritty of systems calls real nice R SystemCall(uint number, R, A...) { asm { // whatever } } alias SystemCall!(SystemCallNumbers.open, int, ...) open; ...Paul Collier Wrote:Tango would rather not have the full C lib either. It rather deliberately uses only a handful of clib calls, and a (small) replacement for those has been on the cards for years. We just never got the time to do that. We'd be very interested in a lightweight replacement for those few clib calls, written in Dknott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Not very hard at all. Tango itself doesn't really use clib when compiled for Win32 (uses Win32 calls for most everything), so some of these notions are already in use. BCS wrote:Reply to kris,[snip]How hard would it be to Have tango be running in D right up to the when system calls jump into kernel space? with templates you could wrap the nitty gritty of systems calls real nice R SystemCall(uint number, R, A...) { asm { // whatever } } alias SystemCall!(SystemCallNumbers.open, int, ...) open; ...
Aug 16 2007
kris wrote:knott wrote:For what it's worth, the only standard C lib call of note used by the Tango runtime is malloc/free. A few others are used for convenience (memset, memmove), but could easily be removed. By the way, the Tango runtime is designed in a way to makes replacing the "standard library" portion quite easy, which may be of interest to you if you're thinking about writing your own. I'll be discussing the design at the D conference next week. SeanPaul Collier Wrote:Tango would rather not have the full C lib either. It rather deliberately uses only a handful of clib calls, and a (small) replacement for those has been on the cards for years. We just never got the time to do that. We'd be very interested in a lightweight replacement for those few clib calls, written in Dknott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
On Thu, 16 Aug 2007, Sean Kelly wrote:kris wrote:There's others, file apis, socket apis, time apis, etc.. the list is quite a bit longer than you might think. I really don't understand the desire to move off of libc. libc provides a number of very useful benefits: -- no need to understand the kernel call semantics for every os -- no need to figure out how to conform to posix (and other standards) for each kernel/os. -- no need to re-optimize for each cpu interesting low level bits like how to move memory the fastest -- good malloc subsystems are _hard_ to write (definition of good is obvious debatable) There's a big downside.. it's impossible in D to restrict usage of parts of a library.. anyone can provide their own extern(C) blah and poke past the abstractions that Tango and Phobos are trying to provide. Later, Bradknott wrote:For what it's worth, the only standard C lib call of note used by the Tango runtime is malloc/free. A few others are used for convenience (memset, memmove), but could easily be removed. By the way, the Tango runtime is designed in a way to makes replacing the "standard library" portion quite easy, which may be of interest to you if you're thinking about writing your own. I'll be discussing the design at the D conference next week. SeanPaul Collier Wrote:Tango would rather not have the full C lib either. It rather deliberately uses only a handful of clib calls, and a (small) replacement for those has been on the cards for years. We just never got the time to do that. We'd be very interested in a lightweight replacement for those few clib calls, written in Dknott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
Brad Roberts wrote:On Thu, 16 Aug 2007, Sean Kelly wrote:Perhaps not a question of moving "off" libc? An option to link with something simpler, or written in D, or whatever? As for malloc(), many libs appear to use a derivative of Doug Lea's venerable incarnation :)kris wrote:There's others, file apis, socket apis, time apis, etc.. the list is quite a bit longer than you might think. I really don't understand the desire to move off of libc. libc provides a number of very useful benefits: -- no need to understand the kernel call semantics for every os -- no need to figure out how to conform to posix (and other standards) for each kernel/os. -- no need to re-optimize for each cpu interesting low level bits like how to move memory the fastest -- good malloc subsystems are _hard_ to write (definition of good is obvious debatable) There's a big downside.. it's impossible in D to restrict usage of parts of a library.. anyone can provide their own extern(C) blah and poke past the abstractions that Tango and Phobos are trying to provide. Later, Bradknott wrote:For what it's worth, the only standard C lib call of note used by the Tango runtime is malloc/free. A few others are used for convenience (memset, memmove), but could easily be removed. By the way, the Tango runtime is designed in a way to makes replacing the "standard library" portion quite easy, which may be of interest to you if you're thinking about writing your own. I'll be discussing the design at the D conference next week. SeanPaul Collier Wrote:Tango would rather not have the full C lib either. It rather deliberately uses only a handful of clib calls, and a (small) replacement for those has been on the cards for years. We just never got the time to do that. We'd be very interested in a lightweight replacement for those few clib calls, written in Dknott wrote:Im talking about a userspace development in system which in early stage of development. I want to write program on system which have only small(not full) C library.Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?If you're talking about OS development, there are at least two projects to write a kernel in D. You can see them at dsource.org. If you're talking userspace development, I think you'll find that 95% of D projects already run in userspace ;) If you're talking about something in the middle, you can always bind D code to C APIs and disable the garbage collector if needed.
Aug 16 2007
knott wrote:Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?Yes.
Aug 16 2007
Walter Bright wrote:knott wrote:Oh great, I thought I would have to come up with that answer. ;)Hello. Before i start, i must apologize for my poor English. Can i use D language for OS development(Non-core - user mode devel)?Yes.
Aug 17 2007