Permalink
Browse files

Imported Genode release 11.11

  • Loading branch information...
1 parent 6bcc9ae commit da4e1feaa5c8818e43a6b1e25ab32eab92307c1f Genode Labs committed with chelmuth Dec 22, 2011
Showing with 19,011 additions and 3 deletions.
  1. +280 −0 LICENSE
  2. +179 −3 README
  3. +44 −0 base-codezero/Makefile
  4. +3 −0 base-codezero/README
  5. +240 −0 base-codezero/config/vpb926.cml
  6. +274 −0 base-codezero/doc/codezero.txt
  7. +1 −0 base-codezero/etc/specs.conf
  8. +33 −0 base-codezero/include/arm/cpu/atomic.h
  9. +63 −0 base-codezero/include/base/ipc_msgbuf.h
  10. +169 −0 base-codezero/include/base/ipc_pager.h
  11. +143 −0 base-codezero/include/base/native_types.h
  12. 0 base-codezero/include/codezero/dummies/stdio.h
  13. 0 base-codezero/include/codezero/dummies/string.h
  14. +76 −0 base-codezero/include/codezero/syscalls.h
  15. +9 −0 base-codezero/lib/mk/arm/startup.mk
  16. +3 −0 base-codezero/lib/mk/arm_v5/l4.mk
  17. +9 −0 base-codezero/lib/mk/arm_v5/l4_arm_v5.mk
  18. +3 −0 base-codezero/lib/mk/codezero_cml.inc
  19. +13 −0 base-codezero/lib/mk/cxx.mk
  20. +4 −0 base-codezero/lib/mk/ipc.mk
  21. +43 −0 base-codezero/lib/mk/l4.inc
  22. +7 −0 base-codezero/lib/mk/lock.mk
  23. +4 −0 base-codezero/lib/mk/pager.mk
  24. +6 −0 base-codezero/lib/mk/pl011/core_printf.mk
  25. +33 −0 base-codezero/lib/mk/platform.mk
  26. +5 −0 base-codezero/lib/mk/thread.mk
  27. +56 −0 base-codezero/mk/spec-codezero.mk
  28. +13 −0 base-codezero/mk/spec-codezero_arm.mk
  29. +9 −0 base-codezero/mk/spec-codezero_arm_v5.mk
  30. +6 −0 base-codezero/mk/spec-codezero_platform_vpb926.mk
  31. +67 −0 base-codezero/patches/README
  32. +33 −0 base-codezero/patches/binutils-2.21.patch
  33. +182 −0 base-codezero/patches/gcc_4_6_1_fixes.patch
  34. +10 −0 base-codezero/patches/gcc_shared_enabled.patch
  35. +21 −0 base-codezero/patches/libc_search_dir.patch
  36. +97 −0 base-codezero/patches/scons-2.0.1.patch
  37. +13 −0 base-codezero/patches/set_fixed_pager.patch
  38. +88 −0 base-codezero/run/env
  39. +78 −0 base-codezero/src/base/console/pl011/core_console.h
  40. +53 −0 base-codezero/src/base/cxx/exception.cc
  41. +24 −0 base-codezero/src/base/cxx/memcmp.cc
  42. +175 −0 base-codezero/src/base/ipc/ipc.cc
  43. +175 −0 base-codezero/src/base/ipc/pager.cc
  44. +48 −0 base-codezero/src/base/lock/cmpxchg.cc
  45. +63 −0 base-codezero/src/base/lock/lock.cc
  46. +112 −0 base-codezero/src/base/lock/lock_helper.h
  47. +101 −0 base-codezero/src/base/pager/pager.cc
  48. +79 −0 base-codezero/src/base/thread/thread_start.cc
  49. +67 −0 base-codezero/src/core/core_rm_session.cc
  50. +52 −0 base-codezero/src/core/include/core_rm_session.h
  51. +71 −0 base-codezero/src/core/include/irq_session_component.h
  52. +66 −0 base-codezero/src/core/include/map_local.h
  53. +72 −0 base-codezero/src/core/include/platform.h
  54. +74 −0 base-codezero/src/core/include/platform_pd.h
  55. +135 −0 base-codezero/src/core/include/platform_thread.h
  56. +46 −0 base-codezero/src/core/include/util.h
  57. +27 −0 base-codezero/src/core/io_mem_session_support.cc
  58. +58 −0 base-codezero/src/core/io_port_session_component.cc
  59. +72 −0 base-codezero/src/core/irq_session_component.cc
  60. +293 −0 base-codezero/src/core/platform.cc
  61. +124 −0 base-codezero/src/core/platform_pd.cc
  62. +104 −0 base-codezero/src/core/platform_thread.cc
  63. +65 −0 base-codezero/src/core/ram_session_support.cc
  64. +28 −0 base-codezero/src/core/rm_session_support.cc
  65. +55 −0 base-codezero/src/core/target.inc
  66. +4 −0 base-codezero/src/core/target.mk
  67. +121 −0 base-codezero/src/core/thread_start.cc
  68. +74 −0 base-codezero/src/kernel/target.mk
  69. +67 −0 base-codezero/src/platform/_main_helper.h
  70. +131 −0 base-codezero/src/platform/genode.ld
  71. +202 −0 base-codezero/tool/gen_romfs
  72. +44 −0 base-fiasco/Makefile
  73. +4 −0 base-fiasco/README
  74. +95 −0 base-fiasco/config/kernel-config.x86
  75. +83 −0 base-fiasco/config/l4env-config.x86
  76. +130 −0 base-fiasco/doc/fiasco.txt
  77. +11 −0 base-fiasco/etc/fiasco.conf
  78. +15 −0 base-fiasco/etc/specs.conf
  79. +8 −0 base-fiasco/etc/tools.conf
  80. +39 −0 base-fiasco/include/arm/cpu/atomic.h
  81. +57 −0 base-fiasco/include/base/cancelable_lock.h
  82. +65 −0 base-fiasco/include/base/ipc_msgbuf.h
  83. +173 −0 base-fiasco/include/base/ipc_pager.h
  84. +115 −0 base-fiasco/include/base/native_types.h
  85. +40 −0 base-fiasco/include/fiasco/thread_helper.h
  86. +8 −0 base-fiasco/lib/mk/arm/startup.mk
  87. +5 −0 base-fiasco/lib/mk/core_printf.mk
  88. +3 −0 base-fiasco/lib/mk/ipc.mk
  89. +19 −0 base-fiasco/lib/mk/l4v2_support.mk
  90. +3 −0 base-fiasco/lib/mk/lock.mk
  91. +3 −0 base-fiasco/lib/mk/pager.mk
  92. +56 −0 base-fiasco/lib/mk/platform.inc
  93. +6 −0 base-fiasco/lib/mk/x86/platform.mk
  94. +8 −0 base-fiasco/lib/mk/x86/startup.mk
  95. +69 −0 base-fiasco/mk/l4_pkg.mk
  96. +32 −0 base-fiasco/mk/spec-fiasco.mk
  97. +50 −0 base-fiasco/mk/spec-fiasco_arm.mk
  98. +25 −0 base-fiasco/mk/spec-fiasco_x86.mk
  99. +16 −0 base-fiasco/mk/spec-platform_imx.mk
  100. +14 −0 base-fiasco/mk/spec-platform_integrator.mk
  101. +14 −0 base-fiasco/mk/spec-platform_mmsp2.mk
  102. +127 −0 base-fiasco/run/env
  103. +30 −0 base-fiasco/src/base/console/core_console.h
  104. +259 −0 base-fiasco/src/base/ipc/ipc.cc
  105. +69 −0 base-fiasco/src/base/ipc/pager.cc
  106. +50 −0 base-fiasco/src/base/lock/lock.cc
  107. +117 −0 base-fiasco/src/base/pager/pager.cc
  108. +5 −0 base-fiasco/src/bootstrap/target.mk
  109. +24 −0 base-fiasco/src/core/arm/platform_arm.cc
  110. +7 −0 base-fiasco/src/core/arm/target.mk
  111. +76 −0 base-fiasco/src/core/include/map_local.h
  112. +157 −0 base-fiasco/src/core/include/platform.h
  113. +182 −0 base-fiasco/src/core/include/platform_pd.h
  114. +142 −0 base-fiasco/src/core/include/platform_thread.h
  115. +121 −0 base-fiasco/src/core/include/util.h
  116. +95 −0 base-fiasco/src/core/io_mem_session_support.cc
  117. +122 −0 base-fiasco/src/core/irq_session_component.cc
  118. +509 −0 base-fiasco/src/core/platform.cc
  119. +290 −0 base-fiasco/src/core/platform_pd.cc
  120. +153 −0 base-fiasco/src/core/platform_thread.cc
  121. +27 −0 base-fiasco/src/core/ram_session_support.cc
  122. +48 −0 base-fiasco/src/core/rm_session_support.cc
  123. +51 −0 base-fiasco/src/core/target.inc
  124. +62 −0 base-fiasco/src/core/thread_start.cc
  125. +52 −0 base-fiasco/src/core/x86/platform_x86.cc
  126. +7 −0 base-fiasco/src/core/x86/target.mk
  127. +23 −0 base-fiasco/src/kernel/target.inc
  128. +4 −0 base-fiasco/src/kernel/x86/target.mk
  129. +19 −0 base-fiasco/src/platform/_main_helper.h
  130. +25 −0 base-fiasco/src/platform/arm/Makefile
  131. +124 −0 base-fiasco/src/platform/arm/_main.cc
  132. +37 −0 base-fiasco/src/platform/arm/crt0.s
  133. +5 −0 base-fiasco/src/sigma0/target.mk
  134. +98 −0 base-foc/Makefile
  135. +9 −0 base-foc/README
  136. +83 −0 base-foc/config/pbxa9.kernel
  137. +64 −0 base-foc/config/rva9.user
  138. +85 −0 base-foc/config/vea9x4.kernel
  139. +87 −0 base-foc/config/x86_32.kernel
  140. +73 −0 base-foc/config/x86_64.kernel
  141. +142 −0 base-foc/doc/foc.txt
  142. +20 −0 base-foc/etc/foc.conf
  143. +8 −0 base-foc/etc/specs.conf
  144. +54 −0 base-foc/include/arm/cpu/atomic.h
  145. +68 −0 base-foc/include/base/cap_sel_alloc.h
  146. +56 −0 base-foc/include/base/ipc.h
  147. +152 −0 base-foc/include/base/ipc_msgbuf.h
  148. +200 −0 base-foc/include/base/ipc_pager.h
  149. +87 −0 base-foc/include/base/native_types.h
  150. +40 −0 base-foc/include/base/thread_state.h
  151. +79 −0 base-foc/include/foc_cpu_session/client.h
  152. +41 −0 base-foc/include/foc_cpu_session/connection.h
  153. +46 −0 base-foc/include/foc_cpu_session/foc_cpu_session.h
  154. +38 −0 base-foc/include/foc_pd_session/client.h
  155. +40 −0 base-foc/include/foc_pd_session/connection.h
  156. +40 −0 base-foc/include/foc_pd_session/foc_pd_session.h
  157. +35 −0 base-foc/include/signal_session/foc_source.h
  158. +91 −0 base-foc/include/signal_session/source_client.h
  159. +39 −0 base-foc/include/signal_session/source_rpc_object.h
  160. +4 −0 base-foc/lib/mk/arm/ipc.mk
  161. +8 −0 base-foc/lib/mk/arm/platform.inc
  162. +8 −0 base-foc/lib/mk/arm/startup.mk
  163. +5 −0 base-foc/lib/mk/arm/syscalls.mk
  164. +3 −0 base-foc/lib/mk/cap_alloc.mk
  165. +5 −0 base-foc/lib/mk/core_printf.mk
  166. +6 −0 base-foc/lib/mk/env.mk
  167. +5 −0 base-foc/lib/mk/ipc.inc
  168. +14 −0 base-foc/lib/mk/l4re_support.mk
  169. +5 −0 base-foc/lib/mk/lock.mk
  170. +3 −0 base-foc/lib/mk/pager.mk
  171. +69 −0 base-foc/lib/mk/platform.inc
  172. +6 −0 base-foc/lib/mk/platform_pbxa9/platform.mk
  173. +6 −0 base-foc/lib/mk/platform_vea9x4/platform.mk
  174. +4 −0 base-foc/lib/mk/raw_server.mk
  175. +3 −0 base-foc/lib/mk/server.mk
  176. +3 −0 base-foc/lib/mk/thread.mk
  177. +5 −0 base-foc/lib/mk/x86/syscalls.mk
  178. +3 −0 base-foc/lib/mk/x86_32/ipc.mk
  179. +13 −0 base-foc/lib/mk/x86_32/platform.mk
  180. +8 −0 base-foc/lib/mk/x86_32/startup.mk
  181. +3 −0 base-foc/lib/mk/x86_64/ipc.mk
  182. +13 −0 base-foc/lib/mk/x86_64/platform.mk
  183. +8 −0 base-foc/lib/mk/x86_64/startup.mk
  184. +60 −0 base-foc/mk/l4_pkg.mk
  185. +52 −0 base-foc/mk/spec-foc.mk
  186. +37 −0 base-foc/mk/spec-foc_arm.mk
  187. +4 −0 base-foc/mk/spec-foc_pbxa9.mk
  188. +4 −0 base-foc/mk/spec-foc_vea9x4.mk
  189. +25 −0 base-foc/mk/spec-foc_x86_32.mk
  190. +30 −0 base-foc/mk/spec-foc_x86_64.mk
  191. +14 −0 base-foc/patches/README
  192. +21 −0 base-foc/patches/crtn_arm_binutils_2.21.1.patch
  193. +15 −0 base-foc/patches/fix_exception_ip.patch
  194. +241 −0 base-foc/patches/foc_single_step_x86.patch
  195. +20 −0 base-foc/patches/timer_arm.patch
  196. +13 −0 base-foc/patches/vexpress_detection.patch
  197. +203 −0 base-foc/run/env
  198. +30 −0 base-foc/src/base/console/core_console.h
  199. +107 −0 base-foc/src/base/env/cap_sel_alloc.cc
  200. +27 −0 base-foc/src/base/ipc/arm/pager.cc
  201. +29 −0 base-foc/src/base/ipc/arm/pager_exception.cc
  202. +317 −0 base-foc/src/base/ipc/ipc.cc
  203. +110 −0 base-foc/src/base/ipc/pager.cc
  204. +29 −0 base-foc/src/base/ipc/x86/pager_exception.cc
  205. +35 −0 base-foc/src/base/ipc/x86_32/pager.cc
  206. +42 −0 base-foc/src/base/ipc/x86_64/pager.cc
  207. +108 −0 base-foc/src/base/lock/lock_helper.h
  208. +183 −0 base-foc/src/base/pager/pager.cc
  209. +39 −0 base-foc/src/base/server/server.cc
  210. +200 −0 base-foc/src/base/thread/thread.cc
  211. +51 −0 base-foc/src/base/thread/thread_bootstrap.cc
  212. +67 −0 base-foc/src/base/thread/thread_start.cc
  213. +5 −0 base-foc/src/bootstrap/target.mk
  214. +16 −0 base-foc/src/core/arm/platform_arm.cc
  215. +25 −0 base-foc/src/core/arm/platform_thread.cc
  216. +7 −0 base-foc/src/core/arm/target.mk
  217. +230 −0 base-foc/src/core/cap_session_component.cc
  218. +87 −0 base-foc/src/core/cpu_session_extension.cc
  219. +118 −0 base-foc/src/core/include/cap_session_component.h
  220. +155 −0 base-foc/src/core/include/cpu_session_component.h
  221. +113 −0 base-foc/src/core/include/irq_session_component.h
  222. +66 −0 base-foc/src/core/include/map_local.h
  223. +57 −0 base-foc/src/core/include/pd_session_component.h
  224. +157 −0 base-foc/src/core/include/platform.h
  225. +116 −0 base-foc/src/core/include/platform_pd.h
  226. +164 −0 base-foc/src/core/include/platform_thread.h
  227. +117 −0 base-foc/src/core/include/util.h
  228. +92 −0 base-foc/src/core/io_mem_session_support.cc
  229. +150 −0 base-foc/src/core/irq_session_component.cc
  230. +23 −0 base-foc/src/core/pd_session_extension.cc
  231. +500 −0 base-foc/src/core/platform.cc
  232. +174 −0 base-foc/src/core/platform_pd.cc
  233. +307 −0 base-foc/src/core/platform_thread.cc
  234. +27 −0 base-foc/src/core/ram_session_support.cc
  235. +35 −0 base-foc/src/core/rm_session_support.cc
  236. +77 −0 base-foc/src/core/signal_source_component.cc
  237. +57 −0 base-foc/src/core/target.inc
  238. +68 −0 base-foc/src/core/thread_start.cc
  239. +27 −0 base-foc/src/core/x86/platform_thread.cc
  240. +44 −0 base-foc/src/core/x86/platform_x86.cc
  241. +8 −0 base-foc/src/core/x86/target.mk
  242. +4 −0 base-foc/src/kernel/pbxa9/target.mk
  243. +21 −0 base-foc/src/kernel/target.inc
  244. +4 −0 base-foc/src/kernel/vea9x4/target.mk
  245. +4 −0 base-foc/src/kernel/x86_32/target.mk
  246. +4 −0 base-foc/src/kernel/x86_64/target.mk
  247. +29 −0 base-foc/src/platform/_main_helper.h
  248. +36 −0 base-foc/src/platform/_main_parent_cap.h
  249. +5 −0 base-foc/src/sigma0/target.mk
  250. +7 −0 base-host/README
  251. +13 −0 base-host/etc/specs.conf
  252. +4 −0 base-host/etc/tools.conf
  253. +39 −0 base-host/include/base/ipc_msgbuf.h
  254. +139 −0 base-host/include/base/ipc_pager.h
  255. +45 −0 base-host/include/base/native_types.h
  256. +1 −0 base-host/lib/mk/core_printf.mk
  257. +6 −0 base-host/lib/mk/env.mk
  258. +3 −0 base-host/lib/mk/ipc.mk
  259. +4 −0 base-host/lib/mk/lock.mk
  260. +3 −0 base-host/lib/mk/pager.mk
  261. +3 −0 base-host/lib/mk/printf_stdio.mk
  262. +24 −0 base-host/src/base/env/parent.cc
  263. +77 −0 base-host/src/base/ipc/ipc.cc
  264. +52 −0 base-host/src/base/lock/lock_helper.h
  265. +57 −0 base-host/src/base/pager/pager.cc
  266. +90 −0 base-host/src/core/context_area.cc
  267. +30 −0 base-host/src/core/core_rm_session.cc
  268. +48 −0 base-host/src/core/include/core_rm_session.h
  269. +50 −0 base-host/src/core/include/platform.h
  270. +59 −0 base-host/src/core/include/platform_pd.h
  271. +106 −0 base-host/src/core/include/platform_thread.h
  272. +60 −0 base-host/src/core/include/util.h
  273. +27 −0 base-host/src/core/io_mem_session_support.cc
  274. +58 −0 base-host/src/core/io_port_session_component.cc
  275. +54 −0 base-host/src/core/irq_session_component.cc
  276. +41 −0 base-host/src/core/platform.cc
  277. +55 −0 base-host/src/core/platform_pd.cc
  278. +77 −0 base-host/src/core/platform_thread.cc
  279. +29 −0 base-host/src/core/ram_session_support.cc
  280. +26 −0 base-host/src/core/rm_session_support.cc
  281. +49 −0 base-host/src/core/target.inc
  282. +1 −0 base-host/src/core/target.mk
  283. +23 −0 base-host/src/core/thread_host.cc
  284. +35 −0 base-host/src/lib/printf_stdio/printf_stdio.cc
  285. +1 −0 base-linux/README
  286. +22 −0 base-linux/etc/specs.conf
  287. +64 −0 base-linux/include/base/ipc_msgbuf.h
  288. +89 −0 base-linux/include/base/local_interface.h
  289. +135 −0 base-linux/include/base/native_types.h
  290. +43 −0 base-linux/include/base/pager.h
  291. +379 −0 base-linux/include/base/platform_env.h
  292. +47 −0 base-linux/include/linux_dataspace/client.h
  293. +47 −0 base-linux/include/linux_dataspace/linux_dataspace.h
  294. +59 −0 base-linux/include/rm_session/client.h
  295. +92 −0 base-linux/lib/import/import-lx_hybrid.mk
  296. +6 −0 base-linux/lib/import/import-syscall.mk
  297. +5 −0 base-linux/lib/mk/core_printf.mk
  298. +6 −0 base-linux/lib/mk/env.mk
  299. +5 −0 base-linux/lib/mk/ipc.mk
  300. +5 −0 base-linux/lib/mk/lock.mk
