Commit Graph

184 Commits

Author SHA1 Message Date
Bahadir Balban
a4176fe837 Merge branch 'master' of git://www.b-labs.co.uk/amit/git/codezero into amit
Conflicts:
	conts/posix/mm0/mm/task.c
2009-11-20 00:20:52 +02:00
Bahadir Balban
688936f541 Merge branch 'master' into devel 2009-11-20 00:18:45 +02:00
Amit Mahajan
e2c2f1f2b1 Building baremetal containers in build directory 2009-11-20 00:19:51 +05:30
Amit Mahajan
8a7b9dbcdf Integrated Test Container inside Baremetal container. 2009-11-20 00:06:03 +05:30
Amit Mahajan
352d75f66c Name of example container changed to Baremetal 2009-11-19 23:26:00 +05:30
Amit Mahajan
1384701a53 Corrected value assignment error in stack_used variable 2009-11-19 21:32:16 +05:30
Amit Mahajan
f5faa71e89 Libdev added in example0 2009-11-19 21:27:49 +05:30
Amit Mahajan
9bd5bd889f Prevent recompilation of libdev 2009-11-19 21:18:33 +05:30
Bahadir Balban
351c986b73 Fixed a minor issue with mm0 mm/task.c local variable initialization 2009-11-19 17:29:08 +02:00
Bahadir Balban
3f1045d66e Merge branch 'master' of git://www.b-labs.co.uk/bora/git/codezero into bora
Conflicts:
	config/cml/container_ruleset.template
	config/configuration.py
	conts/examples/example1/SConstruct
	conts/libl4thread/include/l4thread/thread.h
2009-11-19 14:41:07 +02:00
Bahadir Balban
b6df4238b7 Merge branch 'libl4thread' of git://www.b-labs.co.uk/bora/git/codezero into bora
Conflicts:
	conts/libl4thread/src/arch-arm/new_thread.S
	conts/libl4thread/src/idpool.c
2009-11-19 11:17:51 +02:00
Bahadir Balban
51a12a507f Error recovery fixes to mm0 and l4_map_helper 2009-11-18 10:55:53 +02:00
Bahadir Balban
89093b8ace Inter-container ipc tests working. 2009-11-17 23:34:37 +02:00
Bora Sahin
496fba81c8 A shared space multi-threaded example application presenting the use of the
thread library. It also exemplifies how a new sample application can be added.
2009-11-17 21:48:46 +02:00
Bora Sahin
a5eede8fb9 The very same fix we applied to the thread library but for posix this time. 2009-11-17 12:05:56 +02:00
Bora Sahin
682c62f8bb A fix and a helper macro for the thread library.
The fix solves the problem of giving the last slice from a pool.

The helper macro makes utcb space creation easy for the user because we have to
consider a few things like alignment and total allocated space.
2009-11-16 21:49:37 +02:00
Bora Sahin
58959d5fb0 A comprehensive overhaul on the thread library.
Lots of polishing, organizational changes, bug fixes, error handling etc. are
introduced.

COPY and NEW space thread creation are allowed but not thoroughly tested yet. It
seems they will work best if the lib supports utcb virtual range management
through the mapping.
2009-11-13 15:37:22 +02:00
Bora Sahin
743034a36b A comprehensive overhaul on the thread library.
Lots of polishing, organizational changes, bug fixes, error handling etc. are
introduced.

COPY and NEW space thread creation are allowed but not thoroughly tested yet. It
seems they will work best if the lib supports utcb virtual range management
through the mapping.
2009-11-13 15:35:45 +02:00
Bora Sahin
9763296ddc Locking is added to the thread library.
Now, we support thread trees which are spanning more than one level depth. Any
thread can create any number of threads provided that they are under the limits
which are enforced by the kernel.

Also with this commit, we have almost finished supporting SHARED space thread
creation in which stack and utcb space are allocated statically.
2009-11-13 15:22:06 +02:00
Bora Sahin
c8a55f8834 Stack recycling is added to the thread library.
Still, it does not support thread trees which have more than one level depth.
2009-11-13 15:21:53 +02:00
Bora Sahin
344362e9da Task list is introduced to the thread library.
In order to do resource recycling we need a table structure. In the search of
one, we concluded that a task list will make things easier when we start adding
COPY and NEW space handling.

