Commit Graph

165 Commits

Author SHA1 Message Date
Bahadir Balban
021bd6bc99 Fix to printf 2008-08-29 13:24:57 +03:00
Bahadir Balban
895651b778 Cleaner debug messages for fault handling. 2008-08-29 13:07:28 +03:00
Bahadir Balban
63e9d059c8 More updates to vm object handling.
Added a list of links for vm objects so they can follow
the links that point at them.

More succinct handling of the case where a vm object
is dropped. Now depending on the object's number of link
references and shadow references, upon a drop it could
either be merged, deleted or kept.

Added opener reference count for vm files. Now files
have opener count, objects have shadow and link count.
Link count is also meaningful for how many tasks have
mmap'ed that object.
2008-08-29 12:35:07 +03:00
Bahadir Balban
2217349b60 Fixed 2 bugs in kmalloc. (phew)
When allocating a new area, the alignment calculation of new area
structure was wrong. Hopefully this is now fixed. The original function
with bad alignment was preserved.

When freeing a new area and merging it with adjacent areas, pointer
to previous area was mistakenly used instead of pointer to next.

	modified:   tasks/libmem/kmalloc/kmalloc.c
2008-08-29 12:32:59 +03:00
Bahadir Balban
4ffdb45550 Fixed 2 more fork issues
Added setting of spsr for the new task.
Added newly created task into mm0's global task list.
2008-08-27 22:27:53 +03:00
Bahadir Balban
dad1d2d792 When creating a new thread, forgot to set its syscall_args * pointer. 2008-08-27 14:52:06 +03:00
Bahadir Balban
f1b3a9b95d Fixed a shadow object search logic error.
R/W shadow objects must be made read-only during a fork.
When searching for a writeable shadow object, it can only be the first
object on the vma object chain, therefore not traversing the object
chain and checking only the first object is sufficient.
2008-08-27 14:08:32 +03:00
Bahadir Balban
1ca3fce49b Changes in README. Fix to thread_control() reading wrong syscall argument register. 2008-08-27 13:39:16 +03:00
Bahadir Balban
476bac5142 Cleaned up all compile errors. 2008-08-25 16:59:00 +03:00
Bahadir Balban
cdfaa4bbe9 Fix to parent return value 2008-08-22 01:50:54 +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
1d15821acb Added ipc to notify vfs about a forked child.
TODO: Need to ensure child shmat()s its own utcb
after a fork (possibly in libposix/fork.c)
2008-08-22 00:11:06 +03:00
Bahadir Balban
3ce220f062 Changes to make sure after a fork a child process can safely return.
This copies the parent kernel stack to child only for the part where
the previous context is saved. Then the child registers are modified
so that it would begin execution from returning of the system call.
2008-08-21 16:21:08 +03:00
Bahadir Balban
dada3e0b2c Added copy_vma() function.
Sorting out return_from_fork() and kernel stack setup for the child.
2008-08-21 12:18:38 +03:00
Bahadir Balban
69db3a04c0 Towards implementing fork.
Issue is that shadow object references from original objects are into
the links rather than the objects.
2008-08-19 18:03:23 +03:00
Bahadir Balban
f436b44e81 Changes in the README, changes to fork template. 2008-08-16 13:01:18 +03:00
Bahadir Balban
d434ad4b40 Changes towards adding clone/fork
new file:   src/clone.c
2008-08-05 16:56:55 +03:00
Bahadir Balban
d1170211e3 Commented out printfs for pager/vfs interaction 2008-05-30 11:18:16 +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
98888a94b5 Modified scripts 2008-05-27 10:17:46 +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
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
bd8b182f1b Added syscall to update filestats (size) from pager.
After flushing written/truncated pages, stats are updated
so that vfs is synced with new file info such as its size.
2008-05-21 10:23:11 +00:00
Bahadir Balban
5efece98cd More changes 2008-05-03 15:04:16 +01:00
Bahadir Balban
0557fa8910 Gotta find a way to pass on updated file size before write_file_pages. 2008-04-26 01:03:11 +01:00
Bahadir Balban
f183b3c15e Still towards close/flush. 2008-04-25 23:06:23 +01:00
Bahadir Balban
c9b9f9d111 Towards sys_close()/sys_flush() 2008-04-25 22:14:59 +01: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
ba725168a0 Fixed lseek. Updates to sys_read/sys_write
read and write are both called by test0. But they don't yet
work as expected. An error is in one or both. To be investigated.
2008-04-24 00:09: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
1270cfe3b3 open file descriptor references to vm files weren't properly initialised.
This fixes the issue. sys_read/write yet to be inspected.
2008-04-22 01:41:18 +01:00
Bahadir Balban
e8bb529dcb Now we save/restore utcb registers if we do a second ipc before returning the first. 2008-04-22 00:30:07 +01:00
Bahadir Balban
80470e2581 Adding reply phase to pager_sys_open()
So that open() errors on pager's side can be noticed by vfs.
2008-04-21 15:30:40 +01:00
Bahadir Balban
a674cf2b27 Recompiled with write_cache_pages(). Implementation to be re-evaluated. 2008-04-21 00:31:16 +01:00
Bahadir Balban
e3cc14515c mm0 compiles, still previous issues on. 2008-04-20 23:34:25 +01:00
Bahadir Balban
d8d65a6301 Efforts towards sys_write.
- Added logic to calculate which pages are in the file and which are new
  for writing.
- Nearly finished the template for sys_write.
- Need to implement write_cache_pages().
- Need to distinguish dirty/clean pages and implement flushing dirty
  pages back to vfs.
2008-04-20 17:33:05 +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
8b3fedc18d Towards working sys_read/sys_write. 2008-04-19 15:42:13 +01:00
Bahadir Balban
9f4e400fed Minor updates to README 2008-04-19 12:28:49 +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
cff7a505e8 Changed time representation to posix style struct timeval/ gettimeofday. 2008-04-18 13:58:37 +01:00
Bahadir Balban
5563cc1c6b Minor changes on sys_time
A get/set flag determines whether to read or write time.
2008-04-18 01:03:39 +01:00
Bahadir Balban
a87914910c Added a new system call sys_timer.
sys_timer accumulates timer ticks into seconds, minutes, hours and days.
It's left to the user to calculate from days into a date. It is not yet
known if the calculation is even roughly correct.

Reduced 2 kmem_reclaim/grant calls into one kmem_control call.
2008-04-18 00:46:29 +01:00
Bahadir Balban
73058dc249 Added sys_close() but its not done yet.
close() needs to flush dirty buffers.
pager needs to have read/write support properly implemented.
open() needs to record mode and access times.
The need for access times means we need rtc and time implementation.
Also need to add stat() access() etc.
2008-04-17 21:47: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