OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Oct 30, 2020 8:21 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Simple Scheduler
PostPosted: Mon Apr 20, 2015 2:26 pm 
Offline
Member
Member

Joined: Thu Dec 16, 2010 3:08 pm
Posts: 36
I am implementing the simplest task manager I could imagine. It is designed around the general idea of my OS; keeping it simple, and conserve memory.

I am not using paging. Only Segmentation (protected mode). The philosophy is that everything is a service. This could be a process, data, a stack, a window (and keyboard buffer) etc.
All services has an ID: SID. The SID is an index into an imaginary table called the GXT. The GXT is the combination of the GDT and the GST (global service table). The GST functions as an extension for the GDT, so that you can store more information about a service than allowed by the GDT (Name, Extension, Type, Size, Parent ID (If PID=SID you've found a root service), base and segments in memory). GDT and GST are always updated through the GXT system calls, so that you cannot change the size of a service in GDT, without changing it in the GST.

For processes the GXT also contains the ESP and SS for the current stack. Now when receiving INT0, the OS just saves the state on stack, finds the next PID in queue, loads ESP and SS, pops state from stack, and IRETs. No priorities. No sleeping tasks. Simple.

_________________

Daniel Broder Jensen
UNICORN OS


Top
 Profile  
 
 Post subject: Re: Simple Scheduler
PostPosted: Mon Apr 20, 2015 8:24 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

danielbj wrote:
I am implementing the simplest task manager I could imagine. It is designed around the general idea of my OS; keeping it simple, and conserve memory.


Don't forget that "simple" is often the opposite of "good".

For example, by not using paging you're going to have to waste a lot of RAM and won't be able to conserve memory.

For example, by not having a sleeping tasks those tasks will loop until time has passed and waste a massive amount of CPU time.

For example, by not having task priorities the user will press a key and then spend 12 years waiting for the OS to respond because the CPU is busy executing unimportant things (like all those tasks that are looping until time has passed).

Mostly I can't understand why you're writing an OS in the first place. You're not going to learn how to write an OS by avoiding everything that's relevant, and no real users are likely to want to use something like that either.


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.


Top
 Profile  
 
 Post subject: Re: Simple Scheduler
PostPosted: Tue Apr 21, 2015 3:34 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1067
Location: Germany
Actually, trying to avoid standard practice often does teach you a lot. In most cases it just teaches you why the thing you wanted to avoid is in fact standard practice, and you'll learn it the hard way, but in the end I guess it gives you a better understanding of the problem at hand than avoiding mistakes by just doing what everyone else does.

Now I'm not sure if this is what you want, Daniel, but my prediction is that if you implement this, you'll learn a lot. ;)

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 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