Commit Graph

802 Commits

Author SHA1 Message Date
Bahadir Balban
0be7b734d3 Amendment to previous commit 2009-11-11 15:56:54 +02:00
Bahadir Balban
bee7fe541f cleaned up posix example cml symbols 2009-11-11 15:54:34 +02:00
Amit Mahajan
d8f480fd1b Compilation errors resolved for 2009Q3 toolchains. 2009-11-11 02:02:27 +05:30
Amit Mahajan
fc43608da9 Error in number of containers corrected 2009-11-11 02:02:26 +05:30
Amit Mahajan
276b6e3fc4 Sanity checking for container memory regions added 2009-11-11 02:02:26 +05:30
Amit Mahajan
1db70a608f Added default values to cml symbols 2009-11-11 02:02:26 +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
Amit Mahajan
272b01d873 Remove CONFIG_ from pager_size symbol 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
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
d43fa1d3ae Simplified cap id finding and destroying it.
It is not very straightforward to reach a capabilities list. We
now use a single function to find out a capability by its id and
its list, since the two are used frequently together (i.e. cap
removal and destruction)
2009-11-09 23:50:03 +02:00
Bahadir Balban
ff14ce4735 Added switch statements to some capability checks that are more precise. 2009-11-09 23:10:44 +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
8b12db741f Moved generic ipc flags to api/ipc.h 2009-11-09 22:01:44 +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
Bahadir Balban
f7565118f1 Revert "Merge branch 'libl4thread' of git://www.b-labs.co.uk/bora/git/codezero into bora"
This reverts commit 3f870b540f.
2009-11-05 19:17:36 +02:00
Bahadir Balban
e28658c10e posix: MM0 task page access issues fixed. 2009-11-05 19:04:19 +02:00
Bahadir Balban
d306d6b451 posix: Fixing mm0 mapping task pages incorrectly
Modifying task_virt_to_page() so that it takes into account page
protections. If mm0 writes to a task page that is meant to be
read-only, (e.g. the zero page) the design is broken.

Every access to a task's page will take the page fault route,
and the page fault handler will return the page instead of 0.
2009-11-05 18:25:26 +02:00
Bora Sahin
52587141f4 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-05 16:19:39 +02:00
Bahadir Balban
35a5dc4c92 Added userland support for exregs/read, mm0 slightly more graceful for illegal access 2009-11-05 15:56:01 +02:00
Bahadir Balban
3f870b540f Merge branch 'libl4thread' of git://www.b-labs.co.uk/bora/git/codezero into bora 2009-11-05 14:59:59 +02:00
Bahadir Balban
78635bdd11 posix: When mapping a new task, data segment size was miscalculated 2009-11-05 14:10:22 +02:00
Bahadir Balban
74ad567312 Added err value to vma_split 2009-11-05 13:52:39 +02:00
Bora Sahin
55af5c83cb 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 questen has to be already mapped-in. There is some basic
infrastructure for utcb to support mapping but it is far from being complete.
MAPPING_ENABLE symbolic constant controls this behaviour.

There are also some minor fixes for the stack support and the utcb common helper
routines.
2009-11-05 13:51:22 +02:00
Bora Sahin
352cb2daaa 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-05 13:50:48 +02:00
Bora Sahin
8585482bd0 THREAD_RESUME is an alias to THREAD_RUN. 2009-11-05 13:48:58 +02:00
Bahadir Balban
9b71f2bfe2 Fix for mm0 bss mapping of zero pages starting from wrong offset
bss segment may have some of it at the end of data, but the bits
that lie on a new page need to be mmaped as anonymous. When this
occured we were not passing the new page boundary but the last
data page where bss started
2009-11-05 13:43:38 +02:00
Bora Sahin
ede050ad37 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-05 12:39:29 +02:00
Bora Sahin
4bfd339db5 libl4thread skeleton is introduced.
With this library, it is aimed at easing thread manipulation, utcb handling etc.
2009-11-05 12:37:19 +02:00
Bora Sahin
1f7711fa2a Automatic pager size calculation takes container name into account instead of
a fixed one.
2009-11-05 12:23:01 +02:00
Bora Sahin
050f537884 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-05 12:17:37 +02:00
Bahadir Balban
425193efa9 Added a flag to read registers back for sys_exregs call 2009-11-05 11:27:29 +02:00
Bahadir Balban
fd04e9d460 Added helper to extract raw thread id from fully qualified thread id
Currently, the tid returned from kernel contains container id as
well, which makes it sufficient to do inter-container syscalls without
any preparation.

The helpers added are for presentation purposes only. Container id
is deleted so that the raw thread id is available for printing or
similar.
2009-11-05 01:47:04 +02:00
Bahadir Balban
d9520adb55 Added means to search for threads in other containers
Thread ids now contain their container ids in the top 2 nibbles.
Threads on other containers can be addressed by changing those
two nibbles. The addressing of inter-container threads are
subject to capabilities.
2009-11-04 20:56:57 +02:00
Bahadir Balban
516efccd99 Merge branch 'master' into devel 2009-11-04 17:19:18 +02:00
Bahadir Balban
aeef546544 Changed l4id_t type to unsigned integer. Expanded task_ids to have cid
Task ids are now unsigned as the container ids will need to be encoded
in the id fields as well.

For requests who require even more comprehensive id input, (such as
thread creation) also added is the container id so that threads
_could_ potentially be created in other containers as well.
2009-11-04 16:39:04 +02:00
Bahadir Balban
db57c598b0 Merged MAP and VIRTMEM/PHYSMEM capabilities into one.
VIRTMEM and PHYSMEM are theoretically separate resources to be
protected than a MAP resource, which is meant to protect the syscall
privileges.

In practice MAP is always used together with a VIRTMEM and a PHYSMEM
resource, therefore reach VIRTMEM/PHYSMEM resource is now merged with
the MAP capability, combining the micro-permission bits.
2009-11-04 15:26:47 +02:00