Commit Graph
217 Commits
Author SHA1 Message Date
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
Bahadir Balban 4f4532210a Fixed a bug with page_map size by dynamically allocating it. 2009-08-10 23:47:58 +03:00
Bahadir Balban 15b659eaf0 Removed any refs to global id pools.
Also added container reference setup to thread creation
2009-08-10 15:16:57 +03:00
Bahadir Balban aa71161a04 Seems phys_to_page/page_to_phys macros are fixed in mm0 2009-08-09 17:59:32 +03:00
Bahadir Balban 02a3f1ac91 Pager works until end of init_physmem_secondary 2009-08-09 17:22:13 +03:00
Bahadir Balban 961b255257 Replaced kread and kmem_control syscalls with capability_control and container_control respectively. 2009-08-06 16:22:55 +03:00
Bahadir Balban dccfff80a3 Removed commented out scheduler globals. 2009-08-06 15:02:42 +03:00
Bahadir Balban e329a7c91a Removed kmalloc. Initialization path resolved, almost done. 2009-08-06 14:15:39 +03:00
Russel Winder 8b9b254f6c Make the coding style more consistent with PEP-8. 2009-08-05 11:15:26 +01:00
Bahadir Balban 519bfba8c7 Container/Pager/Capability initialization that works.
Need to safely free boot memory and jump to first task's stack.
Need to test scheduler and all syscall entries.
2009-08-04 13:56:11 +03:00
Bahadir Balban 7e8845abf8 Code that compiles until initialization of containers and pagers. 2009-08-02 23:43:14 +03:00
Russel Winder 9b2ff087d0 Add in all the amendments and new files needed to get the kernel building. 2009-08-01 17:50:59 +01:00
Bahadir Balban 82807c2f0a Code that works until after allocating pgd and pmd caches. 2009-07-29 20:01:40 +03:00
Bahadir Balban 723cf7bde9 Code that compiles and works up to initializing the first memcache. 2009-07-29 19:08:29 +03:00
Bahadir Balban dd8f773f10 Some more progress on resource management and boot up. 2009-07-29 13:32:38 +03:00
Russel Winder d40c76de84 Remove all the SCons files pending starting a new build system. 2009-07-28 14:47:00 +01:00
Bahadir Balban 2b0ea24e94 Added 2 more files. 2009-07-25 17:52:06 +03:00
Bahadir Balban f7b768ee16 More changes for cleaner initialization and support for containers. 2009-07-25 17:44:29 +03:00
Bahadir Balban 0dd8918ae5 Remove all references to ARM registers in system call arguments. 2009-06-10 17:30:02 +03:00
Bahadir Balban 4e43d09325 wait_on_prepare and wait_on_prepared_wait with preemption considered 2009-06-10 15:48:34 +03:00
Bahadir Balban 7ef479733f Fix to l4_mutex_control for the unexpected sleeping with mutex held
when preemption occurs after call to wait_on_prepare
2009-06-10 15:41:30 +03:00