A new design

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
snasim2002
Member
Member
Posts: 37
Joined: Sat Apr 11, 2015 9:37 am

A new design

Post by snasim2002 »

I have made some "typical" Hobby Operating systems, (with paging, usermode, ELF file loading, Higher-Half, FAT32 support and other stuff..) But now I am thinking of a whole new design:
This time, my OS wll not use pagng, nor user mode, but it should be able to load so-called user mode programs. Those prgrams would not be able to tamper with kernel memory or othe programs' resources. The trick would be that the kernel would be running a super simple VM internally. On request, that VM would load user applications. The instructions would be executed by the kernel, not the CPU. (the kernel will do what the application instructs it to do.) because the process would only be allowed to use as much resources as permitted by the kernel, the whole system should look very similar to other typical Unix clones.
The VM is almost ready. I intend to write programs for it in it's own version of assembly.

Am I doing the right thing, or this is simply a waste of time ?? Suggestions are welcome. :D :D
Hellbender
Member
Member
Posts: 63
Joined: Fri May 01, 2015 2:23 am
Libera.chat IRC: Hellbender

Re: A new design

Post by Hellbender »

That's no operating system, that's a bare metal hypervisor.
Hellbender OS at github.
Techel
Member
Member
Posts: 215
Joined: Fri Jan 30, 2015 4:57 pm
Location: Germany
Contact:

Re: A new design

Post by Techel »

What are the advantages over supervision by cpu?
alexfru
Member
Member
Posts: 1111
Joined: Tue Mar 04, 2014 5:27 am

Re: A new design

Post by alexfru »

snasim2002 wrote:The instructions would be executed by the kernel, not the CPU.
How come? Is the CPU gonna be idle / in power-saving mode?
snasim2002 wrote:Am I doing the right thing, or this is simply a waste of time ??
Are you having an XY problem?
User avatar
iansjack
Member
Member
Posts: 4689
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: A new design

Post by iansjack »

snasim2002 wrote:This time, my OS wll not use pagng
Big mistake. Why ignore such a useful protection and virualization mechanism? What do you expect to gain by not supporting paging?

Otherwise you just seem to be describing a fairly standard OS model with an (unnecessary and inefficient) extra layer of CPU virtualization inserted. What's the point of this (other than to provide a less efficient implementation of the memory protection that you have thrown away by not using the processors natural MMU)?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: A new design

Post by Brendan »

Hi,
Hellbender wrote:That's no operating system, that's a bare metal hypervisor.
I think snasim2002 means something more like a SASOS running a managed language (sort of like Singularity, but with interpreted byte-code rather than compiled byte-code).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: A new design

Post by embryo2 »

snasim2002 wrote:Am I doing the right thing, or this is simply a waste of time ?? Suggestions are welcome. :D :D
Yes, you are doing just the thing you want, so it should be right for you.

But may be you are asking about what is right thing for us?
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: A new design

Post by BrightLight »

As others have already mentioned, this is just a bare-metal hypervisor, and it really isn't a new design. It's been done before, and it's going to have much lower performance than your real hardware can manage.
Oh, and paging is something very valuable; developing a bare-metal hypervisor is not a reason to abandon paging support.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
snasim2002
Member
Member
Posts: 37
Joined: Sat Apr 11, 2015 9:37 am

Re: A new design

Post by snasim2002 »

I agree paging is incredibly usefull.. I have used it extensively in my previous kernels, but, as I mentioned, this time I don't want something "usefull", but I want something "new", even if it't inefficient. My ultimate goal for this project is to get an OS that is completely different from the other OSes I built.
User avatar
iansjack
Member
Member
Posts: 4689
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: A new design

Post by iansjack »

Personally I wouldn't pursue novelty just for its own sake. But it's your time, your OS, so you do what you like. If you want to produce an OS which avoids using the "mov" instruction, or the SI and DI registers, anywhere those would be valid choices too.

The only thing that puzzles me is why you are asking here if it's a good idea. What's that got to do with anything?
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: A new design

Post by Schol-R-LEA »

Actually, this is less like a hypervisor than an exokernel; but since those are basically different perspectives on the same technology (where the difference amounts to whether you see each VM running a client operating system, or just a single process with shared libraries for services), it comes down to how you look at it, I guess. It's the sort of thing that could get you arguing over definitions for weeks without resolution.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
kjam
Posts: 9
Joined: Sun Oct 02, 2011 9:32 am

Re: A new design

Post by kjam »

snasim2002 wrote:Am I doing the right thing, or this is simply a waste of time ?? Suggestions are welcome. :D :D
This very generic description sounds fine in general (well, except dropping paging). A lot depends on the design of VM and the language/command set it executes. Maybe you can tell a bit more about them?

For performance reasons, you may want to use JIT- or AOT-compilation and actually execute native machine code, but limiting it to the code generated by the kernel from the verified VM code.
How many DSLs are needed to make a compiler?
Boris
Member
Member
Posts: 145
Joined: Sat Nov 07, 2015 3:12 pm

Re: A new design

Post by Boris »

In 64bits , you will be forced to use paging.
having a single address space will not protect you against TLB misses, provided that you will end up having many virtual addresses active at the same time , and the fact that the TLB is small.
If you stay in 32 bits with a single address space, you will have to implement software pagination, because you will want to swap out " not recently used" ( but reachable ) objects .

What kind of benefits no pagination will give you ?
Post Reply