Commit Graph

43 Commits

Author SHA1 Message Date
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
05d8438f34 Task initally exec'ing with success. Some errors need to be investigated.
- Directory creation, file read/write is OK.
- Cannot reuse old task's fds. They are not recycled for some reason.
- Problems with fork/clone/exit. They fail for a reason.
2008-12-01 13:53:50 +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
f87f3cd5d2 Fixed libposix munmap call where we used the MMAP tag. 2008-11-07 15:18:43 +02:00
Bahadir Balban
3cb36b632a Fixed various bugs in user buffer validation/mapping and mmap() syscall path. 2008-11-07 12:32:10 +02:00
Bahadir Balban
13b1b405a5 Cleaned up libposix mmap()
Now we have proper setting of errno and using pfn based mmap for both types of mmap calls.
2008-10-29 20:01:31 +02: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
6b11d3cf02 Added exit() call to libposix 2008-09-18 16:28:51 +03:00
Bahadir Balban
6e3d04dad3 getpid() call 2008-09-17 16:55:37 +03:00
Bahadir Balban
0b3ab05a98 Some minor changes
Need to reimplement exchange_registers
2008-09-12 10:47:36 +03:00
Bahadir Balban
af03975dc1 Towards adding sys_clone()
Stopped working on self_spawn() - going to finish clone() syscall first.
Arch-specific clone() library call that does ipc() and cloned child setup.
- Need to finish thread_create() that satisfy clone() necessities. i.e. setting up its stack.
  Question: Does the pager (and thus the microkernel) have to explicitly set SP_USR?
  Once the call is known to be successful, the library could set it.
2008-09-11 16:56:41 +03:00
Bahadir Balban
6c1da12fec Mixed changes
- Adding prefaulting of fs0 to avoid page fault deadlocks.
- Fixed a bug that a vmo page_cache equivalence would simply drop a link to
  an original vmo, even if the vmo could have more pages outside the page cache,
  or if the vmo was not a shadow vmo.
- Fixed a bug with page allocator where recursion would corrupt global variables.
- Now going to fix or re-write a simpler page allocator that works.
2008-09-06 11:15:41 +03:00
Bahadir Balban
1a90b655c7 Added child utcb initialisation to fork call implementation in libposix. 2008-08-22 00:26:19 +03:00
Bahadir Balban
f436b44e81 Changes in the README, changes to fork template. 2008-08-16 13:01:18 +03:00
Bahadir Balban
6be310f460 Added sys_close and sys_fsync
Untested.
2008-05-23 03:59:18 +00:00
Bahadir Balban
00b47117b0 Added sys_stat, sys_fstat and their libposix glue. 2008-05-22 11:21:27 +00:00
Bahadir Balban
488d9e6271 Fixed the issue that page copy offsets were not correct.
When copying file pages back and forth, we need both dst and src
offsets since the cursor offset and read/write buffer page offsets
are different. This is now fixed.

Also done some mods to close().
2008-04-25 17:07:49 +01: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
59bdaf22ec Towards user buffer checking 2008-04-22 14:18:12 +01:00
Bahadir Balban
9992d100d7 Few fixes in libposix error checking.
size_t is a non-negative type and negative error checking didn't work. Now fixed.
Fixed various issues with reading file pages in the sys_read() path.
2008-04-20 02:12:53 +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
f7163b7e93 Added file io test to test0. Added close call to libposix. 2008-04-18 21:17:09 +01:00
Bahadir Balban
cff7a505e8 Changed time representation to posix style struct timeval/ gettimeofday. 2008-04-18 13:58:37 +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
fb249b0c5b Fixed wrong directory name issue, strlen() was off by one. 2008-04-15 01:51:13 +01:00
Bahadir Balban
287b7705da Towards working mkdir. 2008-04-14 14:38:04 +01:00
Bahadir Balban
7b2f9f96cf os_readdir() now using utcb as dirent buffer. 2008-04-13 16:32:34 +01:00
Bahadir Balban
4b1abc60a6 Various minor fixes.
Removed some commented out code.
Removed excessive printfs.
Fixed spid not initialising for mm0
Fixed some faults with fs0.