This commit is for utcb recycling. Now, it does not support thread trees more
than one level depth. Thus, to be able to test it, we preferred l4thread_destroy
instead of l4thread_exit.
2009-11-13 15:21:41 +02:00
Bora Sahin
20f2b2bfdb Lots of cosmetic changes to the thread library. 2009-11-13 15:21:28 +02:00
Bora Sahin
1256f1a13a The second step in creating a thread library.
UTCB support has beed added. It has the same drawback as in the stack support:
the area in question has to be already mapped-in.

There are also some minor fixes for the stack support and the utcb common helper
routines.
2009-11-13 15:21:15 +02:00
Bora Sahin
b31ab82437 The first step in creating a thread library.
The difference between this thread library and the existing ones like pthreads
is the necessity of informing the library about the address range of the stack
and the l4 specific utcb. Utcb has not been supported yet. As for stack, there
is also a drawback: library does not support mapping. In other words, the stack
area in question has to be already mapped-in. Thus, for now we only support
threads sharing their address spaces: TC_SHARE_SPACE. In this respect, it is
very similar to pthreads.
2009-11-13 15:20:50 +02:00
Bora Sahin
18a5c89c97 utcb handling helper routines for the thread library.
This is one of the steps we need in the process of providing a similar interface
for thread creation which can be found in the mainstream operating systems like
Linux.
2009-11-13 12:59:27 +02:00
Bora Sahin
00adcd9afa libl4thread skeleton is introduced.
With this library, it is aimed at easing thread manipulation, utcb handling etc.
2009-11-13 12:58:54 +02:00
Bora Sahin
bb6dd492e0 Bare container type is converted to Examples container type.
Examples container type is designed to keep applications using codezero
userspace libraries, which is aiming to help newcomers who would like to
develop programs on top of the l4 microkernel.

Now bare bone application is one of the examples. In the near future, lots of
new programs will be introduced to show the various aspects of codezero
eco-system.
2009-11-13 12:57:40 +02:00
Bora Sahin
871d40a6b4 Trying to fix merge / revert problems related to the thread library.
Revert "Merge branch 'libl4thread' of git://www.b-labs.co.uk/bora/git/codezero into bora"

This reverts commit dc7fd0d24d.
2009-11-13 12:32:33 +02:00
Bahadir Balban
317ce0bd29 Minor fixes to container cml template 2009-11-11 23:11:10 +02:00
Bora Sahin
0e6dec0fee Locking is added to the thread library.
Now, we support thread trees which are spanning more than one level depth. Any
thread can create any number of threads provided that they are under the limits
which are enforced by the kernel.

Also with this commit, we have almost finished supporting SHARED space thread
creation in which stack and utcb space are allocated statically.
2009-11-11 21:33:15 +02:00
Amit Mahajan
d8f480fd1b Compilation errors resolved for 2009Q3 toolchains. 2009-11-11 02:02:27 +05:30
Amit Mahajan
c44d25b596 Taking UART code out from libc and loader and putting in libdev 2009-11-11 02:02:26 +05:30
Bahadir Balban
4ab05d1b2a Added forgotten file
new file:   src/capability.c
2009-11-10 22:23:49 +02:00
Bahadir Balban
34a1c581a3 Added forgotten header 2009-11-10 22:21:19 +02:00
Bora Sahin
3149356ffc Stack recycling is added to the thread library.
Still, it does not support thread trees which have more than one level depth.
2009-11-10 21:48:48 +02:00
Bahadir Balban
dc7fd0d24d Merge branch 'libl4thread' of git://www.b-labs.co.uk/bora/git/codezero into bora
Conflicts:
	conts/libl4thread/include/l4thread/addr.h
	conts/libl4thread/include/l4thread/thread.h
	conts/libl4thread/include/l4thread/utcb.h
	conts/libl4thread/src/addr.c
	conts/libl4thread/src/thread.c
	conts/libl4thread/src/utcb.c
