Commit Graph

59 Commits

Author SHA1 Message Date
Bahadir Balban
b950ec323d Removed object files that were tracked by mistake. 2009-05-17 20:54:26 +03:00
Bahadir Balban
40e088b042 Modifications towards full ipc
- Added a full ipc send/recv test
- Removed non-zero value checking in r2 for ipc that was there
  to catch inadvertent full ipc calls.
- Added correct hanlding for read/write mrs for current status of utcb.

TODO:
- Add mapping of every utcb to every task for privileged access so that
  the kernel can access every utcb without switching spaces.
- Removal of same mappings
- Upon thread creation need to copy page tables accordingly i.e.
  each task will have its own utcb mapped with USER access, but every
  other utcb as kernel access only. Need to handle this case upon page
  table copying.
2009-05-17 20:49:13 +03:00
Bahadir Balban
93368447f9 Added kernel + libl4 changes for full and extended ipc.
- Short ipc working as normal. Full/extended ipc haven't been tested.
- Added automated compilation and inclusion of test executable in test0.
2009-05-15 19:14:40 +03:00
Bahadir Balban
ae50823599 Elf file checking - Added the test that data and text are at least a page apart. 2009-05-13 16:37:08 +03:00
Bahadir Balban
2c01463482 In FS0 filesystem image buffer was smaller than the memfs-defined maximum.
- Now fs size is in sync with memfs max size.
2009-05-13 16:09:20 +03:00
Bahadir Balban
33fcceb2b6 Added a shared memory test.
- libposix error printing now configurable via macro definition
- shmget/at/dt tested.
2009-05-12 18:16:25 +03:00
Bahadir Balban
324481a334 Some more enhancements to test0
- Only the topmost parent prints pass messages. Any failed child can print fail message.
- Added testing of 16 forked threads doing file create/read/write/close and
  16 forked x 4 cloned = 64 threads spawning/exiting
2009-05-12 12:31:25 +03:00
Bahadir Balban
8528e2e1ba Modified the kernel and all tasks with well-formatted printout messages. 2009-05-12 11:25:14 +03:00
Bahadir Balban
97bfd3bb9b Fixed error escalation in thread_create() and its function calls. 2009-05-01 22:39:31 +03:00
Bahadir Balban
7a81db8782 Ongoing work for adding per-thread UTCB structures.
Added setting of utcb address to l4_thread_control.
This is going to be moved to exchange_registers() since we need to pass
both the utcb physical and virtual address and exregs fits such context
modification better than thread_control.
2009-04-29 16:53:04 +03:00
Bahadir Balban
8d82fa5f5e Removed execve() test. 2009-04-18 09:47:48 +03:00
Bahadir Balban
9123eb49a8 execve working from vfs executable file along with clone/fork/exit 2008-12-02 18:29:40 +02:00
Bahadir Balban
32b3dfe91d Fixed various faults with execve().
Added a new ordered task_insert_vma() function
2008-12-02 14:15:40 +02:00
Bahadir Balban
a9e6aabcae We can now successfully copy char *argv[] user array.
After a lot of magic pointer arithmetic and mapping.
2008-11-25 11:05:41 +02:00
Bahadir Balban
d0e878b32c Added detailed mapping of bss.
.data and .text now needs to be 4K apart.
removed an early copy of test0 called test1
2008-11-23 21:27:11 +02: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
d182b5b35a Initial changes for execve() support 2008-11-13 21:45:30 +02:00
Bahadir Balban
44c34026b2 clone() call working. Tested exit(), clone() and fork() mixture running about 22 threads, processes. 2008-11-10 17:58:33 +02:00
Bahadir Balban
9a9b8d2701 Added a clone() test to test0. 2008-11-10 12:51:01 +02:00
Bahadir Balban
1ddd7ac9c2 Removed vm_object printfs that were for testing exit().
File open was failing when using 2 files with same name. TODO: Look at it in the future.
Need to increase writeable file size in fs0. 16 pages don't work.
2008-11-07 16:26:07 +02:00
Bahadir Balban
f87f3cd5d2 Fixed libposix munmap call where we used the MMAP tag. 2008-11-07 15:18:43 +02:00
Bahadir Balban
ca8959eee0 Added new routines that map and check the validity of user buffers.
mmap uses this mechanism to get arguments. It needs to be tested.
2008-11-03 11:27:10 +02:00
Bahadir Balban
ec863f5521 Removed exit printfs from mm0 and fs0 2008-10-22 16:46:22 +03:00
Bahadir Balban
aa2be891cd exit() almost there.
- Implemented reasonable way to suspend task.
  - A task that has a pending suspend would be interrupted
    from its sleep via the suspender task.
  - If suspend was raised and right after, task became about to sleep,
    then scheduler wakes it up.
  - If suspend was raised when task was in user mode, then an irq suspends it.
  - Also suspends are checked at the end of a syscall so that if suspend was
    raised because of a syscall from the task, the task is suspended before it
    goes back to user mode.

  - This mechanism is very similar to signals, and it may lead as a base for
    implementing signal handling.