Sorry, we could not display the entire diff because too many files (2,462) changed.
View
280 LICENSE
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
View
182 README
@@ -1,4 +1,180 @@
-Genode OS Framework
-This is just the initial version without any code yet. We're on the
-way to migrate the current released version into Git.
+ =================================
+ Genode Operating System Framework
+ =================================
+
+
+This is the source tree of the reference implementation of the Genode OS
+architecture. For a general overview about the architecture, please refer to
+the project's official website:
+
+:Official project website for the Genode OS Framework:
+
+ [http://genode.org/documentation/general-overview]
+
+The current implementation can be compiled for 8 different kernels: Linux,
+L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, Codezero, and a custom
+kernel for the MicroBlaze architecture. Whereas the Linux version serves us as
+development vehicle and enables us to rapidly develop the generic parts of the
+system, the actual target platforms of the framework are microkernels. There
+is no "perfect" microkernel - and neither should there be one. If a microkernel
+pretended to be fit for all use cases, it wouldn't be "micro". Hence, all
+microkernels differ in terms of their respective features, complexity, and
+supported hardware architectures.
+
+Genode allows the use of each of the kernels listed above with a rich set of
+device drivers, protocol stacks, libraries, and applications in a uniform way.
+For developers, the framework provides an easy way to target multiple different
+kernels instead of tying the development to a particular kernel technology. For
+kernel developers, Genode contributes advanced workloads, stress-testing their
+kernel, and enabling a variety of application use cases that would not be
+possible otherwise. For users and system integrators, it enables the choice of
+the kernel that fits best with the requirements at hand for the particular
+usage scenario.
+
+
+Directory overview
+##################
+
+The Genode source tree is composed of the following subdirectories:
+
+:'doc':
+
+ This directory contains general documentation. Please consider the following
+ document for a quick guide to get started with the framework:
+
+ ! doc/getting_started.txt
+
+ If you are curious about the ready-to-use components that come with the
+ framework, please review the components overview:
+
+ ! doc/components.txt
+
+:'base':
+
+ This directory contains the source-code repository of the fundamental
+ frameworks and interfaces of Genode. Furthermore, it contains the generic
+ parts of core.
+
+:'os':
+
+ This directory contains the non-base OS components such as the init process,
+ device drivers, and basic system services.
+
+:'demo':
+
+ This directory contains the source-code repository of various services and
+ applications that we use for demonstration purposes. For example, a graphical
+ application launcher called Launchpad and the Scout tutorial browser.
+
+:'base-<platform>':
+ These directories contain platform-specific source-code repositories
+ complementing the 'base' repository. The following platforms are supported:
+
+ :'linux':
+ Linux kernel (both x86_32 and x86_64)
+
+ :'pistachio':
+ L4ka::Pistachio kernel developed at University of Karlsruhe.
+ See [http://genode.org/community/wiki/GenodeOnL4kaPistachio]
+
+ :'fiasco':
+ L4/Fiasco kernel developed at University of Technology Dresden.
+ See [http://genode.org/community/wiki/GenodeOnL4Fiasco]
+
+ :'foc':
+ Fiasco.OC is a modernized version of the Fiasco microkernel with a
+ completely revised kernel interface fostering capability-based
+ security. It is not compatible with L4/Fiasco.
+ See [http://genode.org/community/wiki/GenodeOnFiascoOC]
+
+ :'okl4':
+ OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
+ See [http://genode.org/community/wiki/GenodeOnOKL4]
+
+ :'nova':
+ NOVA hypervisor developed at University of Technology Dresden
+ See [http://genode.org/community/wiki/GenodeOnNOVA]
+
+ :'codezero':
+ Codezero microkernel developed by B-Labs
+ See [http://genode.org/community/wiki/GenodeOnCodezero]
+
+ :'mb':
+ Support for running Genode natively on the MicroBlaze softcore CPU.
+ See [http://genode.org/community/wiki/GenodeOnMicroBlaze]
+
+ :'host':
+ Pseudo platform documenting the interface between the generic and
+ platform-specific parts of the base framework. This is not a functional
+ base platform.
+
+:'tool':
+
+ Source-code management tools and scripts. Please refer to the README file
+ contained in the directory.
+
+:'hello_tutorial':
+
+ Tutorial for creating a simple client-server scenario with Genode. This
+ repository includes documentation and the complete source code.
+
+:'libports':
+
+ This source-code repository contains ports of popular open-source libraries
+ to Genode, most importantly the C library. The repository contains no
+ upstream source code but means to download the code and adapt it to Genode.
+ For instructions about how to use this mechanism, please consult the README
+ file at the top level of the repository.
+
+:'linux_drivers':
+
+ This source-code repository contains the device driver environment for
+ executing Linux device drivers natively on Genode.
+
+:'dde_ipxe':
+
+ This source-code repository contains the device driver environment for
+ executing drivers of the iPXE project.
+
+:'qt4':
+
+ This source-code repository contains the Genode version of Qt4 framework.
+ Please find more information about using Qt4 with Genode in the repository's
+ 'README' file.
+
+:'ports':
+
+ This source-code repository hosts ports of 3rd-party applications to
+ Genode. The repository does not contain upstream source code but provides
+ a mechanism for downloading the official source distributions and adapt
+ them to the Genode environment. The used mechanism is roughly the same
+ as used for the 'libports' repository. Please consult 'libports/README'
+ for further information.
+
+:'ports-<platform>':
+
+ These platform-specific source-code repositories contain software that
+ capitalizes special features of the respective kernel platform. I.e.,
+ for the OKL4 base platform, a port of OKLinux is provided in 'ports-okl4'.
+ For the Fiasco.OC platform, 'ports-foc' hosts a port of the L4Linux
+ kernel. For further information, please refer to the README file at the
+ top level of the respective repository.
+
+:'gems':
+
+ This source-code repository contains Genode applications that use
+ both native Genode interfaces as well as features of other high-level
+ repositories, in particular shared libraries provided by 'libports'.
+
+
+Contact
+#######
+
+The best way to get in touch with Genode developers and users is the project's
+mailing list. Please feel welcome to join in!
+
+:Genode Mailing Lists:
+
+ [http://genode.org/community/mailing-lists]
+
View
44 base-codezero/Makefile
@@ -0,0 +1,44 @@
+#
+# \brief Download and prepare the Codezero kernel
+# \author Norman Feske
+# \date 2011-08-05
+#
+
+VERBOSE ?= @
+ECHO = @echo
+GIT_URL = git://git.l4dev.org/codezero.git
+GIT_REV = 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8
+CONTRIB_DIR = contrib
+PATCHES = $(shell find patches -name *.patch)
+
+#
+# Print help information by default
+#
+help::
+
+prepare: $(CONTRIB_DIR)
+
+help::
+ $(ECHO)
+ $(ECHO) "Check out upstream source code of the Codezero kernel"
+ $(ECHO)
+ $(ECHO) "The source code will be located at the '$(CONTRIB_DIR)/' directory."
+ $(ECHO)
+ $(ECHO) "--- available commands ---"
+ $(ECHO) "prepare - checkout upstream source codes"
+ $(ECHO) "clean - remove upstream source codes"
+ $(ECHO)
+
+$(CONTRIB_DIR)/.git:
+ $(VERBOSE)git clone $(GIT_URL) $(CONTRIB_DIR)
+
+$(CONTRIB_DIR): $(CONTRIB_DIR)/.git
+ $(VERBOSE)cd $(CONTRIB_DIR); git reset --hard $(GIT_REV)
+ $(ECHO) "applying patches to '$(CONTRIB_DIR)/'"
+ $(VERBOSE)for i in $(PATCHES); do patch -d $@ -p1 < $$i; done
+
+.PHONY: $(CONTRIB_DIR)
+
+clean::
+ $(VERBOSE)rm -rf $(CONTRIB_DIR)
+
View
3 base-codezero/README
@@ -0,0 +1,3 @@
+This repository contains the port of Genode to the Codezero microkernel
+For instructions about using Genode with Codezero, please refer to
+'doc/codezero.txt'.
View
240 base-codezero/config/vpb926.cml
@@ -0,0 +1,240 @@
+#
+# Automatically generated, don't edit
+#
+# Generated on: furnace
+# At: Fri, 05 Aug 2011 21:48:00 +0000
+# Linux version 2.6.32-33-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #70-Ubuntu SMP Thu Jul 7 21:09:46 UTC 2011
+
+#
+# Codezero Microkernel Configurator
+#
+
+#
+# Main architecture
+#
+CONFIG_ARCH_ARM=y
+
+
+#
+# ARM Architecture Configuration
+#
+
+#
+# ARM Platform Type
+#
+CONFIG_PLATFORM_PB926=y
+CONFIG_PLATFORM_PBA9=n
+CONFIG_PLATFORM_BEAGLE=n
+CONFIG_PLATFORM_EB=n
+
+
+#
+# ARM Processor Type
+#
+CONFIG_CPU_ARM926=y
+
+
+
+#
+# Generic Processor Properties
+#
+CONFIG_ICACHE_DISABLE=n
+CONFIG_DCACHE_DISABLE=n
+
+
+#
+# Generic Kernel Properties
+#
+CONFIG_PREEMPT_DISABLE=n
+CONFIG_DEBUG_ACCOUNTING=n
+CONFIG_DEBUG_SPINLOCKS=n
+CONFIG_SCHED_TICKS=1000
+
+
+#
+# Toolchain Prefix
+#
+CONFIG_TOOLCHAIN_USERSPACE="arm-none-linux-gnueabi-"
+CONFIG_TOOLCHAIN_KERNEL="arm-none-eabi-"
+
+
+#
+# Container Setup
+#
+CONFIG_CAPABILITIES=n
+CONFIG_CONTAINERS=1
+
+#
+# Container 0 Parameters
+#
+
+#
+# Container 0 Type
+#
+CONFIG_CONT0_TYPE_BAREMETAL=y
+CONFIG_CONT0_TYPE_POSIX=n
+CONFIG_CONT0_TYPE_LINUX=n
+
+
+#
+# Container 0 Options
+#
+CONFIG_CONT0_OPT_NAME="empty0"
+
+#
+# Baremetal Project Type
+#
+CONFIG_CONT0_BAREMETAL_PROJ_EMPTY=y
+CONFIG_CONT0_BAREMETAL_PROJ_HELLO_WORLD=n
+CONFIG_CONT0_BAREMETAL_PROJ_THREADS_DEMO=n
+CONFIG_CONT0_BAREMETAL_PROJ_TEST_SUITE=n
+CONFIG_CONT0_BAREMETAL_PROJ_UART_SERVICE=n
+CONFIG_CONT0_BAREMETAL_PROJ_TIMER_SERVICE=n
+CONFIG_CONT0_BAREMETAL_PROJ_KMI_SERVICE=n
+CONFIG_CONT0_BAREMETAL_PROJ_MUTEX_DEMO=n
+CONFIG_CONT0_BAREMETAL_PROJ_IPC_DEMO=n
+
+
+#
+# Container 0 Pager Linker Parameters
+#
+CONFIG_CONT0_PAGER_LMA=0x40000
+CONFIG_CONT0_PAGER_VMA=0x100000
+
+
+#
+# Container 0 Pager Physical Memory Regions (Capabilities)
+#
+CONFIG_CONT0_PAGER_PHYSMEM_REGIONS=1
+CONFIG_CONT0_PAGER_PHYS0_START=0x40000
+CONFIG_CONT0_PAGER_PHYS0_END=0x4000000
+
+
+#
+# Container 0 Pager Virtual Memory Regions (Capabilities)
+#
+CONFIG_CONT0_PAGER_VIRTMEM_REGIONS=1
+CONFIG_CONT0_PAGER_VIRT0_START=0x0
+CONFIG_CONT0_PAGER_VIRT0_END=0x50000000
+
+
+#
+# Container 0 Pager Capabilities
+#
+
+#
+# Container 0 Thread Pool Capability
+#
+CONFIG_CONT0_PAGER_CAP_THREADPOOL_USE=y
+CONFIG_CONT0_PAGER_CAP_THREADPOOL_SIZE=64
+
+
+#
+# Container 0 Space Pool Capability
+#
+CONFIG_CONT0_PAGER_CAP_SPACEPOOL_USE=y
+CONFIG_CONT0_PAGER_CAP_SPACEPOOL_SIZE=64
+
+
+#
+# Container 0 Mutex Pool Capability
+#
+CONFIG_CONT0_PAGER_CAP_MUTEXPOOL_USE=y
+CONFIG_CONT0_PAGER_CAP_MUTEXPOOL_SIZE=100
+
+
+#
+# Container 0 Map Pool Capability
+#
+CONFIG_CONT0_PAGER_CAP_MAPPOOL_USE=y
+CONFIG_CONT0_PAGER_CAP_MAPPOOL_SIZE=800
+
+
+#
+# Container 0 IPC Capability
+#
+CONFIG_CONT0_PAGER_CAP_IPC_USE=y
+CONFIG_CONT0_PAGER_CAP_IPC_TARGET_CURRENT_CONTAINER=y
+CONFIG_CONT0_PAGER_CAP_IPC_TARGET_CURRENT_PAGER_SPACE=n
+CONFIG_CONT0_PAGER_CAP_IPC_TARGET_OTHER_CONTAINER=n
+CONFIG_CONT0_PAGER_CAP_IPC_TARGET_OTHER_PAGER=n
+
+
+#
+# Container 0 IRQ Control Capability
+#
+CONFIG_CONT0_PAGER_CAP_IRQCTRL_USE=y
+
+
+#
+# Container 0 Custom Capability 0 Parameters
+#
+CONFIG_CONT0_PAGER_CAP_CUSTOM0_USE=n
+
+
+#
+# Container 0 Custom Capability 1 Parameters
+#
+CONFIG_CONT0_PAGER_CAP_CUSTOM1_USE=n
+
+
+#
+# Container 0 Custom Capability 2 Parameters
+#
+CONFIG_CONT0_PAGER_CAP_CUSTOM2_USE=n
+
+
+#
+# Container 0 Custom Capability 3 Parameters
+#
+CONFIG_CONT0_PAGER_CAP_CUSTOM3_USE=n
+
+
+
+#
+# Container 0 Global Capabilities
+#
+
+#
+# Container 0 IPC Capability
+#
+CONFIG_CONT0_CAP_IPC_USE=y
+CONFIG_CONT0_CAP_IPC_TARGET_CURRENT_CONTAINER=y
+CONFIG_CONT0_CAP_IPC_TARGET_CURRENT_PAGER_SPACE=n
+CONFIG_CONT0_CAP_IPC_TARGET_OTHER_CONTAINER=n
+CONFIG_CONT0_CAP_IPC_TARGET_OTHER_PAGER=n
+
+
+#
+# Container 0 Mutex Pool Capability
+#
+CONFIG_CONT0_CAP_MUTEXPOOL_USE=y
+CONFIG_CONT0_CAP_MUTEXPOOL_SIZE=100
+
+
+
+
+
+
+#
+# Derived symbols
+#
+CONFIG_CONT3_START_PC_ADDR=0xd0000000
+CONFIG_DEBUG_PERFMON_KERNEL=n
+CONFIG_CONT1_PAGER_LOAD_ADDR=0x1100000
+CONFIG_CONT2_START_PC_ADDR=0xc0000000
+CONFIG_CONT2_PAGER_VIRT_ADDR=0xc0000000
+CONFIG_RAM_BASE_PLAT=0
+CONFIG_CONT2_PAGER_LOAD_ADDR=0x2100000
+CONFIG_CONT1_PAGER_VIRT_ADDR=0xb0000000
+CONFIG_CONT3_PAGER_LOAD_ADDR=0x3100000
+CONFIG_SUBARCH_V5=y
+CONFIG_SUBARCH_V7=n
+CONFIG_SUBARCH_V6=n
+CONFIG_CONT0_PAGER_LOAD_ADDR=0x40000
+CONFIG_CONT0_PAGER_VIRT_ADDR=0x100000
+CONFIG_CONT3_PAGER_VIRT_ADDR=0xd0000000
+CONFIG_CONT0_START_PC_ADDR=0x100000
+CONFIG_CONT1_START_PC_ADDR=0xb0000000
+#
+# That's all, folks!
View
274 base-codezero/doc/codezero.txt
@@ -0,0 +1,274 @@
+
+ ==================================
+ Genode on the Codezero microkernel
+ ==================================
+
+
+ Norman Feske
+
+
+Codezero is a microkernel primarily targeted at ARM-based embedded systems.
+It is developed by the British company B-Labs.
+
+:B-Labs website:
+
+ [http://b-labs.co.uk]
+
+The Codezero kernel was first made publicly available in summer 2009. The
+latest version, documentation, and community resources are available at the
+project website:
+
+:Codezero project website:
+
+ [http://l4dev.org]
+
+As highlighted by the name of the project website, the design of the kernel is
+closely related to the family of L4 microkernels. In short, the kernel provides
+a minimalistic set of functionality for managing address spaces, threads, and
+communication between threads, but leaves complicated policy and device access
+to user-level components.
+
+
+Using Genode with Codezero
+##########################
+
+For using Codezero, please ensure to have Git, SCons, and Python installed as
+these tools are required for downloading and building the kernel. Furthermore,
+you will need to install the tool chain for ARM. For instructions on how to
+download and install the tool chain, please refer to:
+
+:[http://genode.org/download/tool-chain]:
+ Genode tool-chain
+
+To download the Codezero kernel and integrate it with Genode, issue
+
+! make prepare
+
+from the 'base-codezero/' directory. The Codezero kernel is fully supported by
+Genode's run mechanism. Therefore, you can run Genode scenarios using Qemu
+directly from the build directory. For a quick test, let's create a build
+directory for Codezero on the VersatilePB926 platform using Genode's
+'create_builddir' tool:
+
+! <genode-dir>/tool/create_builddir codezero_vpb926 BUILD_DIR=<build_dir>
+
+To execute the graphical Genode demo, change to the new created build directory
+and issue:
+
+! make run/demo
+
+
+Characteristics of the kernel
+#############################
+
+To put Codezero in relation to other L4 kernels, here is a quick summary on the
+most important design aspects as implemented with the version 0.3, and on how
+our port of Genode relates to them:
+
+* In the line of the original L4 interface, the kernel uses global name spaces
+ for kernel objects such as threads and address spaces.
+
+* For the interaction between a user thread and the kernel, the concept of
+ user-level thread-control blocks (UTCB) is used. A UTCB is a small
+ thread-specific region in the thread's virtual address space, which is
+ always mapped. Hence the access to the UTCB can never raise a page fault,
+ which makes it perfect for the kernel to access system-call arguments,
+ in particular IPC payload copied from/to user threads. In contrast to other
+ L4 kernels, the location of UTCBs within the virtual address space is managed
+ by the user land.
+
+ On Genode, core keeps track of the UTCB locations for all user threads.
+ This way, the physical backing store for the UTCB can be properly accounted
+ to the corresponding protection domain.
+
+* The kernel provides three kinds of synchronous inter-process communication
+ (IPC): Short IPC carries payload in CPU registers only. Full IPC copies
+ message payload via the UTCBs of the communicating parties. Extended IPC
+ transfers a variable-sized message from/to arbitrary locations of the
+ sender/receiver address spaces. During an extended IPC, page fault may
+ occur.
+
+ Genode solely relies on extended IPC, leaving the other IPC mechanisms to
+ future optimizations.
+
+* The scheduling of threads is based on hard priorities. Threads with the
+ same priority are executed in a round-robin fashion. The kernel supports
+ time-slice-based preemption.
+
+ Genode does not support Codezero priorities yet.
+
+* The original L4 interface leaves open the question on how to manage
+ and account kernel resources such as the memory used for page tables.
+ Codezero makes the accounting of such resources explicit, enables the
+ user-land to manage them in a responsible way, and prevent kernel-resource
+ denial-of-service problems.
+
+* In contrast to the original L4.v2 and L4.x0 interfaces, the kernel provides
+ no time source in the form of IPC timeouts to the user land. A time source
+ must be provided by a user-space timer driver. Genode employs such a timer
+ services on all platforms so that it is not effected by this limitation.
+
+In several ways, Codezero goes beyond the known L4 interfaces. The most
+noticeable addition is the support for so-called containers. A container is
+similar to a virtual machine. It is an execution environment that holds a set
+of physical resources such as RAM and devices. The number of containers and the
+physical resources assigned to them is static and is to be defined at build
+time. The code executed inside a container can be roughly classified into two
+cases. First, there are static programs that require strong isolation from the
+rest of the system but no classical operating-system infrastructure, for
+example special-purpose telecommunication stacks or cryptographic functionality
+of an embedded device. Second, there a kernel-like workload, which use the L4
+interface to substructure the container into address spaces, for example a
+paravirtualized Linux kernel that uses Codezero address spaces to protect Linux
+processes. Genode runs inside a container and facilitates Codezero's L4
+interface to implement its multi-server architecture.
+
+
+Behind the scenes
+#################
+
+The 'make prepare' mechanism checks out the kernel source code from the
+upstream Git repository to 'base-codezero/contrib'. When building the kernel
+from within a Genode build directory via 'make kernel', this directory won't be
+touched by the Genode build system. Instead, a snapshot of the 'contrib'
+directory is taken to '<build-dir>/kernel/codezero'. This is the place where
+the Codezero configuration and build processes are executed. By working with a
+build-directory-local snapshot, we ensure that the source tree remains
+untouched at all times. After having taken the snapshot, the Codezero kernel is
+configured using a configuration template specific for the hardware platform.
+The configuration comes in the form of a CML file located at
+'base-codezero/config/'. There is one CML file per supported platform named
+'<platform>.cml'. The configured Codezero build directory will reside at
+'<build-dir>/kernel/codezero/build/'. Finally, the Codezero build system is
+invoked to build the kernel.
+
+The two stages of building Codezero
+===================================
+
+The Codezero build system always performs the compilation of the kernel and the
+so-called containers as well as the integration of all these components into a
+final ELF image as one operation. When building just the kernel via 'make
+kernel', the final image will contain the default container0 that comes with
+the Codezero distribution. For integrating Genode into the final image, the
+content of the container0 must be replaced by the Genode binaries followed by
+another execution of 'kernel/codezero/build.py'. Now, the single-image will be
+re-created, including the Genode binaries. When using Genode's run mechanism,
+these steps are automated for you. For reference, please review the Codezero
+run environment at 'base-codezero/run/env'.
+
+By first building the kernel with Codezero's default container ('make kernel')
+and later replacing the container's content with Genode binaries, we
+optimize the work flow for building Genode components. The kernel is compiled
+only once, but the (quick) re-linking of the final image is done every time a
+run script is executed.
+
+In the run environment, you will see that we forcefully remove a file called
+'cinfo.c' from the build-directory-local snapshot of the Codezero source tree.
+This file is generated automatically by the Codezero build system and linked
+against the kernel. It contains the parameters of the containers executed on
+the kernel. Because we change the content of container0 each time when
+executing a run script, those parameter change. So we have to enforce to
+re-generation of the 'cinfo.c' file.
+
+How Genode ROM modules are passed into the final image
+======================================================
+
+The Codezero build system picks up any ELF files residing the container's
+directory wheres the file called 'main.elf' is considered to be the roottask
+(in Codezero speak called pager) of the container. For Genode, 'main.elf'
+corresponds to the core executable. All other boot modules are merged into an
+ELF file, which we merely use as a container for these binary data. This ELF
+file is linked such that it gets loaded directly after the core image (this is
+how core finds the boot modules). The process of archiving all boot modules
+into the single ELF file is automated via the 'base-codezero/tool/gen_romfs'
+tool. In the container's directory, the merged file is called 'modules.elf'.
+
+Adapting the source code of the kernel
+======================================
+
+For debugging and development you might desire to change the kernel code
+at times. You can safely do so within the 'base-codezero/contrib/' directory.
+When issuing the next 'make kernel' from the Genode build directory, your
+changes will be picked up. However, when working with run scripts, the kernel
+is not revisited each time. The kernel gets built only once if the
+'<build-dir>/kernel' directory does not exist, yet. If you work on the kernel
+source tree and wish to conveniently test the kernel with a run script, use
+
+! make kernel run/<run-script>
+
+This way, you make sure to rebuild the kernel prior executing the steps
+described in the run script.
+
+Tweaking the kernel configuration
+=================================
+
+The kernel configuration can be tweaked within '<build-dir>/kernel/codezero'.
+Just change to this directory and issue './build.py -C'. The next time you
+build the kernel via 'make kernel' your configuration will be applied.
+If you want to conserve your custom configuration, just copy the file
+'<build-dir>/kernel/codezero/build/config.cml'.
+
+Parameters of 'vpb926.cml' explained
+====================================
+
+The default configuration for the VersatilePB926 platform as found at
+'base-codzero/config/vpb926.cml' is paramaterized as follows:
+
+:Default pager parameters:
+! 0x40000 Pager LMA
+! 0x100000 Pager VMA
+These values are important because they are currently hard-wired in the
+linker script used by Genode. If you need to adopt these values, make
+sure to also update the Genode linker script located at
+'base-codezero/src/platform/genode.ld'.
+
+:Physical Memory Regions:
+! 1 Number of Physical Regions
+! 0x40000 Physical Region 0 Start Address
+! 0x4000000 Physical Region 0 End Address
+We only use 64MB of memory. The physical memory between 0 and 0x40000 is
+used by the kernel.
+
+:Virtual Memory Regions:
+! 1 Number of Virtual Regions
+! 0x0 Virtual Region 0 Start Address
+! 0x50000000 Virtual Region 0 End Address
+It is important to choose the end address such that the virtual memory
+covers the thread context area. The context area is defined at
+'base/include/base/thread.h'.
+
+
+Limitations
+###########
+
+At the current stage, the Genode version for Codezero is primarily geared
+towards the developers of Codezero as a workload to stress their kernel. It
+still has a number of limitations that would affect the real-world use:
+
+* Because the only platform supported out of the box by the official Codezero
+ source tree is the ARM-based Versatilebp board, Genode is currently tied to
+ this hardware platform.
+
+* The current timer driver at 'os/src/drivers/timer/codezero/' is a dummy
+ driver that just yields the CPU time instead of blocking. Is is not
+ suitable as time source.
+
+* The PL110 framebuffer driver at 'os/src/drivers/framebuffer/pl110/'
+ does only support the LCD display as provided by Qemu but it is not tested on
+ real hardware.
+
+* Even though Codezero provides priority-based scheduling, Genode does not
+ allow assigning priorities to Codezero processes, yet.
+
+As always, these limitations will be addressed as needed.
+
+
+Thanks
+######
+
+We want to thank the main developer of Codezero Bahadir Balban for his great
+responsiveness to our feature requests and questions. Without his help, the
+porting effort would have taken much more effort. We hope that our framework
+will be of value to the Codezero community.
+
+
View
1 base-codezero/etc/specs.conf
@@ -0,0 +1 @@
+SPECS = genode
View
33 base-codezero/include/arm/cpu/atomic.h
@@ -0,0 +1,33 @@
+/*
+ * \brief Atomic operations for ARM on codezero
+ * \author Norman Feske
+ * \date 2009-10-02
+ */
+
+/*
+ * Copyright (C) 2009-2011 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _INCLUDE__ARM__CPU__ATOMIC_H_
+#define _INCLUDE__ARM__CPU__ATOMIC_H_
+
+namespace Genode {
+
+ /**
+ * Atomic compare and exchange
+ *
+ * This function compares the value at dest with cmp_val.
+ * If both values are equal, dest is set to new_val. If
+ * both values are different, the value at dest remains
+ * unchanged.
+ *
+ * \return 1 if the value was successfully changed to new_val,
+ * 0 if cmp_val and the value at dest differ.
+ */
+ int cmpxchg(volatile int *dest, int cmp_val, int new_val);
+}
+
+#endif /* _INCLUDE__ARM__CPU__ATOMIC_H_ */
View
63 base-codezero/include/base/ipc_msgbuf.h
@@ -0,0 +1,63 @@
+/*
+ * \brief IPC message buffer
+ * \author Norman Feske
+ * \date 2009-10-02
+ */
+
+/*
+ * Copyright (C) 2009-2011 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _INCLUDE__BASE__IPC_MSGBUF_H_
+#define _INCLUDE__BASE__IPC_MSGBUF_H_
+
+namespace Genode {
+
+ /**
+ * IPC message buffer layout
+ */
+ class Msgbuf_base
+ {
+ protected:
+
+ size_t _size;
+ char _msg_start[]; /* symbol marks start of message */
+
+ public:
+
+ /*
+ * Begin of actual message buffer
+ */
+ char buf[];
+
+ /**
+ * Return size of message buffer
+ */
+ inline size_t size() const { return _size; };
+
+ /**
+ * Return address of message buffer
+ */
+ inline void *addr() { return &_msg_start[0]; };
+
+ } __attribute__((aligned(4)));
+
+ /**
+ * Instance of IPC message buffer with specified buffer size
+ */
+ template <unsigned BUF_SIZE>
+ class Msgbuf : public Msgbuf_base
+ {
+ public:
+
+ char buf[BUF_SIZE];
+
+ Msgbuf() { _size = BUF_SIZE; }
+
+ } __attribute__((aligned(4)));
+}
+
+#endif /* _INCLUDE__BASE__IPC_MSGBUF_H_ */
View
169 base-codezero/include/base/ipc_pager.h
@@ -0,0 +1,169 @@
+/*
+ * \brief Dummy pager support for Genode
+ * \author Norman Feske
+ * \date 2009-10-02
+ */
+
+/*
+ * Copyright (C) 2009-2011 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _INCLUDE__BASE__IPC_PAGER_H_
+#define _INCLUDE__BASE__IPC_PAGER_H_
+
+#include <base/ipc.h>
+#include <base/stdint.h>
+#include <base/native_types.h>
+
+namespace Genode {
+
+ class Mapping
+ {
+ private:
+
+ addr_t _from_phys_addr;
+ addr_t _to_virt_addr;
+ size_t _num_pages;
+ bool _writeable;
+
+ enum { PAGE_SIZE_LOG2 = 12 };
+
+ public:
+
+ /**
+ * Constructor
+ */
+ Mapping(addr_t dst_addr, addr_t src_addr,
+ bool write_combined, unsigned l2size = PAGE_SIZE_LOG2,
+ bool rw = true)
+ :
+ _from_phys_addr(src_addr),
+ _to_virt_addr(dst_addr),
+ _num_pages(1 << (l2size - PAGE_SIZE_LOG2)),
+ _writeable(rw)
+ { }
+
+ /**
+ * Construct invalid mapping
+ */
+ Mapping() : _num_pages(0) { }
+
+ /**
+ * Prepare map operation
+ *
+ * No preparations are needed on Codezero because all mapping
+ * originate from the physical address space.
+ */
+ void prepare_map_operation() { }
+
+ addr_t from_phys() const { return _from_phys_addr; }
+ addr_t to_virt() const { return _to_virt_addr; }
+ size_t num_pages() const { return _num_pages; }
+ bool writeable() const { return _writeable; }
+ };
+
+
+ /**
+ * Special paging server class
+ */
+ class Ipc_pager : public Native_capability
+ {
+ private:
+
+ Native_thread_id _last; /* faulted thread */
+ addr_t _pf_addr; /* page-fault address */
+ addr_t _pf_ip; /* instruction pointer of faulter */
+ bool _pf_write; /* true on write fault */
+
+ Mapping _reply_mapping;
+
+// protected:
+//
+// /**
+// * Wait for pagefault
+// */
+// void _wait();
+//
+// /**
+// * Send page-fault reply and wait for next page fault
+// */
+// void _reply_and_wait();
+
+ public:
+
+ /**
+ * Constructor
+ */
+ Ipc_pager();
+
+ /**
+ * Wait for a new page fault received as short message IPC
+ */
+ void wait_for_fault();
+
+ /**
+ * Reply current page-fault and wait for a new one
+ */
+ void reply_and_wait_for_fault();
+
+ /**
+ * Request instruction pointer of current page fault
+ */
+ addr_t fault_ip() { return _pf_ip; }
+
+ /**
+ * Request fault address of current page fault
+ */
+ addr_t fault_addr() { return _pf_addr; }
+
+ /**
+ * Set parameters for next reply
+ */
+ void set_reply_mapping(Mapping m) { _reply_mapping = m; }
+
+ /**
+ * Set destination for next reply
+ */
+ void set_reply_dst(Native_capability pager_object) {
+ _last = pager_object.local_name(); }
+
+ /**
+ * Answer call without sending a mapping
+ *
+ * This function is used to acknowledge local calls from one of
+ * core's region-manager sessions.
+ */
+ void acknowledge_wakeup();
+
+ /**
+ * Return thread ID of last faulter
+ */
+ Native_thread_id last() const { return _last; }
+
+ /**
+ * Return badge for faulting thread
+ */
+ unsigned long badge() const { return _last.tid; }
+
+ /**
+ * Return true if page fault was a write fault
+ */
+ bool is_write_fault() const { return _pf_write; }
+
+ /**
+ * Return true if last fault was an exception
+ */
+ bool is_exception() const
+ {
+ /*
+ * Reflection of exceptions is not supported on this platform.
+ */
+ return false;
+ }
+ };
+}
+
+#endif /* _INCLUDE__BASE__IPC_PAGER_H_ */
View
143 base-codezero/include/base/native_types.h
@@ -0,0 +1,143 @@
+/*
+ * \brief Dummy definitions for native types used for compiling unit tests
+ * \author Norman Feske
+ * \date 2009-10-02
+ */
+
+/*
+ * Copyright (C) 2009-2011 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _INCLUDE__BASE__NATIVE_TYPES_H_
+#define _INCLUDE__BASE__NATIVE_TYPES_H_
+
+namespace Codezero {
+
+ struct l4_mutex;
+
+ enum { NILTHREAD = -1 };
+}
+
+namespace Genode {
+
+ class Platform_thread;
+
+ struct Native_thread_id
+ {
+ int tid;
+
+ /**
+ * Pointer to thread's running lock
+ *
+ * Once initialized (see 'lock_helper.h'), it will point to the
+ * '_running_lock' field of the thread's 'Native_thread' structure,
+ * which is part of the thread context. This member variable is
+ * used by the lock implementation only.
+ */
+ struct Codezero::l4_mutex *running_lock;
+
+ Native_thread_id() { }
+
+ /**
+ * Constructor (used as implicit constructor)
+ */
+ Native_thread_id(int l4id) : tid(l4id), running_lock(0) { }
+
+ Native_thread_id(int l4id, Codezero::l4_mutex *rl) : tid(l4id), running_lock(rl) { }
+ };
+
+ struct Native_thread
+ {
+ Native_thread_id l4id;
+
+ /**
+ * Only used in core
+ *
+ * For 'Thread' objects created within core, 'pt' points to the
+ * physical thread object, which is going to be destroyed on
+ * destruction of the 'Thread'.
+ */
+ Platform_thread *pt;
+ };
+
+ /**
+ * Empty UTCB type expected by the thread library
+ *
+ * On this kernel, UTCBs are not placed within the the context area. Each
+ * thread can request its own UTCB pointer using the kernel interface.
+ * However, we use the 'Native_utcb' member of the thread context to
+ * hold thread-specific data, i.e. the running lock used by the lock
+ * implementation.
+ */
+ struct Native_utcb
+ {
+ private:
+
+ /**
+ * Prevent construction
+ *
+ * A UTCB is never constructed, it is backed by zero-initialized memory.
+ */
+ Native_utcb();
+
+ /**
+ * Backing store for per-thread running lock
+ *
+ * The size of this member must equal 'sizeof(Codezero::l4_mutex)'.
+ * Unfortunately, we cannot include the Codezero headers here.
+ */
+ int _running_lock;
+
+ public:
+
+ Codezero::l4_mutex *running_lock() {
+ return (Codezero::l4_mutex *)&_running_lock; }
+ };
+
+ inline bool operator == (Native_thread_id t1, Native_thread_id t2) { return t1.tid == t2.tid; }
+ inline bool operator != (Native_thread_id t1, Native_thread_id t2) { return t1.tid != t2.tid; }
+
+ /*
+ * Because Codezero does not support local names for capabilities, a Genode
+ * capability consists of the global thread ID and a global object ID, not
+ * protected by the kernel when transmitted as IPC payloads.
+ */
+ class Native_capability
+ {
+ private:
+
+ Native_thread_id _tid; /* global thread ID */
+ int _local_name; /* global unique object ID */
+
+ public:
+
+ /**
+ * Default constructor creates invalid capability
+ */
+ Native_capability()
+ : _local_name(0) { _tid.tid = Codezero::NILTHREAD; }
+
+ /**
+ * Constructor for hand-crafting capabilities
+ *
+ * This constructor is only used internally be the framework.
+ */
+ Native_capability(Native_thread_id tid, int local_name)
+ : _tid(tid), _local_name(local_name) { }
+
+ bool valid() const { return _tid.tid != Codezero::NILTHREAD; }
+
+ int local_name() const { return _local_name; }
+ int dst() const { return _tid.tid; }
+
+ Native_thread_id tid() const { return _tid; }
+ };
+
+ typedef int Native_connection_state;
+}
+
+
+#endif /* _INCLUDE__BASE__NATIVE_TYPES_H_ */
View
0 base-codezero/include/codezero/dummies/stdio.h
No changes.
View
0 base-codezero/include/codezero/dummies/string.h
No changes.
View
76 base-codezero/include/codezero/syscalls.h
@@ -0,0 +1,76 @@
+/*
+ * \brief Aggregate Codezero syscall bindings
+ * \author Norman Feske
+ * \date 2010-02-16
+ */
+
+/*
+ * Copyright (C) 2010-2011 Genode Labs GmbH
+ *
+ * This file is part of the Genode OS framework, which is distributed
+ * under the terms of the GNU General Public License version 2.
+ */
+
+#ifndef _INCLUDE__CODEZERO__SYSCALLS_H_
+#define _INCLUDE__CODEZERO__SYSCALLS_H_
+
+/*
+ * Codezero headers happen to include the compiler's 'stdarg.h'. If this
+ * happened within the 'Codezero' namespace below, we would not be able to
+ * include 'stdarg.h' later on into the root namespace (stdarg's include guards
+ * would prevent this. Therefore, we make sure to include the file into the
+ * root namespace prior processing any Codezero headers.
+ */
+#include <stdarg.h>
+
+namespace Codezero { extern "C" {
+
+/* make Codezero includes happy */
+extern char *strncpy(char *dest, const char *src, __SIZE_TYPE__);
+extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__);
+
+/*
+ * Work around the problem of C++ keywords being used as
+ * argument names in the Codezero API headers.
+ */
+#define new _new_
+#define virtual _virtual_
+#define printf(A, ...)
+
+#include <l4lib/macros.h>
+#include <l4lib/arch/arm/syscalls.h>
+#include <l4lib/arch/arm/syslib.h>
+#include <l4lib/ipcdefs.h>
+#include <l4lib/init.h>
+#include <l4lib/mutex.h>
+#include <l4/api/thread.h>
+#include <l4/api/irq.h>
+#include <l4lib/exregs.h>
+#include <l4/lib/list.h> /* needed for capability.h */
+#include <l4/generic/capability.h>
+#include <l4/generic/cap-types.h>
+#include <l4/arch/arm/exception.h>
+#include <l4/arch/arm/io.h>
+
+#undef new
+#undef virtual
+#ifdef max
+#undef max
+#endif
+#undef printf
+} }
+
+namespace Codezero {
+
+ /**
+ * Return thread ID of the calling thread
+ */
+ inline int thread_myself()
+ {
+ struct task_ids ids = { 0, 0, 0 };
+ l4_getid(&ids);
+ return ids.tid;
+ }
+}
+
+#endif /* _INCLUDE__CODEZERO__SYSCALLS_H_ */
View
9 base-codezero/lib/mk/arm/startup.mk
@@ -0,0 +1,9 @@
+LIBS = cxx lock l4
+SRC_S = crt0.s
+SRC_CC = _main.cc
+INC_DIR += $(REP_DIR)/src/platform
+INC_DIR += $(BASE_DIR)/src/platform
+INC_DIR += $(REP_DIR)/include/codezero/dummies
+
+vpath crt0.s $(BASE_DIR)/src/platform/arm
+vpath _main.cc $(dir $(call select_from_repositories,src/platform/_main.cc))
View
3 base-codezero/lib/mk/arm_v5/l4.mk
@@ -0,0 +1,3 @@
+LIBS += l4_arm_v5
+
+include $(REP_DIR)/lib/mk/l4.inc
View
9 base-codezero/lib/mk/arm_v5/l4_arm_v5.mk
@@ -0,0 +1,9 @@
+LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4
+
+INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libc/include
+
+SRC_C += $(notdir $(wildcard $(LIBL4_DIR)/src/arch/arm/v5/*.c))
+SRC_S += $(notdir $(wildcard $(LIBL4_DIR)/src/arch/arm/v5/*.S))
+
+vpath %.c $(LIBL4_DIR)/src/arch/arm/v5
+vpath %.S $(LIBL4_DIR)/src/arch/arm/v5
View
3 base-codezero/lib/mk/codezero_cml.inc
@@ -0,0 +1,3 @@
+ifeq ($(filter-out $(SPECS),platform_vpb926),)
+CODEZERO_CML = $(REP_DIR)/config/vpb926.cml
+endif
View
13 base-codezero/lib/mk/cxx.mk
@@ -0,0 +1,13 @@
+#
+# Additional symbols we need to keep when using the arm-none-linux-gnueabi
+# tool chain
+#
+KEEP_SYMBOLS += __aeabi_ldivmod __aeabi_uldivmod __dynamic_cast
+KEEP_SYMBOLS += _ZN10__cxxabiv121__vmi_class_type_infoD0Ev
+
+#
+# Override sources of the base repository with our changed version
+#
+vpath exception.cc $(REP_DIR)/src/base/cxx
+
+include $(BASE_DIR)/lib/mk/cxx.mk
View
4 base-codezero/lib/mk/ipc.mk
@@ -0,0 +1,4 @@
+SRC_CC = ipc.cc pager.cc
+INC_DIR += $(REP_DIR)/include/codezero/dummies
+
+vpath %.cc $(REP_DIR)/src/base/ipc
View
43 base-codezero/lib/mk/l4.inc
@@ -0,0 +1,43 @@
+LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4
+
+SRC_C += init.c irq.c mutex.c
+SRC_C += arch/arm/exregs.c
+SRC_S += $(addprefix arch/arm/,syscalls.S new_thread.S)
+SRC_C += $(addprefix lib/,addr.c bit.c idpool.c)
+SRC_C += $(addprefix lib/thread/,init.c thread.c)
+SRC_C += $(addprefix lib/cap/,cap.c read.c)
+
+INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libc/include
+INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libmem/include
+INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libmem
+
+vpath % $(LIBL4_DIR)/src
+
+#
+# The libl4 source files uses macros defined in macros.h but do not
+# explicitly include the 'macros.h' header file.
+#
+CC_OPT += -include $(LIBL4_DIR)/include/l4lib/macros.h
+
+#
+# Resolve conflicts with built-in functions
+#
+CC_OPT += -fno-builtin-pow
+
+#
+# During the compilation of the libl4 file 'thread.c', the 'l4id_t' type
+# is used without prior inclusion of 'types.h'. Furthermore, 'types.h'
+# has a wrong include guard, so we take care of this problem using a
+# wrapper.
+#
+CC_OPT_lib_thread_thread += -include fix_include_types.h
+CC_OPT_arch_arm_exregs += -include fix_include_types.h
+
+lib/thread/thread.o arch/arm/exregs.o: fix_include_types.h
+
+fix_include_types.h:
+ @echo "#include <l4lib/arch/arm/types.h>" > $@
+ @echo "#define __L4LIB_ARM_TYPES_H___" >> $@
+
+CC_OPT += -std=gnu99
+
View
7 base-codezero/lib/mk/lock.mk
@@ -0,0 +1,7 @@
+SRC_CC = lock.cc cmpxchg.cc
+
+INC_DIR += $(REP_DIR)/include/codezero/dummies
+INC_DIR += $(REP_DIR)/src/base/lock
+
+vpath lock.cc $(BASE_DIR)/src/base/lock
+vpath cmpxchg.cc $(REP_DIR)/src/base/lock
View
4 base-codezero/lib/mk/pager.mk
@@ -0,0 +1,4 @@
+SRC_CC = pager.cc
+INC_DIR += $(REP_DIR)/include/codezero/dummies
+
+vpath pager.cc $(REP_DIR)/src/base/pager
View
6 base-codezero/lib/mk/pl011/core_printf.mk
@@ -0,0 +1,6 @@
+SRC_CC = core_printf.cc
+LIBS = cxx console
+INC_DIR += $(REP_DIR)/src/base/console/pl011
+INC_DIR += $(REP_DIR)/include/codezero/dummies
+
+vpath core_printf.cc $(BASE_DIR)/src/base/console
View
33 base-codezero/lib/mk/platform.mk
@@ -0,0 +1,33 @@
+#
+# Create prerequisites for building Genode for Codezero
+#
+
+#
+# Execute the rules in this file only at the second build stage when we know
+# about the complete build settings, e.g., the 'CROSS_DEV_PREFIX'.
+#
+ifeq ($(called_from_lib_mk),yes)
+
+include $(REP_DIR)/lib/mk/codezero_cml.inc
+
+all: $(BUILD_BASE_DIR)/include/l4/config.h
+
+$(BUILD_BASE_DIR)/include/l4/config.h: $(CODEZERO_CML)
+ $(VERBOSE)mkdir -p $(dir $@)
+ $(VERBOSE)$(CODEZERO_DIR)/tools/cml2header.py -i $^ -o $@
+
+#
+# Codezero's 'macros.h' includes the file "config.h", expected to be located in
+# the same directory (using #include "config.h"). However, 'config.h' is
+# generated into the source tree by the Codezero configuration system. Since we
+# do not want to pollute the source tree, we create a shadow copy of 'macros.h'
+# in the same directory as our generated 'config.h'.
+#
+all: $(BUILD_BASE_DIR)/include/l4/macros.h
+
+$(BUILD_BASE_DIR)/include/l4/macros.h: $(CODEZERO_DIR)/include/l4/macros.h
+ $(VERBOSE)mkdir -p $(dir $@)
+ $(VERBOSE)ln -s $^ $@
+
+endif
+
View
5 base-codezero/lib/mk/thread.mk
@@ -0,0 +1,5 @@
+SRC_CC = thread.cc thread_start.cc thread_bootstrap.cc
+INC_DIR += $(REP_DIR)/include/codezero/dummies
+
+vpath thread_start.cc $(REP_DIR)/src/base/thread
+vpath %.cc $(BASE_DIR)/src/base/thread
View
56 base-codezero/mk/spec-codezero.mk
@@ -0,0 +1,56 @@
+#
+# Specifics for the Codezero kernel API
+#
+
+#
+# Read default and builddir-specific config files
+#
+# In these config files, we expect to find the definition of CODEZERO_DIR
+#
+-include $(call select_from_repositories,etc/codezero.conf)
+-include $(BUILD_BASE_DIR)/etc/codezero.conf
+
+ifeq ($(CODEZERO_DIR),)
+$(error Could not find the definition of CODEZERO_DIR in etc/codezero.conf)
+endif
+
+#
+# Convert path to absolute directory
+#
+absdir = $(shell readlink -f $(1))
+
+#
+# Headers generated within the build directory
+# (see 'lib/mk/platform.mk')
+#
+INC_DIR += $(BUILD_BASE_DIR)/include
+
+#
+# Codezero headers
+#
+CODEZERO_ABS_DIR = $(call absdir,$(CODEZERO_DIR))
+
+INC_DIR += $(CODEZERO_ABS_DIR)/include
+INC_DIR += $(CODEZERO_ABS_DIR)/conts/userlibs/libl4/include
+INC_DIR += $(CODEZERO_ABS_DIR)/conts/userlibs/libdev/uart/include
+
+#
+# Codezero-specific startup code
+#
+PRG_LIBS += startup
+
+#
+# Allow programs to test for the Codezero kernel
+#
+# This is needed by the 'pl050/irq_handler.h' to handle the interrupt semantics
+# of Codezero.
+#
+CC_OPT += -D__CODEZERO__
+
+#
+# Clean rules for removing the side effects of building the platform
+#
+clean_includes:
+ $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/include
+
+cleanall: clean_includes
View
13 base-codezero/mk/spec-codezero_arm.mk
@@ -0,0 +1,13 @@
+#
+# Specifics for Codezero on ARM
+#
+SPECS += codezero
+
+#
+# Linker options specific for ARM
+#
+LD_TEXT_ADDR ?= 0x02000000
+
+CC_OPT += -D__ARCH__=arm
+
+include $(call select_from_repositories,mk/spec-codezero.mk)
View
9 base-codezero/mk/spec-codezero_arm_v5.mk
@@ -0,0 +1,9 @@
+#
+# Specifics for Codezero on ARMv5
+#
+
+SPECS += codezero_arm
+
+CC_OPT += -D__SUBARCH__=v5
+
+include $(call select_from_repositories,mk/spec-codezero_arm.mk)
View
6 base-codezero/mk/spec-codezero_platform_vpb926.mk
@@ -0,0 +1,6 @@
+SPECS += codezero_arm_v5 platform_vpb926
+
+CC_OPT += -D__PLATFORM__=pb926
+
+include $(call select_from_repositories,mk/spec-codezero_arm_v5.mk)
+include $(call select_from_repositories,mk/spec-platform_vpb926.mk)
View
67 base-codezero/patches/README
@@ -0,0 +1,67 @@
+This directory contains patches of the Codezero kernel that are needed for the
+integration with Genode. Furthermore, some patches address issues with recent
+tool chains not yet supported by the official Codezero verison.
+
+:binutils-2.21.patch:
+
+ The GNU assembler of binutils-2.21 complains with an error that was ignored
+ by previous binutils versions:
+
+ "Error: .size expression for ... does not evaluate to a constant"
+
+ This error seems to occur if the argument of 'BEGIN_PROC' does not match
+ the argument of 'END_PROC'. The patch fixes such inconsistencies in the
+ code.
+
+:gcc_shared_enabled.patch:
+
+ Codezero expect the tool chain to be used for the kernel to not support
+ shared libraries. This is the case for Codesourcery's arm-non-eabi
+ tool chain. Such tool chains use to incorporate both libgcc and libgcc_eh
+ into the single libgcc.a library. In contrast, for tool chains built with
+ '--enable-shared', libgcc does not contain the functions of libgcc_eh. Hence,
+ one symbol called '__aeabi_unwind_cpp_pr0' referenced by libgcc and normally
+ provided by libgcc_eh remains unresolved. There are two possible solutions
+ for this problem: We could link libgcc_eh to the 'final.elf' image as
+ expected by libgcc. However, this way, we will need to implement the
+ the environment expected by libgcc_eh. For Codezero, this is pointless
+ because no C++ is used. The second option is to provide a dummy symbol
+ for '__aeabi_unwind_cpp_pr0' just to make the linker happy. This patch
+ adds such a dummy symbol to 'loader/main.c'.
+
+:libc_search_dir.patch:
+
+ The userlibs are build with w/o '-nostdinc'. Consequently, the standard
+ search paths of the tool chain are used. Because the user land is
+ normally build with the Codesourcery tool chain 'arm-none-linux-gnueabi',
+ the complete glibc headers (that come with the tool chain) end up in
+ the default search path. Coincidentally, the userlibs SConstruct file
+ misses to supply the Codezero libc headers, which goes undetected because
+ headers such as 'stdio.h' are silently taken from the tool chain's libc.
+ This patch supplies Codezero's libc include-search path for building
+ the userlibs. This enables the userlibs to be built with tool chains
+ that do not come with a complete libc.
+
+:scons-2.0.1.patch:
+
+ SCons 2.0.1 complains about the 'build_dir' argument being renamed to
+ 'variant_dir'. This patch renames the argument where needed for building
+ the kernel and the default container.
+
+:set_fixed_pager.patch:
+
+ At some point, Codezero abandoned the facility to define the pager for a
+ given thread via the exregs system call. Instead, the kernel hard-wires the
+ creator of the thread as the thread's pager. This is conflicting with
+ Genode's way of creating and paging threads. On the current version of Genode
+ for Codezero, all threads are paged by one thread (thread 3 happens to be the
+ global pager) within core. As a work-around to Codezero's current limitation,
+ we define thread 3 to be the pager of all threads.
+
+:gcc_4_6_1_fixes.patch:
+
+ Version 4.6.1 of GCC is more picky about dead code than previous versions and
+ warns about unused variables. Because Codezero is build with the '-Werror'
+ flag, these warnings cause the kernel build to fail. The patch fixes those
+ warnings by removing the variables in question.
+
View
33 base-codezero/patches/binutils-2.21.patch
@@ -0,0 +1,33 @@
+diff --git a/src/arch/arm/vectors.S b/src/arch/arm/vectors.S
+index 0475389..62f3c38 100644
+--- a/src/arch/arm/vectors.S
++++ b/src/arch/arm/vectors.S
+@@ -503,7 +503,7 @@ BEGIN_PROC(arm_irq_exception_basic)
+ mov lr, pc
+ ldr pc, =do_irq
+ ldmfd sp!, {r0-r3, pc}^
+-END_PROC(arm_irq_exception)
++END_PROC(arm_irq_exception_basic)
+
+ /* Minimal IRQ state saved on irq stack right after irq vector enters: */
+ #define IRQ_R0 0
+diff --git a/conts/userlibs/libc/src/arch-arm/memcpy.S b/conts/userlibs/libc/src/arch-arm/memcpy.S
+index 383f5d2..b4df27f 100644
+--- a/conts/userlibs/libc/src/arch-arm/memcpy.S
++++ b/conts/userlibs/libc/src/arch-arm/memcpy.S
+@@ -57,4 +57,4 @@ BEGIN_PROC(memcpy)
+ bne last
+ 1:
+ pop {r0, r4 - r11, pc}
+-END_PROC(_memcpy)
++END_PROC(memcpy)