TODO:
- Need to store vfs files in a separate list.
- Need to define vnum as a vfs-file-specific data, i.e. in priv_data field of vm_file.
- Need to then fix vfs_receive_sys_open.
2008-03-24 22:39:21 +00:00
Bahadir Balban
466138f125 shmat/shmget for utcbs are working for now.
faults on shared memory needs to be implemented.
2008-03-19 22:26:38 +00:00
Bahadir Balban
16617eed36 Various changes to incorporate new utcb setup.
Issues with l4_return value not reaching client side
	modified:   libs/c/include/stdio.h
	modified:   src/arch/arm/exception.c
	modified:   src/glue/arm/init.c
	modified:   tasks/fs0/src/task.c
	modified:   tasks/libl4/include/l4lib/arch-arm/utcb.h
	modified:   tasks/libl4/src/arm/syscalls.S
	modified:   tasks/libl4/src/init.c
	deleted:    tasks/libl4/tagfilelist
	modified:   tasks/libposix/open.c
	modified:   tasks/mm0/include/utcb.h
	modified:   tasks/mm0/include/vm_area.h
	modified:   tasks/mm0/main.c
	modified:   tasks/mm0/src/init.c
	modified:   tasks/mm0/src/task.c
	modified:   tasks/mm0/src/utcb.c
	modified:   tasks/mm0/src/vm_object.c
2008-03-19 02:27:53 +00:00
Bahadir Balban
ac3935a5d9 Initial efforts to transform utcb handling. 2008-03-18 21:50:47 +00:00
Bahadir Balban
26e6366014 Added a memlayout.txt, revised README, reduced env size to 4kb 2008-03-18 18:21:09 +00:00
Bahadir Balban
d27f942702 Very minor fixes. 2008-03-13 00:40:12 +00:00
Bahadir Balban
58b833dd7f Forks and COW situations show that we need vm objects rather than vm_files.
This is the first commit towards implementing vm object based paging with
right COW methods.
2008-03-03 22:05:01 +00:00
Bahadir Balban
4f346cea53 Added the first means to pass information between 2 tasks using the
utcb as a shared page instead of the message registers.

Implemented the code that passes task information from mm0 to fs0
using the fs0 utcb. The code seems to work OK but:

There's an issue with anon pages that they end up on the same swapfile
and with same file offsets (e.g. utcb and stack at offset 0). Need to
fix this issue but otherwise this implementation seems to work.

TODO:
- Separate anon regions into separate vmfiles.
- Possibly map the stacks from virtual files so that they can be
  read from userspace in the future for debugging.
- Possibly utcb could be created as a shared memory object using shmget/shmat
  during startup.
2008-02-29 21:56:05 +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
7f9380cc78 Errno is set by the posix calls read/write/open/close etc. rather than their l4_xxx equivalent.
mmap.c is the only one not done yet.
2008-02-12 19:17:19 +00:00
Bahadir Balban
193430d226 Added test code for testing of directory listing.
Added system call prototypes and posix glue for reading a directory.

TODO:
FS0 should implement the L4_IPC_TAG_READDIR ipc call.
2008-02-12 19:09:46 +00:00
Bahadir Balban
cab2e8bdd3 Finished adding untested bare functionality vfs
Finished adding untested shm syscalls.
Finished adding untested l4 send/recv helpers

Everything compiles. Now going to fix lots of bugs ;-)
2008-02-03 17:42:38 +00:00
Bahadir Balban
6bb5b45212 FS0 compiles now, with a mock-up rootfs.
Having progress on vfs slowly but surely ;-)
2008-01-15 00:34:10 +00:00
Bahadir Balban
e2b791a3d8 Initial commit 2008-01-13 13:53:52 +00:00