2009-11-10 17:38:51 +02:00
Bahadir Balban
d1bd77a135 Removed cap list prints from mm0 2009-11-10 17:22:46 +02:00
Bahadir Balban
2ba4736a8b Cleaned up various bits with capability syscalls.
Made grant interace same as other calls.
Corrected counting and reading of task capabilities by applying it
to all cap lists that a task has right.
2009-11-10 16:15:14 +02:00
Bora Sahin
a23b7fcbc2 Task list is introduced to the thread library.
In order to do resource recycling we need a table structure. In the search of
one, we concluded that a task list will make things easier when we start adding
COPY and NEW space handling.

This commit is for utcb recycling. Now, it does not support thread trees more
than one level depth. Thus, to be able to test it, we preferred l4thread_destroy
instead of l4thread_exit.
2009-11-10 14:46:54 +02:00
Bahadir Balban
f912f28731 Clarified a few confusing definitions in ipc.c 2009-11-09 22:59:24 +02:00
Bahadir Balban
da8b0a90f3 Fixed error with ipc transfer type checking.
Tested test0 mutex ipc successfully rejecting to occur when given
different micro-capabilities than the actual transfer type.
2009-11-09 22:50:21 +02:00
Bahadir Balban
78917835c7 Substantially fixed cap_split() behaviour.
Need to fix ipc flags capability checking yet.
2009-11-09 19:15:52 +02:00
Bora Sahin
8f55e72f00 Lots of cosmetic changes to the thread library. 2009-11-09 11:44:52 +02:00
Bahadir Balban
b24c8eb89d Capability replicate/split/destroy/grant working for test0 ipc.
Implemented a protocol between a client and its pager to
request and get a capability to ipc to another client of the pager.

Pager first ensures the request is valid from its client.
It then tries to use a greater capability that it possesses, to
produce a new capability that the client requested. Once the kernel
validates the correct one and replicates/reduces it to client's
need, it grants it to the client.
2009-11-09 00:40:07 +02:00
Bahadir Balban
1bb2c05c9b Added routines for pager to search a suitable capability to grant to clients
Pager handles client capability requests by using one of its own
capabilities to create a new one that suits the client's needs.

The current issue is that the kernel can have multiple caps and it
may not know which one is suitable for using to create one for the client.

The kernel knows this very well, so the solution would be to attempt to
use capabilities that roughly match (i.e. by type) and leave it to
the kernel to decide whether it is any powerful to suit client's needs.
2009-11-08 17:54:57 +02:00
Bahadir Balban
dc03c7b130 Implemented a protocol between client and pager for requesting caps.
In posix, test0 makes inter-space ipc for testing extended ipc. This
correctly fails when only the cap to ipc to pager is given to all tasks
in the container.

In order to overcome this problem, the tasks who fork for doing ipc to
each other make a request to the pager to get capabilities to do so.

Pager finds its own widened ipc capability over the container, replicates
it, validates and reduces it to desired boundaries (i.e. just ipc betw.
two spaces) and grants it as IMMUTABLE to requesting tasks.

This protocol may be useful in implementing a client/server capability
request relationship. Code builds but untested.
2009-11-08 14:15:33 +02:00
Bahadir Balban
b136b79a2d Capability replicate/deduce/share tested with mm0. 2009-11-07 23:45:57 +02:00
Bahadir Balban
e8f002f879 Fixed most of userspace (mm0) for capability manipulation 2009-11-07 19:43:05 +02:00
Bahadir Balban
e8f9f3f04a Added generic capability operation bits to autogenerated capabilities
cinfo.c generator script now has generic capability operation
bits added to all default capabilities that it generates.
2009-11-07 16:14:14 +02:00
Bahadir Balban
3728e7ef1e Capability manipulation syscalls
Support for capability replicate, share, grant, deduce, and split.
The code builds, but hasn't been tested.
2009-11-07 15:29:52 +02:00