Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 21, 2012 Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
is it possible to use D to write code to work without OS? like i do it with gcc. |
June 21, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alex | On Thursday, 21 June 2012 at 16:39:07 UTC, Alex wrote:
> is it possible to use D to write code to work without OS? like i do it with gcc.
With the runtime, I want to say no. If you drop the runtime and GC (including dynamic arrays), I honestly don't see why not. However if you don't have any OS connections you have to write IO yourself, some of it probably in assembly (That or it's a very silent and unfruitful program). Maybe good for certain device drivers but beyond that it doesn't seem too practical. At this moment.
|
June 21, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alex | On 6/21/2012 9:39 AM, Alex wrote:
> is it possible to use D to write code to work without OS?
> like i do it with gcc.
Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
|
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
> On 6/21/2012 9:39 AM, Alex wrote:
>> is it possible to use D to write code to work without OS?
>> like i do it with gcc.
>
> Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
Good luck getting the C-runtime part of the "D runtime" right..
|
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mehrdad | On 6/21/2012 11:07 PM, Mehrdad wrote:
> On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
>> On 6/21/2012 9:39 AM, Alex wrote:
>>> is it possible to use D to write code to work without OS?
>>> like i do it with gcc.
>>
>> Sure. But you'll need to thoroughly understand how the D runtime startup code
>> works, so you can adjust as necessary.
>
> Good luck getting the C-runtime part of the "D runtime" right..
It's not that hard. But there's a lot of detail to learn & take care of.
|
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote: > On 6/21/2012 11:07 PM, Mehrdad wrote: >> Good luck getting the C-runtime part of the "D runtime" right.. > > It's not that hard. But there's a lot of detail to learn & take care of. Where do you find the "detail"? (Remember this, below?) http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=155617 |
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mehrdad | On Friday, 22 June 2012 at 06:07:59 UTC, Mehrdad wrote:
> On Thursday, 21 June 2012 at 19:44:40 UTC, Walter Bright wrote:
>> On 6/21/2012 9:39 AM, Alex wrote:
>>> is it possible to use D to write code to work without OS?
>>> like i do it with gcc.
>>
>> Sure. But you'll need to thoroughly understand how the D runtime startup code works, so you can adjust as necessary.
>
> Good luck getting the C-runtime part of the "D runtime" right..
I don't really know the runtime code of the generated binary code, but this is no different than other high level languages used for OS development, like Modula-3 or Oberon.
The C runtime just needs to be replaced by an Assembly runtime that provides the ground work for the language runtime at the OS level.
The way this is done on Oberon's case is well documented.
After all the reason why C has so tiny runtime, is that in C the OS is the language runtime.
|
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mehrdad | On 22-Jun-12 10:49, Mehrdad wrote: > On Friday, 22 June 2012 at 06:35:41 UTC, Walter Bright wrote: >> On 6/21/2012 11:07 PM, Mehrdad wrote: >>> Good luck getting the C-runtime part of the "D runtime" right.. >> >> It's not that hard. But there's a lot of detail to learn & take care of. > > > Where do you find the "detail"? > > > (Remember this, below?) > Just replace all of symbols with abort stubs. Then implement the ones you happen to actually need. > http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=155617 > -- Dmitry Olshansky |
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | On Friday, 22 June 2012 at 08:00:08 UTC, Dmitry Olshansky wrote:
> Then implement the ones you happen to actually need.
Er, the question isn't WHAT to do, it's HOW.
If you have any idea how to implement things like TLS, SEH, and the like, then PLEASE, share them!
The point I was trying to make was, though, that this information is not being shared with anyone.
Which leads me to believe that whoever has this information doesn't want people to use it for D development...
|
June 22, 2012 Re: Raw binary(to work without OS) in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mehrdad | On 22-Jun-12 12:08, Mehrdad wrote: > On Friday, 22 June 2012 at 08:00:08 UTC, Dmitry Olshansky wrote: >> Then implement the ones you happen to actually need. > > > Er, the question isn't WHAT to do, it's HOW. > > If you have any idea how to implement things like TLS, SEH, and the > like, then PLEASE, share them! > Look at say Win32 API. There is a way to reroute most of things you listed directly to it. I actually do this kind of stuff in my spare time. Of course your own kernel has some manner of system calls too. > The point I was trying to make was, though, that this information is not > being shared with anyone. > If you can't figure it out on your own, chances are you won't be able to do what you wanted in the first place (e.g. real-time micro-kernel). I mean it's nothing magical, all of these things are present in say MS C compiler and people do these things with it just _fine_. > Which leads me to believe that whoever has this information doesn't want > people to use it for D development... Yeah, I understand how it could be frustrating, but once you are on this kind of level you usually already running circles around all of this stuff. That being said the info won't hurt of course. -- Dmitry Olshansky |
Copyright © 1999-2021 by the D Language Foundation