Commit Graph

187 Commits

Author SHA1 Message Date
Bahadir Balban
89d49ef495 Lots of fixes, notion of pager hierarchy, fixed tgroup capability checking
Notion of pager hierarchy introduced using the existing but unused
pagerid field.

Thread creation now has two more flags TC_AS_PAGER and TC_SHARE_PAGER.
The former sets creator as pager, the latter sets creator's pager as pager.

Thread group capability sharing now correctly carries shared capabilities
to the thread group leader's tgr_cap_list list, and this list is checked
during capability checking.
2009-10-23 02:36:12 +03:00
Bahadir Balban
df776b568f Tests working up to neverending suspend - Will be fixed. 2009-10-22 22:50:50 +03:00
Bahadir Balban
0f9ea9674c Progress on capabilities
Capabilities will be shared among collection of threads. A pager
will have a right to share its own capabilities with its space,
its thread group and its container.

Currently sharing is possible with only all of the caps. Next,
it will be support for cap splitting, granting, and partial sharing
and granting.
2009-10-22 14:04:25 +03:00
Bahadir Balban
4f5ab576b8 Merge branch 'master' into devel 2009-10-21 20:38:18 +03:00
Bahadir Balban
cc2d740900 Neater thread creation flags. 2009-10-21 16:58:10 +03:00
Amit Mahajan
8bb1069553 Adding mechanism to have differnt run and load address for pagers 2009-10-21 16:45:06 +05:30
Bahadir Balban
d2fee25924 Simplified/Cleaned up pager initialization in the kernel 2009-10-20 22:20:37 +03:00
Bahadir Balban
9c06bea41a Changed name of kernel_container to kernel_resources 2009-10-20 13:14:49 +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
62c4249d95 Renamed many thread_* line of calls.
Renamed so that task_* gets a ktcb directly, and thread_* line of
calls make the search for the ktcb.
2009-10-19 19:24:40 +03:00
Bahadir Balban
cfa35e4a66 Added support for faulty pagers and their threads to become zombies
Added support for pagers that fault to suspend and become zombies
along with all the threads that they manage. Zombie killing is to
be done at a later time, from this special zombie queue.

The implementation works same as a suspension, with the added action
that the thread is moved to a queue in kernel container.
2009-10-19 18:48:55 +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
c5d2bedc7f Remove memcache verbose print 2009-10-18 16:23:53 +03:00
Bahadir Balban
a3a90530df Fixed a few minor issues. 2009-10-18 16:16:32 +03:00
Bahadir Balban
72af4a843a Added userptr access check to exchange_registers 2009-10-18 15:05:56 +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
d19c5c26fd Removed hard-coded area definitions from kernel 2009-10-17 13:42:49 +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
72c6ca1ed0 Added an extended ipc return library function. 2009-10-08 15:35:54 +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
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
Bora Sahin
6aec4ac53b The very first pager's space area is added to the address space list. 2009-10-01 15:51:58 +03:00
Bahadir Balban
bd448babaa Moved scheduler from containers back to being a global.
It makes more sense to have a scheduler (or runqueue pair) per-cpu
rather than per-container. This provides more flexible global scheduling
policy that is also simpler due to all scheduling details being controlled
from a single point.
2009-09-27 13:50:48 +03:00
Bahadir Balban
fa6629800f Coding style changes in kernel startup 2009-09-27 11:47:40 +03:00
Bora Sahin
9bb96108ed Container number is received from the configuration system. 2009-09-25 13:43:33 +03:00
Bahadir Balban
f29d86b5ff Added autogeneration of cinfo.c with memory capabilities
Also fixed a bug with configurator in that the containers
were not sorted properly and consequently an already filled
in container was getting overwritten by the new one.
	modified:   config/configuration.py
	modified:   configure.py
	new file:   generate_kernel_cinfo.py
	deleted:    src/generic/cinfo.c
