Page 1 of 1
Layered vs. Non-layered
Posted: Sat Aug 22, 2009 4:14 pm
by WechtleinUns
It makes perfect sense to me for an operating system to be built in "layers", as in the Scheduler is build first, and then higher level abstractions built on top of that, for example.
But I have heard that operating systems can be built in a modular, "non-layered" approach, with implementation different from the layered approach. This intrigues me, because, well, It just seems so unnatural to me that I have a hard time imagining how a non-layered operating system might be implemented, and why anyone would want to do it that way. I'm curious, is all.
Discussion?
Re: Layered vs. Non-layered
Posted: Sat Aug 22, 2009 9:32 pm
by AndrewAPrice
An operating system without abstractions? No filesystems or files, merely binary data. No processes, merely threads associated with a page directory. No input handlers, merely interrupts forwarded to who ever wants it.
?
Re: Layered vs. Non-layered
Posted: Sat Aug 22, 2009 9:59 pm
by xvedejas
Could you give concrete examples of what you're trying to say?
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 12:14 am
by neon
But I have heard that operating systems can be built in a modular, "non-layered" approach
Why cant a modular operating system be built in "layers"?
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 7:29 am
by Kitsune
By any chance, are you meaning an
Exokernel? Those have very little abstraction (basically, just enough to be able to multiplex the hardware).
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 7:50 am
by tantrikwizard
WechtleinUns wrote:It makes perfect sense to me for an operating system to be built in "layers", as in the Scheduler is build first, and then higher level abstractions built on top of that, for example.
WTH are you talking about? Please get familiar with the lingo.
http://wiki.osdev.org/Kernels There's a language that OS developers use and it would be wise to learn it if you're attempting to have a meaningful discussion.
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 12:46 pm
by WechtleinUns
Oh, I am sorry. I suppose my experience with "layered" operating systems would be the Xinu Approach, which is a textbook I have read and re-read many times. Xinu seems to be, if my reading is correct, a monolithic operating system, and it is layered, obviously. I suppose the difference between layered and un-layered in my mind is the difference between a single large binary, with newer features implemented on top of old features, and a series of stand-alone binaries that can operate independently.
I wasn't sure if it was even possible to create a kernel where all the modules stand alone and don't need each other to implement themselves. But based on your reactions, I'm a little confused. Is it the case that every module needs a different, lower level abstraction to be implemented, i.e. work in layers?
Or is it possible to create a series of modules that are perfectly isolated, and don't need each other to cooperate or be implemented?
Here, this is a good approach: In xinu, there is talk of concurrency, which I'm sure you all know very well. The role of the operating system is to faciliate concurrency between processes while giving the illusion that there is no concurrency to user-space programs. My question is this: Is it possible to create a kernel that is actually a group of isolated modules that do not have a framework coordinating them, but still somehow manage to cooperate?
Sort of like the userspace programs in the days before operating systems, where everyone had to make sure their program played nice with others. This time, the modules might have to be programmed in such a way that they play nice with each other without any base framework. Is that possible?
p.s. Sorry if this sounds really stupid. please don't throw rocks at me.
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 1:13 pm
by Kitsune
So you're actually talking about
Microkernel based operating systems? Those range from the not-really-at-all like very recent Linux kernels (with FUSE, CUSE, and userspace USB drivers, even though the VAST majority is monolithic) to the extremely-micro-kernel like Minix 3 (nearly
everything is a module)/
My question is this: Is it possible to create a kernel that is actually a group of isolated modules that do not have a framework coordinating them, but still somehow manage to cooperate?
It depends on exactly what you mean. If the OS simply implements a generic message passing interface, does that count as a 'framework coordinating them'? If the applications can communicate at all, then they can cooperate... in a Microkernel, one of the few jobs of the core kernel is to try to make the
communication as good as possible.
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 1:20 pm
by WechtleinUns
Ah. I see. So the only way you can have those types of modules is if there is a framework of communication? I am interested, however, in how one can take it to the extreme, where the modules can communicate without any need for a kernel. Reallly, instead of a super small kernel, the kernel is gone and there are only modules, each one being able to function in a concurrent environment without having to communicate or have any module working as well..
In other words, not really a group of modules, but taking a monolithic kernel and chopping it up into separate programs that are programmed in such a way that they will work 99% of the time, without having to know what the other kernel programs are doing. Is that possible?
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 1:33 pm
by Kitsune
You could do something close if you put everything (read: modules) in ring0 and give up on the benefits of memory protection (which'd make it possible for a single module crapping out to take out the entire machine). The modules would still have to agree on how they'd communicate before hand, and you'd still have something that at least somewhat resembles a core kernel (such as memory management).
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 3:54 pm
by tjhastings
Hello all,
neon wrote:WechtleinUns wrote:But I have heard that operating systems can be built in a modular, "non-layered" approach
Why cant a modular operating system be built in "layers"?
Neon is correct. Layering can be orthogonal to how the system is physically structured. One can have a layered system with or without modules. The
key concept of a layered system is that each layer
only relies on the functionality of the lower layers.
Example:
THE operating system
- TJ
Re: Layered vs. Non-layered
Posted: Sun Aug 23, 2009 5:29 pm
by JackScott
Yes, it is Unix spelled backwards. However, it is indeed an operating system. Wikipedia page:
http://en.wikipedia.org/wiki/Xinu
It seems to be a teaching OS from the University of Purdue.