- Implemented common vma dropping for shadow vm object dropping and task exiting.
2008-10-20 12:56:30 +03:00
Bahadir Balban
f6d0a79298 New scheduler and interruptible blocking.
A new scheduler replaces the old one.
  - There are no sched_xxx_notify() calls that ask scheduler to change task state.
  - Tasks now have priorities and different timeslices.
  - One second interval is distributed among processes.
  - There are just runnable and expired queues.
  - SCHED_GRANULARITY determines a maximum running boundary for tasks.
  - Scheduler can now detect a safe point and suspend a task.

Interruptible blocking is implemented.
  - Mutexes, waitqueues and ipc are modified to have an interruptible nature.
  - Sleep information is stored on the ktcb. (which waitqueue? etc.)
2008-10-01 12:43:44 +03:00
Bahadir Balban
6b11d3cf02 Added exit() call to libposix 2008-09-18 16:28:51 +03:00
Bahadir Balban
7d4d62cd92 Forktest file added. 2008-09-17 16:21:43 +03:00
Bahadir Balban
1ea21d84bd Updated test0 with a forktest. Fixed timeslices. Updated kmem usage calculations.
- test0 now forks 16 tasks that each modify a global variable.
- scheduler now gives 1/10th of a second per task. It also does not increase timeslice
  of a task that has scheduled.
- When a memory is granted to the kernel, the distribution of this memory to memcaches
  was calculated in a complicated way. This is now simplified.
2008-09-17 15:19:37 +03:00
Bahadir Balban
cb9c5438e2 Back to forked tests with test0 2008-09-17 11:06:28 +03:00
Bahadir Balban
05e9b43722 test0 tests now don't fork, they compare read/write strings. 2008-09-17 09:51:52 +03:00
Bahadir Balban
270cead377 Removed various printfs from fs0 path lookup etc. 2008-09-16 17:41:47 +03:00
Bahadir Balban
f436b44e81 Changes in the README, changes to fork template. 2008-08-16 13:01:18 +03:00
Bahadir Balban
f561d885d5 Flushing pages to vfs will work, but the issue is that while vfs is
serving mm0, if it page faults, system deadlocks because mm0 is waiting to be served by vfs.

FIX: To fix this, mm0 will need to fork itself and keep a separate thread solely for
page fault handling.
2008-05-28 23:37:41 +03:00
Bahadir Balban
fd787479c3 Fixed minor faults during close path.
FIXME:
write/close/open/read sequence does not read the initially written data.
Investigate.
2008-05-23 05:42:26 +00:00
Bahadir Balban
0629ba3c1a sys_write() "seems to" work. Also added support for sys_lseek(). 2008-04-23 14:14:45 +01:00
Bahadir Balban
df0eccf7b3 A file can be created.
Now up to sys_write() in pager, which needs to be filled in.
2008-04-19 01:27:41 +01:00
Bahadir Balban
ce26835968 fd wasn't returned in reorganised sys_open. Fixed. 2008-04-19 00:55:11 +01:00
Bahadir Balban
8c4c436925 Reorganised sys_open.
vfs_create and mknod now returns the newly created vnode.
(which might be used by upper layers).
2008-04-19 00:40:48 +01:00
Bahadir Balban
f7163b7e93 Added file io test to test0. Added close call to libposix. 2008-04-18 21:17:09 +01:00
Bahadir Balban
58033e7927 CHDIR works.
Lookups on different current directory, including /./././/// works as expected.
2008-04-16 16:00:17 +01:00
Bahadir Balban
9d32f840c0 Open wasn't returning the fd but 0 on success :-S. fixed. 2008-04-16 00:34:11 +01:00
Bahadir Balban
9a66893288 lookup return value was changed from -ENOENT to 0 when vnode not found,
Fixed a point in code that expected 0.

Next: lookups should not consume from path every time called but only
when moving to children to lookup.
2008-04-15 23:45:46 +01:00
Bahadir Balban
a9420d3dc9 mkdir almost working.
Added changes to pathname lookup code so that the root
directory special case is handled properly.
2008-04-15 00:51:58 +01:00
Bahadir Balban
287b7705da Towards working mkdir. 2008-04-14 14:38:04 +01:00
Bahadir Balban
d6d97876bb Page fault handling fix.
Factored out mapping of the physical page as the final generic code
after all fault-specific handling is done.

Fixed the error that zero page didn't have an owner (devzero).

Fixed the error that struct dirent did not have the record length
field as u16 as expected by userspace.
2008-04-14 00:09:57 +01:00
Bahadir Balban
7b2f9f96cf os_readdir() now using utcb as dirent buffer. 2008-04-13 16:32:34 +01:00
Bahadir Balban
81ebffdc87 VFS updates, readme updates.
Separated vfs file as a specific file. vm file is not always a vfs file.
Updated the README
sys_open was not returning back to client, added that.
Added comments for future vfs additions.
2008-04-09 16:55:54 +01:00
Bahadir Balban
d27f942702 Very minor fixes. 2008-03-13 00:40:12 +00: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
0c9b42121a Adds reading pages into page-cache in an ordered manner.
Added reading pages from the page cache into user buffer for sys_read.
Increases stack sizes to 4 pages.
Updated README to include more details about multi-pager environments.
2008-02-27 01:17:36 +00:00