2009-09-22 19:35:18 +03:00
Bahadir Balban
28f963517d Carried container definition to cinfo.c
This file is meant to be autogenerated by the configurator
2009-09-18 11:30:53 +03:00
Bahadir Balban
8ffd4537ea Added newer platform files.
The build can now be done with fine-grain conditions on how to determine
drivers, platforms, arch, subarch etc.
2009-09-11 14:29:24 +03:00
Bahadir Balban
942865e6fc Working compilation, but adding variant_dir = BUILD it doesn't work 2009-09-11 13:55:46 +03:00
Bahadir Balban
ccd8a61a89 Added container physical regions to cml configuration 2009-09-04 11:41:44 +03:00
Russel Winder
399f1d530d Pull out the toolchains specification as a separate file and extend to cover the new options in the configuration file. 2009-08-30 13:47:16 +01:00
Bahadir Balban
bda0e064af Added new subarch, platform, cpu, driver variants for configuration testing.
New files are an exact copy of pb926 files, but will help in testing different
configurations and compilations.
2009-08-30 13:21:25 +03:00
Russel Winder
9e894274a3 Refactor the build to try and get as much material as possible out of SConstruct. 2009-08-28 14:10:24 +01:00
Russel Winder
03205855cc Generalize the configuration processing so that the top-level SConstruct only processes the ARCH symbol and prepares the PLATFORM and SUBARCH entries so as to write the config.h. Everything is now entered in the environment so the SConscript files can be responsible fo rthe processing. 2009-08-28 10:39:19 +01:00
Russel Winder
079b031616 Add check to ensure the source for the required device driver is actually present. 2009-08-28 09:55:55 +01:00
Russel Winder
187b70a829 Remove redundant comments. 2009-08-28 09:23:56 +01:00
Russel Winder
6ca0f2607a Switch to using a different strategy for building the kernel. 2009-08-27 16:43:47 +01:00
Bahadir Balban
117e3482b6 Capabilities for quantitative resources working.
Status:
- Capability initialization is a bit hacky with dummy current etc.
- All container caps belong to the pager
- Tasks refer to their pager's capabilities for mutex allocation - Hacky.
- Kernel container keeps quantitative caps and memory caps in separate lists - Hacky.

These will all evolve and get fixed.
2009-08-22 23:41:53 +03:00
Bahadir Balban
d3d072e47d Capability accounting for quantitative capabilities - First part done.
Need to make sure accounting charges correct containers during init.
Therefore kernel resource spending must also be accounted for.
2009-08-22 12:09:51 +03:00
Bahadir Balban
de087eb1f8 Clean up to kernel code, Added `used' field to capabilities
With the addition of used field, capability structure can be
used for resource accounting over the capability.
2009-08-21 12:10:34 +03:00
Bahadir Balban
dabc448c4e Added freeing of pager init memory, but this memory is currently not utilized. 2009-08-19 16:26:44 +03:00
Bahadir Balban
95b7b65c89 Pager virtual address pool bookkeeping added for all pager virtual addresses
Previously virt_to_phys/phys_to_virt macros were used such that they did a
blind offset translation for creating a pager internal virtual address for
user mappings.

This is now changed such that a properly bookkeeped virtual address pool is
used which will avoid any clashes on the virtual space.
2009-08-19 14:44:36 +03:00
Bahadir Balban
5bee43ae99 Merge branch 'newBuild' of /opt/c0-trees/codezero-russel into devel
Conflicts:

	SConstruct
	src/api/SConscript
	src/arch/arm/SConscript
	src/generic/SConscript
	tasks/bootdesc/SConstruct
2009-08-14 17:09:58 +03:00
Bahadir Balban
6a42491751 Fixed uninitialized local vars. 2009-08-14 12:54:54 +03:00
Bahadir Balban
c7404c7322 Fixed boot messages 2009-08-11 15:28:39 +03:00
Bahadir Balban
f82db61519 Added freeing/unmapping of boot memory 2009-08-11 15:01:27 +03:00
Bahadir Balban
f4d9520fef First working Codezero & POSIX Services with container/capability changes 2009-08-11 11:23:26 +03:00