Layered vs. Non-layered

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
WechtleinUns
Posts: 8
Joined: Thu Jan 22, 2009 12:10 pm

Layered vs. Non-layered

Post 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?
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: Layered vs. Non-layered

Post 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.

?
My OS is Perception.
User avatar
xvedejas
Member
Member
Posts: 168
Joined: Thu Jun 04, 2009 5:01 pm

Re: Layered vs. Non-layered

Post by xvedejas »

Could you give concrete examples of what you're trying to say?
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Layered vs. Non-layered

Post 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"?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Kitsune
Posts: 20
Joined: Wed Aug 05, 2009 7:13 pm

Re: Layered vs. Non-layered

Post 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).
tantrikwizard
Member
Member
Posts: 153
Joined: Sun Jan 07, 2007 9:40 am
Contact:

Re: Layered vs. Non-layered

Post 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.
WechtleinUns
Posts: 8
Joined: Thu Jan 22, 2009 12:10 pm

Re: Layered vs. Non-layered

Post 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.
Kitsune
Posts: 20
Joined: Wed Aug 05, 2009 7:13 pm

Re: Layered vs. Non-layered

Post 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.
WechtleinUns
Posts: 8
Joined: Thu Jan 22, 2009 12:10 pm

Re: Layered vs. Non-layered

Post 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?
Kitsune
Posts: 20
Joined: Wed Aug 05, 2009 7:13 pm

Re: Layered vs. Non-layered

Post 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).
tjhastings
Posts: 12
Joined: Sat Feb 02, 2008 5:49 pm

Re: Layered vs. Non-layered

Post 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
Theorem: a cat has nine tails.

Proof: No cat has eight tails. A cat has one tail more than no cat.

Therefore, a cat has nine tails.
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Re: Layered vs. Non-layered

Post 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.
Post Reply