Page 1 of 1

Mattise Kernel: Implemented 16BIT and 32BIT Threading

Posted: Sun Jul 15, 2007 9:17 am
by Kevin McGuire
I have been working on the Mattise kernel with pcmattman, and we have been making a lot of progress together. I was so excited to be working with someone else that I wanted to make a post about the team development success so far.

Implemented 16BIT and 32BIT Threading
The Mattise kernel has 16BIT and 32BIT threading implemented, with a priority scheme. It is still missing a few critical functions and the support for mutual exclusion, sleeping, and synchronization.

The scheduler was written to fit together with the existing kernel infrastructure in such a way that minimal changes would be required. One of the most interesting features is the ability for the scheduler to not have any knowledge about virtual memory except for switching CR3 during thread switches. It uses a neat system of creating a thread in the process which then runs under normal scheduling control to finished loading the process image, or setup the new thread. This removes the constraint of having to deal with scattered memory when doing a manual translation from virtual to physical (copying process image into a different address space than the current).

Implemented Physical Page Allocator
The physical page allocator is implemented using a neat tagging system which is mainly used at the moment to differentiate between legacy memory (below 1MB), and memory above 1MB. This feature was added in the feature branch from the main line and is used when creating 16BIT threads, before a virtual memory implementation is available.

SVN
There is not much to see when compiling the kernel and loading it. It has zero user interactivity at the moment and would serve more as a developmental release for those whom might be interested in taking a look at some of the code -- or even tinkering with the code then compiling.

The current feature branch with the threading implementation; still waiting for a merge with the main line branch. I have made a few changes awaiting revision by pcmattman which make compiling the kernel on Linux a lot easier. Also the feature branch will crash if not using the correct Makefile (See Makefile.linux), because of the testing of the 16BIT threading.
svn co https://mattise.svn.sourceforge.net/svn ... ire/kernel
The main line branch with the physical memory allocator.
svn co https://mattise.svn.sourceforge.net/svn ... nk/kernel/

pcmattman, might have more to add since he has been working on the file system implementation and virtual memory.

Posted: Sun Jul 15, 2007 9:51 am
by Brynet-Inc
Pretty cool stuff.. good luck you two.... (Isn't SVN just fun btw? :lol:)

Posted: Sun Jul 15, 2007 10:06 am
by Kevin McGuire
Brynet-Inc wrote:Pretty cool stuff.. good luck you two.... (Isn't SVN just fun btw? :lol:)
Yeah. I really like it, but I am having trouble sometimes. Like for instance I create a branch.. but I would like to merge from the main line back to my branch any changes including new files. I reorganized the SVN directories like you suggested too, Brynet-Inc - which I think look a lot nicer.

I tried the merge command, but sometimes I think I really do not know what I am doing.. I do it locally like so:


cd /home/kmcguire/pcmattman/svn/mattise/branches/kmcguire/kernel
svn update
// make changes to mine
cd /home/kmcguire/pcmattman/svn/mattise/trunk/kernel
svn update
cd /home/kmcguire/pcmattman/svn/mattise/branches/kmcguire/kernel
svn merge ./ /home/kmcguire/pcmattman/svn/mattise/trunk/kernel ./


Right? Or, is there a easier way or some key points I am missing? The last time I did that it would just drop back to the shell and display no messages just like both directories were the same or something.. :cry:

Posted: Sun Jul 15, 2007 10:33 am
by frank
Have you looked at this page From the SVN Book?

Posted: Sun Jul 15, 2007 11:04 am
by Brynet-Inc
Cool, But you don't have to keep an entire copy of the repository on your system...

You can use SVN switch if you wish...

Imagine your working directory was:

Code: Select all

/home/kmcguire/svn/mattise/kernel
When working on your branch you could do:

Code: Select all

svn switch https://mattise.svn.sourceforge.net/svnroot/mattise/branches/kmcguire/kernel
And when you want to switch back:

Code: Select all

svn switch https://mattise.svn.sourceforge.net/svnroot/mattise/trunk/kernel
When you feel your branch is ready for a merge, you could do the following:

Code: Select all

svn switch https://mattise.svn.sourceforge.net/svnroot/mattise/trunk/kernel

Code: Select all

svn merge https://mattise.svn.sourceforge.net/svnroot/mattise/trunk/kernel https://mattise.svn.sourceforge.net/svnroot/mattise/branches/kmcguire/kernel
You can then commit... The link frank posted is also valuable..

Posted: Sun Jul 15, 2007 12:26 pm
by Kevin McGuire
Hmm. Let me think about this, and read.. The switch looks interesting.

Posted: Mon Jul 16, 2007 12:36 am
by pcmattman
Just felt like adding this...

I'm in the progress of adding paging support to the kernel which will complement Kevin's changes perfectly. Expect to see me ask some stupid questions over the next couple of weeks :D

Posted: Thu Jul 19, 2007 2:44 am
by pcmattman
Paging is implemented! It's a basic implementation so far, but I've been able to run two different processes in different address spaces.