Commit Graph

142 Commits

Author SHA1 Message Date
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
Bahadir Balban
730e7c210f Added resolving of current directory in case lookup starts from current dir. 2008-04-16 14:48:05 +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
e722ee0115 Root was a child of itself, removed that relationship.
Root is only a parent of itself, it shouldn't show up in its children.
2008-04-16 00:20:59 +01:00
Bahadir Balban
ab588c279b Fixed the component-consumption-every-lookup problem.
Now components only consumed on child lookup recursions.
2008-04-16 00:04:54 +01:00
Bahadir Balban
8a3da9c709 README update
modified:   README
2008-04-15 23:57:21 +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
577a2bffe4 Changed name of cml configuration 2008-04-15 19:43:35 +01:00
Bahadir Balban
9ba6638d01 Added new path parsing functions that work cleaner, better.
Input paths are now parsed at the beginning and components
put into an ordered linked list headed by struct pathdata.
Lookup functions use these components to look up vnodes.
2008-04-15 19:36:07 +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
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
7f815dd2dd Fixed handling of pages that are SHARED and ANONYMOUS
Normally anon && shared pages need to COW once and any newer
accesses by other sharing processes should simply map the COW'ed
pages to themselves as writeable. We didn't have that but instead
every ANON && SHARED write fault was going into the COW path, causing
the same offset'ed page to be COW'ed twice.

Next: Factor out the l4_map code to a common point at the end of all
fault handling paths.
2008-04-13 17:03:11 +01:00
Bahadir Balban
7b2f9f96cf os_readdir() now using utcb as dirent buffer. 2008-04-13 16:32:34 +01:00
Bahadir Balban
2efffdfa88 Seem to have fixed dirbuf allocation.
Dirbuf allocation was broken, fixed it.
Added more comments on reading directories.

Issues: fs0 ought to check buf address for sys_readdir(). Currently
test0 is passing an area on its stack and fs0 is writing the data to its own
address space (i.e. an area on its own stack.)
2008-04-13 00:23:21 +01:00
Bahadir Balban
367e455506 Fixed compilation errors for filldir/sys_readdir() changes. 2008-04-12 18:03:49 +01:00
Bahadir Balban
d7b06b5304 sys_readdir and root vnode fixes.
Changes towards successfully filling dirent structures for sys_readdir
and creating a root vnode for the filesystem.
2008-04-12 17:57:45 +01:00
Bahadir Balban
5e0ec2db85 Readme grammar fix 2008-04-09 18:30:18 +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
dd3f35bbd4 Moved vnum to priv_data of vm_file since its only related to vfs files. 2008-03-25 23:32:51 +00: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
13b9e5407a Removed non-standard allocation of mm0 utcb.
It is now allocated in a generic way using shm_new() which creates a
posix shmat()/shmget()'able utcb.
2008-03-24 00:46:31 +00:00
Bahadir Balban
35d2d275b6 Multiple above-minor updates.
- fixed is_err(x), was evaluating x twice, resulting in calling a
function x twice.

- Divided task initialisation into multiple parts.
- MM0 now creates a tcb for itself and maintains memory regions of its own.
- MM0's tcb is used for mmapping other tasks' regions. MM0 mmaps and prefaults
  those regions, instead of the typical mmap() and fault approach used by
  non-pager tasks.
  For example there's an internal shmget_shmat() path to map in other tasks'
  shm utcbs. Those mappings are then prefaulted into mm0's address space using
  the default fault handling path.

- FS0 now reads task data into its utcb from mm0 via a syscall.
  FS0 shmat()s to utcbs of other tasks, e.g. mm0 and test0.

  FS0 then crashes, that is to be fixed and where this commit is left last.
2008-03-24 00:34:14 +00:00