<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
... actually, MS wrote an experimental OS that was completely in .Net which,<br>
by the few people I know who actually saw it, was really, really good. But<br>
wouldn't have supported the old Win API so wasn't going anywhere.<br>
</blockquote>
<br></div>
Isn't that a shame?<br>
<br>
I'm surprised Google hasn't released a desktop operating system yet.<br>
<br>
I wonder if they just threw the /unsafe switch and did their own memory management. You don't actually need to use the GC in .NET -- did you know?</blockquote><div><br>I believe that it was all "managed"<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
IBM writes a lot of their mainframe operating systems in PL/X which is a<br>
variant on PL/I. OS/400 I believe has a bit in some OO variant of RPG.<br>
</blockquote>
<br></div>
Are either of those GC'ed?</blockquote><div class="im">No idea. <br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'd personally be inclined to have a stab with Oberon (since they've<br>
developed an OS in it anyway), its Pascal derivative and supports some very<br>
nice features.<br>
</blockquote>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Pascal is such an ugly language, don't you think?</blockquote><div class="im">I quite like Pascal <br><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And interestingly you probably wouldn't use many of C's defaults - I think<br>
its already been commented that its method of passing parameters is actually<br>
rather inefficient<br>
</blockquote>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
What's wrong with how it passes parameters? How could you do better?<br>
<br>
The method of passing parameters is basically to copy their values onto the stack, isn't it? (Is this ever averted by leaving them in registers? I understand that .NET can pass values in registers, but it probably has enough information to be able to do that, I'm not sure how a called function would know to check for a parameter in a register if you were calling a library function from C..?)</blockquote>
<div><br>By convention. When I convert to machine code, after the branch I know that param1 is in register 1, param2 is in register2 etc. Depending on how many registers I've got (lots on a RISC machine) I might not need to do anything else. On the stack I'm passing by convention anyway, I know that param1 is at offset X and param 2 is at offset Y...<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
as is its string representations, and its memory model<br>
is quite dangerous.<br>
</blockquote>
<br></div>
I vaguely remember hearing a remark once that having the stack grow down and the heap grow up (i.e. each toward the other) has been the source of most computer security related issues over the past few decades.<br>
<br>
I'm still not sure how that works when you have multiple stacks. Because it's a pretty primitive view of an application to say that it has one stack that grows down and one heap that grows up. Often there will be multiple stacks, although I'm not sure where they all get located. My understanding of memory models is a little trite. <br>
</blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You wouldn't use its default linking method either. This<br>
is kind of true for a lot of OSes that are "written in C" at any rate.<br>
</blockquote>
<br></div>
What's wrong with the linking model? (I don't remember anything about it).</blockquote><div>By default you statically link which involves copying most libraries into the eventual binary. Not desirable nowadays, so if you were writing an OS you'd choose to late link at load time, possibly even later than that. You'd possibly also (nowadays) think about extra things to help you debugging even if you didn't have the source or a debug copy of the binary.<br>
<br><br></div></div>