Commit Graph

9 Commits

Author SHA1 Message Date
Bahadir Balban
260527c0a3 Added utcb create/destroy and better reorganized calls to them. 2009-05-01 17:06:24 +03:00
Bahadir Balban
cada0f8f18 New UTCB implementation almost working.
- KIP's pointer to UTCB seems to work with existing l4lib ipc functions.
- Works up to clone()
- In clone we mmap() the same UTCB on each new thread - excessive.
- Generally during page fault handling, cloned threads may fault on the same page
  multiple times even though a single handling would be enough for all of them.
  Need to detect and handle this.
2009-05-01 10:11:47 +03:00
Bahadir Balban
2d5a08ff32 More progress on parsing elf files. Fixes to memfs file read/write
Increased inode block pointers to 40. The current maximum allowed (and checked).
Updates to file size after every file write ensures subsequent writes can
correctly operate using updated file size information (i.e. not try to add
more pages that are already present). We cannot do this inside write() because
directory writes rely on byte-granularity updates on file buffers, whereas
file updates are by page-granularity (currently).
2008-11-21 19:26:10 +02:00
Bahadir Balban
46937eab88 Added preliminary support for execve(). Updates to clone, fork, exit, task handling.
It turned out we used one version of kmalloc for malloc() and another for kfree()!
Now fixed.
Added parent-child relationship to tasks. Need to polish handling CLONE_PARENT and THREAD.
2008-11-19 12:59:52 +02:00
Bahadir Balban
d182b5b35a Initial changes for execve() support 2008-11-13 21:45:30 +02:00
Bahadir Balban
89d774f7fa Mixed changes
- Added automatic utcb map/prefaulting of forked tasks for fs0
  so that it does not need to explicitly request those tasks from mm0.
  Eliminating fs0 requests to mm0 reduce deadlock possibilities.

- Replaced kmalloc with a public malloc implementation because of a bug in kmalloc.
- Fixed a kfree bug. default_release_pages was trying to free page_array pages.
2008-09-09 13:36:42 +03:00
Bahadir Balban
617d24b4f0 Modified task initialisation so that stack now comes beneath the environment
Environment is backed by a special per-task file maintained by mm0 for each task.
This file is filled in by the env pager, by simple copying of env data into the
faulty page upon a fault. UTCB and all anon regions (stack) could use the same
scheme.

Fixed IS_ERR(x) to accept negative values that are above -1000 for errors. This
protects against false positives for pointers such as 0xE0000000.

	modified:   include/l4/generic/scheduler.h
	modified:   include/l4/macros.h
	modified:   src/arch/arm/exception.c
	modified:   tasks/fs0/include/linker.lds
	modified:   tasks/libl4/src/init.c
	modified:   tasks/libposix/shm.c
	new file:   tasks/mm0/include/env.h
	modified:   tasks/mm0/include/file.h
	new file:   tasks/mm0/include/lib/addr.h
	deleted:    tasks/mm0/include/lib/vaddr.h
	modified:   tasks/mm0/include/task.h
	new file:   tasks/mm0/include/utcb.h
	new file:   tasks/mm0/src/env.c
	modified:   tasks/mm0/src/fault.c
	modified:   tasks/mm0/src/file.c
	modified:   tasks/mm0/src/init.c
	new file:   tasks/mm0/src/lib/addr.c
	modified:   tasks/mm0/src/lib/idpool.c
	deleted:    tasks/mm0/src/lib/vaddr.c
	modified:   tasks/mm0/src/mmap.c
	modified:   tasks/mm0/src/shm.c
	modified:   tasks/mm0/src/task.c
	new file:   tasks/mm0/src/utcb.c
	modified:   tasks/test0/include/linker.lds
2008-02-29 01:43:56 +00:00
Bahadir Balban
d67d6b84a9 Wiring between mm0 page cache and vfs almost what it should look like.
This implements the infrastructure for read/write system calls where
file content is first searched in mm0's page cache and then read-in
or written via the vfs read/write functions.
	modified:   tasks/fs0/src/syscalls.c
	modified:   tasks/mm0/include/lib/bit.h
	modified:   tasks/mm0/include/lib/idpool.h
	modified:   tasks/mm0/include/task.h
	modified:   tasks/mm0/include/vm_area.h
	modified:   tasks/mm0/main.c
	modified:   tasks/mm0/src/devzero.c
	modified:   tasks/mm0/src/fault.c
	new file:   tasks/mm0/src/file.c
	modified:   tasks/mm0/src/init.c
	modified:   tasks/mm0/src/lib/bit.c
	modified:   tasks/mm0/src/lib/idpool.c
	modified:   tasks/mm0/src/task.c
2008-02-18 22:26:39 +00:00
Bahadir Balban
e2b791a3d8 Initial commit 2008-01-13 13:53:52 +00:00