Commit Graph

80 Commits

Author SHA1 Message Date
Bahadir Balban
b78859503e Fixed anomaly on memory initialization on mm0.
By this commit, two copies of posix containers can be run!
2009-10-19 22:22:23 +03:00
Bahadir Balban
3660ba9528 Some more minor fixes. 2009-10-19 20:21:23 +03:00
Bahadir Balban
655e135300 Removed zombie test and any verbose printks 2009-10-19 19:45:04 +03:00
Bahadir Balban
9177166817 Managed to self-destruct pager.
Issues:
- A page-faulting thread suspends if receives -1 from pager page fault ipc.
  This is fine if pager is about to delete the thread, but it is not if
  it is a buggy pager.
- Need to find a way to completely get rid of suspended pager.
- A method of deleting suspended tasks could remedy both cases above.
2009-10-19 00:33:10 +03:00
Bahadir Balban
c3b0399485 Debug commit to be removed 2009-10-18 18:53:31 +03:00
Bahadir Balban
a3a90530df Fixed a few minor issues. 2009-10-18 16:16:32 +03:00
Bahadir Balban
2bd3266498 Removed bits from kernel where pager utcb is set.
Pagers now set their own utcb explicitly via exchange_registers.
exregs accepts calls from active pagers for this purpose only.
2009-10-18 15:01:38 +03:00
Bahadir Balban
7ba7a2e796 Added a simplified ascii_to_int() implementation.
Removed dependency on hard-coded pager id. Pager id is now passed
as an environment string `pagerid' to tasks. Alternatively, this
could take space in the utcb of each task.
2009-10-17 18:48:30 +03:00
Bahadir Balban
d19c5c26fd Removed hard-coded area definitions from kernel 2009-10-17 13:42:49 +03:00
Bahadir Balban
fc95d95454 Made necessary changes to make test0 link at an adjustable address 2009-10-17 13:24:26 +03:00
Bahadir Balban
e28e2f486a Changed all pager hardcoded value assumptions, too.
Not tested.
2009-10-15 20:43:19 +03:00
Bahadir Balban
e9afbbaad9 Replaced all hard-coded values for UTCB, SHM, TASK region assumptions.
Not tested.
Not replaced pager run-area values.
2009-10-15 20:35:41 +03:00
Bahadir Balban
6982e96d1f Some cleanups on last commit 2009-10-15 20:24:01 +03:00
Bahadir Balban
381405ee8e Incorporated means to specify shared memory, task address space and utcb regions to posix container 2009-10-15 20:10:08 +03:00
Bahadir Balban
9d900a9956 Cleanup to execve functions 2009-10-14 15:21:33 +03:00
Bahadir Balban
281116fbc7 Merged read/write cache pages as copy_cache_pages() 2009-10-14 15:01:12 +03:00
Bahadir Balban
3a3204986e read_cache_pages() also working copied from write_cache_pages()
- Need to remove old versions
- Need to merge the two.
- Need to investigate occasional page fault on NMOP sequence. (resembles an error ipc_extended test)
  Could be related to new page cache read/write routines.
2009-10-14 01:48:05 +03:00
Bahadir Balban
ee2bf8e7f3 Write cache pages seems to work OK. 2009-10-14 00:36:01 +03:00
Bahadir Balban
0cd5091132 Moved user buffer access functions to user.c 2009-10-13 19:11:14 +03:00
Bahadir Balban
38ac9052c0 Few minor fixes 2009-10-13 13:51:30 +03:00
Bahadir Balban
c37b9030fd Fixed a bug with returned fd from sys_open 2009-10-13 13:31:22 +03:00
Bahadir Balban
a249105969 Integrated vm_files with vnodes. execve is not working as expected. 2009-10-13 11:33:25 +03:00
Bahadir Balban
f54747a208 All posix tests running as before. 2009-10-10 00:23:13 +03:00
Bahadir Balban
13c7a6476d Fixed a c library issue with wrong valued SEEK_SET SEEK_CUR ... 2009-10-09 16:53:37 +03:00
Bahadir Balban
d39ffc6acd Fixed utcb updating issue that was a significant burden.
Any thread that touches a utcb inside the kernel now properly checks
whether the utcb is mapped on its owner, and whether the mapped physical
address matches that of the current thread's tables. If not the tables
are updated.

This way, even though page tables become incoherent on utcb address
change situations (such as fork() exit(), execve()) they get updated
as they are referenced.

Since mappings are added only conditionally, caches are flushed only
when an update is necessary.
2009-10-09 16:45:10 +03:00
Bahadir Balban
7e38e70f93 Added conditional configuration flag -c to build.py 2009-10-08 19:07:59 +03:00
Bahadir Balban
d888267f58 Fixed the error that dirent structure was not matching userland structure. 2009-10-08 18:37:43 +03:00
Bahadir Balban
4966b2bea9 Fixed a reference to VFS_TID 2009-10-08 17:50:44 +03:00
Bahadir Balban
2192b22677 Added a filesystem index value for each superblock 2009-10-08 17:00:00 +03:00
Bahadir Balban
72c6ca1ed0 Added an extended ipc return library function. 2009-10-08 15:35:54 +03:00
Bahadir Balban
cb561ab262 Removed all references th shared page from libposix
Added UTCB functions for full ipc that copy buffer or string payloads
in secondary message registers.

Some posix syscalls now use these utcb functions to copy pathnames.
2009-10-07 22:59:34 +03:00
Bahadir Balban
96cd0949b6 Correct placement of arguments and environment on stack.
int main(int argc, char *argv[])

style main function works now on Codezero/POSIX.
2009-10-07 19:17:24 +03:00
Bahadir Balban
8a55a80c23 Fixed lots of issues with mm0 initialization, final one was an oversized do_munmap.
test0 now successfully runs its beginning.
test0 SConscript has a dependency problem.

Issues to be investigated:
- vm_file and vnodes need to be merged fully in all functions.
- libposix shared page references need to be removed.
- Any references to VFS_TID, PAGER_TID need to be removed.
2009-10-06 21:12:45 +03:00
Bahadir Balban
ea9c399dda Progress on executing test0 from memfs file as an elf.
Elf is recognised OK, but somehow section table is not read correctly.
2009-10-06 18:30:36 +03:00
Bahadir Balban
965f2f9456 Brought mm0 initialization up to init_execve()
Changes:
It is now possible to use do_mmap() from within mm0.

- pager_new_virtual()/delete_virtual() return addresses that are
  disjoint from find_unmapped_area() used by mmap() interface for
  anonymous or not-fixed areas.
- find_unmapped_area() now uses task->map_start task->map_end instead
  of task->start and task->end. task->start/end are still valid task
  space addresses for mmap(), but finding a new address is limited to
  map_start/map_end.

- We have both interfaces because mmap() is only useful for backed-files.
  When the pager needs to access a user memory range for example, that is
  not backed by a file and thus we need to use pager_new_virtual() instead
  of mmap() for mapping.
2009-10-06 14:15:33 +03:00
Bahadir Balban
56ceed0786 Cleaned up MM0 linker script 2009-10-06 11:30:30 +03:00
Bahadir Balban
999cddd2c8 posix container: sys_write fails on validating pager's buffer as a user buffer.
It might be a good idea to simply use mmap() from inside the pager and prefault it
as a conventional way of mapping internal buffers. Will be investigated.

- This would open the way that all internal buffer mapping is
  done in a standard way
- Standard syscalls would be possible to use from within the pager.
2009-10-05 21:56:55 +03:00
Bahadir Balban
a6c7ac7766 Fixed mmap'ing of pager address space
An anonymous never-to-be-faulted VMA is created for mm0's task region
that is already mapped.
2009-10-05 19:05:56 +03:00
Bahadir Balban
114a59351f Some style fixes. 2009-10-05 16:48:54 +03:00
Bahadir Balban
6b5d4b26c2 Changes to mm0 initialization. mm0 building.
Changed mm0 initialization.
Removed all cruft about boot-specific task setup and initialization,
mm0 now builds with new changes.
2009-10-05 16:40:51 +03:00
Bahadir Balban
da5f4dcff3 Changes in merged posix pager mm0 initialization.
- Moved rootfs from being embedded to mm0 image to being an independent image.
- MM0 boots up to start_init_process with updated boot convention.
2009-10-05 13:25:32 +03:00
Bahadir Balban
f8bcd7a546 Merged fs0 to mm0 for simpler progress on posix api.
mm0 and all other posix dependents are building ok.
2009-10-04 17:34:19 +03:00
Bahadir Balban
12aec8d777 Merge branch 'linux' of git://www.b-labs.co.uk/home/bora/web/git/codezero into bora 2009-10-01 16:24:07 +03:00
Bora Sahin
afaa1d03a8 A few changes to allow development on conts/test directory.
Now, bare containers get their files from conts/bare_src instead of conts/test.
test directory will be used for the next generation test programs.
Also bare_src is tracked by git now with a minor mod to .gitignore.
2009-10-01 15:43:46 +03:00
Bahadir Balban
4b235a9920 Fixed an error with mm0 where server naming wasn't matched from bootdesc 2009-10-01 13:29:35 +03:00
Bahadir Balban
e5cde20ca9 Fixed a fault with posix tasks not getting their LMA correctly 2009-10-01 13:13:27 +03:00
Bahadir Balban
70a3bb35f5 Linux readme should be in linux repo 2009-10-01 11:26:28 +03:00
Bahadir Balban
4db35ff350 Added container information for sources such as linux and posix 2009-10-01 11:24:25 +03:00
Bahadir Balban
5ec000fb34 Added libmem which was forgotten 2009-10-01 10:52:07 +03:00
Bahadir Balban
b24fa0772f Removed .sconsigns that got in. 2009-09-30 23:53:57 +03:00