OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 2:39 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 10:55 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Seems I can't avoid having processes able to access kernel calls. :( Who knows maybe I'll think of something :twisted:

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 11:27 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
You could trap unprivileged applications doing system calls, and instead of executing the call perform synchronous IPC with a governing process

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 3:17 pm 
Offline
Member
Member

Joined: Sun Sep 23, 2007 4:52 am
Posts: 368
Quote:
You could trap unprivileged applications doing system calls
That means going into the kernel, right?


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 4:05 pm 
Offline
Member
Member

Joined: Tue Oct 14, 2008 1:18 pm
Posts: 65
Location: Scotland
Just create a loop between two serial ports with a null modem cable and give the processes some IO privledges..... IPC without kernel interaction! :D </joke>

_________________
All your base are belong to us.


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 4:13 pm 
Offline
Member
Member

Joined: Sun Sep 23, 2007 4:52 am
Posts: 368
Quote:
give the processes some IO privledges

Quote:
IPC without kernel interaction!

And who gave the processes the io privileges? The kernel! This is just like the memory sharing outlined above, only funnier. :o

And also this was supposed to be for low-privilege processes, they can't have io port access.


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 5:26 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
So possibly the only thing I need to be implemented in the kernel is IPC?

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Tue Jan 27, 2009 10:26 pm 
Offline
Member
Member

Joined: Sun Nov 09, 2008 2:55 am
Posts: 524
Location: Pennsylvania, USA
IPC and scheduling. Otherwise there won't be any processes to do the IPC.


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Wed Jan 28, 2009 5:31 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
JohnnyTheDon wrote:
IPC and scheduling. Otherwise there won't be any processes to do the IPC.


Scheduling can be handled outside the kernel. Process switching must be done by the kernel of course, for changing page tables and the like.


JAL


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Wed Jan 28, 2009 6:30 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
Why not give the process a shared page that it can use to communicate with the IPC server when the process is spawned?

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Wed Jan 28, 2009 10:54 am 
Offline
Member
Member

Joined: Sun Sep 23, 2007 4:52 am
Posts: 368
MessiahAndrw wrote:
Why not give the process a shared page that it can use to communicate with the IPC server when the process is spawned?

You could do that, but the IPC server would have to continously keep checking the pages of all processes to see if something happened in there. Does it sound efficient?


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Wed Jan 28, 2009 10:32 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
How about a page every process uses that acts like a queue (with a lock of course so only one process can use it (or a section of it) at a time)? And maybe a bit somewhere that each process is assigned, and when it's set it means there is something waiting on the queue (this bit could also be used to awake sleeping processes).

I'm probably far oversimplifying it (I haven't really thought about it much at all) but it's one possibility of how you could do IPC without system calls. The disadvantage of this is mostly performance related. The queue could be locked right before a context switch and therefore every other process trying to communicate will essentially be stalled for a time slice each (this could be fixed with some research into locking algorithms and having a dynamic number of locks or something). Also, there's no way to have block-and-sending that will instantly task switch while sending the message at the same time (e.g. imagine a game (the only active process) sending an graphics command to the graphics server, the game will sleep while the graphics server awakens and a message is send to the graphics server and switch to the graphics server (if the only process awake) - all in one atomic call), I guess you could get around this with firing the timer several times faster than the time slice (though too rapidly and then a noticeable percentage of your CPU cycles will be spent inside your handler) to check if the process's sleep bit is turned on or queue several messages before deciding to sleep.

This might only be viable if we had an interrupt-less, exception-less (and in all other ways impossible to implement calls) system.

If it's on a real time system then it could be a way to guarantee that a process has exactly the right amount of processing time (no cycles stolen behind the scene because an end programmer doesn't have to make any guess work how long a system call takes (cycles to enter interrupt + interrupt handling code) which they don't have any control over). This is really the only practical advantage I see.

Do I think it's worth it? No. Do I think it's possible? Yes.

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Thu Jan 29, 2009 6:38 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
yeah, still going over everything.

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Thu Jan 29, 2009 7:57 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
MessiahAndrw wrote:
with a lock of course (...) it's one possibility of how you could do IPC without system calls


Errmm... and how would you obtain the lock? *cough*


JAL


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Thu Jan 29, 2009 9:32 am 
Offline
Member
Member

Joined: Sun Nov 09, 2008 2:55 am
Posts: 524
Location: Pennsylvania, USA
jal wrote:
MessiahAndrw wrote:
with a lock of course (...) it's one possibility of how you could do IPC without system calls


Errmm... and how would you obtain the lock? *cough*


JAL

If you have shared memory you can implement spinlocks with 'lock bts'. It will chew up most of your processor time, but doing IPC without system calls isn't exactly great for performance to begin with.


Top
 Profile  
 
 Post subject: Re: An OS in design.
PostPosted: Thu Jan 29, 2009 11:33 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
no more without system calls! I'm just going to limit the calls. Anyway, I now have a basic kernel set up, though I'm not getting into the coding until the design is complete. :D =D>

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 46 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group