Dynamo Kernel v0.3.1 in C++

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
senaus
Member
Member
Posts: 66
Joined: Sun Oct 22, 2006 5:31 am
Location: Oxford, UK
Contact:

Dynamo Kernel v0.3.1 in C++

Post by senaus »

Hey everyone, I'd like to announce the third release of my kernel! It has been a long six months of development, and now I have finally reached the 'stop' point, so to speak.

From the user's perspective, not much is going on with this kernel. I've added support for virtual consoles, which seem to work rather well. Most of the action is going on under the hood, however.

I've converted most of the code to C++, and I make rather heavy use of classes and such. The source should prove useful to anyone looking to develop a kernel in C++, or any other OO language.

The kernel also provides support for 'service calls', which are sort of like APCs/DPCs in Windows NT. The only use for these at the moment is the user-mode page fault handler, which is demonstrated by this release.

You can find the source and floppy image here:
http://sourceforge.net/project/showfile ... _id=151015

Also, a few notes about my design can be found on my wiki:
http://dyknl.sf.net/wiki

Thanks for reading,
Senaus

Code: Select all

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/MU d- s:- a--- C++++ UL P L++ E--- W+++ N+ w++ M- V+ PS+ Y+ PE- PGP t-- 5- X R- tv b DI-- D+ G e h! r++ y+
------END GEEK CODE BLOCK------
viki
Posts: 14
Joined: Tue May 08, 2007 11:57 am
Location: Poland

Post by viki »

Hi, I can't get sources from this location.
senaus
Member
Member
Posts: 66
Joined: Sun Oct 22, 2006 5:31 am
Location: Oxford, UK
Contact:

Post by senaus »

viki wrote:Hi, I can't get sources from this location.
Did you try a different mirror? You can view the latest source via SVN at this address:

http://dyknl.svn.sourceforge.net/viewvc/dyknl/trunk/

Thanks,
Senaus

Code: Select all

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/MU d- s:- a--- C++++ UL P L++ E--- W+++ N+ w++ M- V+ PS+ Y+ PE- PGP t-- 5- X R- tv b DI-- D+ G e h! r++ y+
------END GEEK CODE BLOCK------
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

I've converted most of the code to C++, and I make rather heavy use of classes and such. The source should prove useful to anyone looking to develop a kernel in C++, or any other OO language.
I'm interested, I'm in the middle of a conversion...
senaus
Member
Member
Posts: 66
Joined: Sun Oct 22, 2006 5:31 am
Location: Oxford, UK
Contact:

Post by senaus »

Yes, it was your conversion that inspired me! It all went smoothly, but i was rewriting most of it anyway :)

Code: Select all

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/MU d- s:- a--- C++++ UL P L++ E--- W+++ N+ w++ M- V+ PS+ Y+ PE- PGP t-- 5- X R- tv b DI-- D+ G e h! r++ y+
------END GEEK CODE BLOCK------
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

I've done the same thing. I much prefer the feel of my kernel code in C++. The only thing that I have left 'C style' is my memory manager. Everything else has gone OO.

My SVN source tree is still a mess though :oops: ...
senaus
Member
Member
Posts: 66
Joined: Sun Oct 22, 2006 5:31 am
Location: Oxford, UK
Contact:

Post by senaus »

Same here, my scheduler, context switching & kernel memory manager are all still in C, for simplicity's sake. I used my changeover from CVS to SVN to sort out my tree :wink:

Code: Select all

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/MU d- s:- a--- C++++ UL P L++ E--- W+++ N+ w++ M- V+ PS+ Y+ PE- PGP t-- 5- X R- tv b DI-- D+ G e h! r++ y+
------END GEEK CODE BLOCK------
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

At the risk of getting in to a C vs. C++ war, I was concerned about moving my scheduler over to start with too, but classes made it so much neater (this may be because I am used to OO, so my non-oo style could just be messy!).

Now I have an exefile class which loads all relocation information from a binary. This class can be used to seed a Task class, which sets up the memory space for the exe file and calls a Relocate() function in the exefile class. This means that task addition goes something like:

Code: Select all

scheduler.AddTask(new Task(new Exefile(fileptr*)));
Where fileptr is the unrelocated executable in memory. Some people may not like this but it looks neat and maintainable to my eyes.

Certainly I agree that the memory manager does not necessarily suit class-based programming.

Adam
senaus
Member
Member
Posts: 66
Joined: Sun Oct 22, 2006 5:31 am
Location: Oxford, UK
Contact:

Post by senaus »

I don't see the difference between 'scheduler.AddTask()' and 'QueueThread()' for a single processor. The OO method would be cleaner if you had a separate queue for each CPU, e.g cpu[1].AddTask().

My classes wrap the lower level functions, so I can do:

Code: Select all

tThreadRef thread = new cThread();
thread->Wake();
Which will call the following internally:

Code: Select all

kQueueThread(&(this->NanoThread));
At the moment, my scheduler only has two routines (kDoSchedule() and kQueueThread()), so OO seems like overkill!

Cheers,
Senaus

Code: Select all

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/MU d- s:- a--- C++++ UL P L++ E--- W+++ N+ w++ M- V+ PS+ Y+ PE- PGP t-- 5- X R- tv b DI-- D+ G e h! r++ y+
------END GEEK CODE BLOCK------
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

What compiler are you using? I'm using DJGPP but templates don't work in it, which is really frustrating because I wrote a linked list class to save writing the same code over and over again. Unfortunately, it doesn't work...

Did you just make a cross-compiler in Cygwin?
senaus
Member
Member
Posts: 66
Joined: Sun Oct 22, 2006 5:31 am
Location: Oxford, UK
Contact:

Post by senaus »

I'm just using native GCC on Kubuntu Linux. Works a treat for me so far :)

Cheers,
Senaus

Code: Select all

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/MU d- s:- a--- C++++ UL P L++ E--- W+++ N+ w++ M- V+ PS+ Y+ PE- PGP t-- 5- X R- tv b DI-- D+ G e h! r++ y+
------END GEEK CODE BLOCK------
Post Reply