46 Commits

Author SHA1 Message Date
Bahadir Balban
6fa4884a5a Changes since April
Clean up of build directories.
Simplifications to capability model.
2010-06-01 15:08:13 +03:00
Amit Mahajan
ab728dd1d5 Added separate toolchains for userspace and kernel. 2010-03-30 20:15:39 +05:30
Bahadir Balban
74b5963fcb Kernel updates since December 2009 2010-03-25 01:12:40 +02:00
Bahadir Balban
2908c40816 Undefined instruction handling/ipc revised, tests added, cleaned up. 2009-12-04 15:22:56 +02:00
Bahadir Balban
93dc1ed49e Merge branch 'undeftest' of git://git.l4dev.org/~prem/codezero into prem 2009-12-04 14:11:06 +02:00
Bahadir Balban
21545152c8 Fixed false positive mmap return value error checks.
Normally a pointer with its topmost bits set may cause false errors
due to the fact that such pointers result in negative integer casts.

The remedy is to use IS_ERR() macro that accepts only down to -1000
as error and any values below as valid.
2009-12-04 13:34:14 +02:00
Amit Mahajan
a185985fe5 Example cml files updated for new default memory region assignments 2009-12-04 11:08:54 +05:30
Prem Mallappa
8656bf02ce Undef graceful handling 2009-11-20 13:12:04 +05:30
Prem Mallappa
173ddeb617 Graceful handling of Undefined instruction 2009-11-20 00:36:09 +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
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
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
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
e28658c10e posix: MM0 task page access issues fixed. 2009-11-05 19:04:19 +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
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
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
Amit Mahajan
a41a8e0d93 Some cleanup in uart fixes. 2009-11-02 21:52:33 +05:30
Amit Mahajan
91c617d0b2 Removed hard coded values of toolchain and gcc cpu flags 2009-11-02 21:29:54 +05:30
Bahadir Balban
a3a90530df Fixed a few minor issues. 2009-10-18 16:16:32 +03:00
Bahadir Balban
7ba7a2e796 Added a simplified ascii_to_int() implementation.
Removed dependency on hard-coded pager id. Pager id is now passed
as an environment string `pagerid' to tasks. Alternatively, this
could take space in the utcb of each task.
2009-10-17 18:48:30 +03:00
Bahadir Balban
d19c5c26fd Removed hard-coded area definitions from kernel 2009-10-17 13:42:49 +03:00
Bahadir Balban
fc95d95454 Made necessary changes to make test0 link at an adjustable address 2009-10-17 13:24:26 +03:00
Bahadir Balban
381405ee8e Incorporated means to specify shared memory, task address space and utcb regions to posix container 2009-10-15 20:10:08 +03:00
Bahadir Balban
3a3204986e read_cache_pages() also working copied from write_cache_pages()
- Need to remove old versions
- Need to merge the two.
- Need to investigate occasional page fault on NMOP sequence. (resembles an error ipc_extended test)
  Could be related to new page cache read/write routines.
2009-10-14 01:48:05 +03:00
Bahadir Balban
ee2bf8e7f3 Write cache pages seems to work OK. 2009-10-14 00:36:01 +03:00
Bahadir Balban
0cd5091132 Moved user buffer access functions to user.c 2009-10-13 19:11:14 +03:00
Bahadir Balban
38ac9052c0 Few minor fixes 2009-10-13 13:51:30 +03:00
Bahadir Balban
a249105969 Integrated vm_files with vnodes. execve is not working as expected. 2009-10-13 11:33:25 +03:00
Bahadir Balban
f54747a208 All posix tests running as before. 2009-10-10 00:23:13 +03:00
Bahadir Balban
d39ffc6acd Fixed utcb updating issue that was a significant burden.
Any thread that touches a utcb inside the kernel now properly checks
whether the utcb is mapped on its owner, and whether the mapped physical
address matches that of the current thread's tables. If not the tables
are updated.

This way, even though page tables become incoherent on utcb address
change situations (such as fork() exit(), execve()) they get updated
as they are referenced.

Since mappings are added only conditionally, caches are flushed only
when an update is necessary.
2009-10-09 16:45:10 +03:00
Bahadir Balban
7e38e70f93 Added conditional configuration flag -c to build.py 2009-10-08 19:07:59 +03:00
Bahadir Balban
d888267f58 Fixed the error that dirent structure was not matching userland structure. 2009-10-08 18:37:43 +03:00
Bahadir Balban
96cd0949b6 Correct placement of arguments and environment on stack.
int main(int argc, char *argv[])

style main function works now on Codezero/POSIX.
2009-10-07 19:17:24 +03:00
Bahadir Balban
8a55a80c23 Fixed lots of issues with mm0 initialization, final one was an oversized do_munmap.
test0 now successfully runs its beginning.
test0 SConscript has a dependency problem.

Issues to be investigated:
- vm_file and vnodes need to be merged fully in all functions.
- libposix shared page references need to be removed.
- Any references to VFS_TID, PAGER_TID need to be removed.
2009-10-06 21:12:45 +03:00
Bahadir Balban
ea9c399dda Progress on executing test0 from memfs file as an elf.
Elf is recognised OK, but somehow section table is not read correctly.
2009-10-06 18:30:36 +03:00
Bahadir Balban
e5cde20ca9 Fixed a fault with posix tasks not getting their LMA correctly 2009-10-01 13:13:27 +03:00
Bahadir Balban
7ca634450b Added inclusion of test_exec binary to test0 2009-09-30 23:45:19 +03:00
Bahadir Balban
748d6734c3 We now have a correctly compiling (but untested) posix container build. 2009-09-30 18:37:51 +03:00
Bahadir Balban
1aa31bc9d5 We have all posix programs getting compiled.
A lot of hassles on standard c library, mock-up libc, and libposix
headers taken from uClibc clashing has been worked around.

Next:
 - Linker scripts need fixing and adjusting.
 - Bootdesc needs to be generated.
 - Per-container compilation scripts need connecting.
2009-09-29 23:06:29 +03:00
Bahadir Balban
f0bb0a4657 Added posix code 2009-09-29 21:55:59 +03:00