Linked by Hadrien Grasland on Sun 29th May 2011 09:42 UTC
OSNews, Generic OSes It's funny how trying to have a consistent system design makes you constantly jump from one area of the designed OS to another. I initially just tried to implement interrupt handling, and now I'm cleaning up the design of an RPC-based daemon model, which will be used to implement interrupt handlers, along with most other system services. Anyway, now that I get to something I'm personally satisfied with, I wanted to ask everyone who's interested to check that design and tell me if anything in it sounds like a bad idea to them in the short or long run. That's because this is a core part of this OS' design, and I'm really not interested in core design mistakes emerging in a few years if I can fix them now. Many thanks in advance.
Permalink for comment 475152
To read all comments associated with this story, please click here.
RE[12]: Comment by Kaj-de-Vos
by xiaokj on Mon 30th May 2011 19:52 UTC in reply to "RE[11]: Comment by Kaj-de-Vos"
Member since:

This sounds a bit religious. Why should there be a single sensible way out ?

Yes it does sound so. Which is why I was thinking it would be rather heavy-handed to decide to do it at the systems-API level. But your own point about RPC is also as religious, no? ;-)

Wait a minute, why are you talking about file systems already ? This is interprocess communication, were are in the early stages of a microkernel's boot and the filesystem is still far from being available yet.

Read that again! This is clearly too early to do, but is part of the final design. The initrd created by mkinitrd is fixed and is loaded into the kernel at boot, while the rest of the filesystem is still dead. If you have no time to do this, you are certainly free to just leave it be.

Hmmm... You should check Kaj's post, he totally mentions a type system in there (that's why the first integer number in his command parameters is here for), that separates integer and floating point data.

This sounds Zen, but as you focus on the type system, I am focusing on the fact that this "type system" you are talking about lives as plain text arranged in readable and parse-able format. Of course, in the end, you will be implementing a type system, but the difference is huge! You will be able to reconfigure with impunity as it has been shown.

This is desirable for a number of scenarios, but I'd like to point out that I'm currently talking about a system API which does not have "being portable to other OSs without issue" as it goals. Besides, I don't see why basing my OS on a declarative data paradigm would offer better interoperability with anything but OSs based on declarative data paradigms (like Syllabe). How would such a paradigm make interoperability with, say, an UNIX system where everything is about text files and data pipes, easier ?

a) Portable also means portable in time. Within your own OS, if you had taken the time to write it in this manner, you may find it much easier to keep things sane (not breaking every few moments you want to change).

b) If you want to port against Unix, for example, you can make the parser generate an API translator, I suppose. Sadly, almost every API call will incur one translation overhead (or actually maybe less), but at least the code will work out of the box.

Define "changes". I don't think that you can suddenly decide tomorrow that's malloc's integer parameter should be a number of megabytes instead of a number of bytes and have all programs based on the old implementation work without recompiling them. Some changes may be easier, sure, but you'd have to precise which and why.

I actually myself advocate some compromise -- it is clear you won't just change malloc so easily, so there is little reason to do it as declarative. However, even there, you can see obvious improvements. If you had done it as declarative, then there is no reason why you cannot immediately change malloc to accepting size_t only, and have the parser convert old calls, using integer, into size_t in a seamless way. In this way, you can see how the information provided can be utilised to minimise your headache. Also, because of versioning, you can do abrupt breaks without trouble as long as you have seamless conversion between transitions. Also, once versioning is done, it also means you can provide function overloading (in versions, not parameters, this time), and then you can look back into your codebase and select functions still using the old version, and slowly eliminate them. This process tends to create multi-versioning disasters, but at least the system as a whole could continue working instead of dying right out. It also means that you can employ temporary fixes as you go along, which is definitely powerful.

That plain old data defines an interface to a chunk of code. If it does not include code, and if the code is not modified, then I can't see how anything but cosmetic changes can be made without breaking compatibility between the interface and the underlying code (which would sure be a bad idea).

It should not include code, and even if it does modify behaviour, it should not include code "proper". Data Tables yes, precomputed values of clear reason yes, but code, no. The aim is not to make it so general that you code an OS within an OS (bad idea always). The aim is to make machine parsing and human readability help you.

I kinda think of this as if you actually create the tools to manage your codebase a little like how you would use Wordpress with your blog. Clearly, it should not interfere with whatever genius you want to do, but it also should not be such that you find yourself hardcoding the API (html). Of course, if you find yourself spending a lot of time on the engine, that is bad too. It is a lot of balancing, of which I doubt there is anything other than raw experience that you can learn from.

I can only take comfort in the fact that I have successfully started another soul on the AoUP. That is a true jewel. Of course, there are others, like the opposite tale of Unix Hater's Handbook, and so on. Computing is HARD! So much balancing to do! :-)

Reply Parent Score: 2