My free-time efforts over the last few years have been entirely focused on learning, not production. Everything I did up until this point has been entirely in x86 assembly. With that being said, I am done working on my i386 kernel (DynatOS Core) in straight x86 assembly. I have achieved my goal to intimately learn the hardware from the ground up.

It was fun learning and programming with straight x86 assembly, but now I finally feel it is the right time to shift into production mode. So from here on out, my efforts towards DynatOS will a C/ASM mix.

Before anyone thinks this project is selling out to the mass C kernel fad, here are some hard facts. DynatOS...
-will not be another Unix/POSIX clone
-will not be licensed under the GPL
-will remain as closed-source for the time being
-will have support for the ANSI C Standard Library specification
-will not be coded "just to make things work"

The next week or so will be spent porting my code to C.

If there are any comments, questions or concerns... feel free to post them here :)
Posted on 2005-03-02 18:53:07 by SpooK
Seems like your kernel is taking the same turn as mine :) I started as pure-asm too, but then went to a C/ASM mix (put on hold again for a while, because of schoolwork).

I'm not going to go the POSIX route either. I might support it as a subsystem if/when my kernel goes that far, but it certainly won't be the native API.

Btw, I'm even considering some (limited) C++ use in the kernel. Not STL or anything like that, but taking advantage of destructors to ensure resource de-allocation on errors (without gotos or a lot of "if error then release-the-resource" statements), and some buffer+string management to reduce buffer overflows etc.
Posted on 2005-03-02 23:55:02 by f0dder
Good luck to both of you ;)

Let us know when we have something to test in an emulator.
Posted on 2005-03-03 02:11:22 by BogdanOntanu
I have something to test, but it's not impressive - the current C/ASM kernel is less complete than the old one... right now it boots into a *very* basic pmode (no interrupt handlers, no paging, no tasking... I had all that partially working in the old ASM kernel) - but at least it has a cute textmode matrix-like effect ;)
Posted on 2005-03-03 09:57:23 by f0dder
Ya... it feels a little weird not controlling every aspect of execution.
Posted on 2005-03-03 15:48:17 by SpooK
I know it has been a few months but an update is needed. I've tried several attempts at making a C/ASM mixed kernel and I have come to one conclusion... I just don't like it. I simply cannot stand a compiler making all the big decisions on such a low level. Even after in-line assembly optimizations are mixed into the C code, the bloat is just too outrageous for a similar functioning product.

Another basic fact is that I started programming my OS in assembly because I liked it and wasn't concerned with trying to compete with the software market. I don't see the advantage of killing my enjoyment as a amateur programmer just to get, maybe, a 5% increase in productivity, and with it still being at the cost of bloated software.

I have more or less resolved myself to the point that I will use C-type abstract thinking in the design of my procedures, but I will still program in assembly language with a few macros here and there.

Let this be a lesson to all of you who program... do it for fun :)
Posted on 2005-06-26 18:35:13 by SpooK
So it is back to square one? Enjoy coding in assembly.  ;)
Posted on 2005-06-27 07:01:02 by roticv

the bloat is just too outrageous for a similar functioning product

Are you using a very lousy C compiler, or are you over-zealous about bloat? :-)

Let this be a lesson to all of you who program... do it for fun

Especially if you're playing with os-dev -- no, you aren't going to beat Microsoft :)
Posted on 2005-06-27 07:06:31 by f0dder

Are you using a very lousy C compiler, or are you over-zealous about bloat? :-)

It isn't the compiler, it's the language. I've spent 3 months with 3 different compilers that have different options and switches and optimization methods and the list goes on. Despite those different approaches, I was given nearly the same results. I'd even gone as far as to think that I am the worst C programmer in the world, but when I searched I came up with similar implementations of my ideas. I had even used exact implementations of "de-facto" methods that weren't nearly as efficient as what I can write in assembly language.

So I have drawn 2 conclusions: everyone in the world sucks at writing low-level C code, or compiler routines are too generic for such low-level optimizations. I am willing to bet the world on the latter of the two.

So to sum things up for you f0dder, no, I don't want your opinions nor your "expertise" on what I could possibly be doing wrong in order to "enlighten" me on why compiler coding is so much greater, efficient, and beneficial than assembly language. You are going to get as much response from me as you do from Hutch in this situation... so save your propaganda for someone else.

PS: And yes, I am overly-fanatical about bloat ;)
Posted on 2005-06-27 22:27:44 by SpooK
Whoa, easy now... I think that was a bit uncalled for.

I'm actually genuinely interested in this, since I'm (from time to time) playing with my own toy kernel. I'm not trying to convince you to write the kernel in C/C++/Pascal/ADA/Cobol/Forth/whatever, but I think it would be beneficial for everyone to discuss the pros and cons of various approaches.

I've set a target of a PII-350 with 8 megs of ram for my kernel, since that's the slowest machine I have lying around (it has 64 megs of ram, but I don't want to require that much :)).

A mix of C/C++/Assembly does the trick pretty well for me, even for this lowly platform, and I wouldn't call the output 'bloated'. Sure, handcoding everything in assembly could get the size a bit down and the speed a bit up, but it's not like I'm getting pregnant-woman kind of bloat ;)

I'm still doing "more than I should" of the code in assembly, btw, since I think it's fun.
Posted on 2005-06-28 07:37:14 by f0dder
Just trying to cut you off at the pass ;)
Posted on 2005-06-28 16:48:53 by SpooK
Bit of an update.

The DynatOS Core will still be written in assembly language.

As for the rest of the system, probably looking at utilizing C, though I am still a long way off from having to worry about this :)
Posted on 2006-06-13 11:59:58 by SpooK