mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
Compare commits
485 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
307e2eefa6 | ||
|
|
5a27a9f0a6 | ||
|
|
75b0880255 | ||
|
|
55506f432e | ||
|
|
b767391d34 | ||
|
|
e5eb1000c7 | ||
|
|
9b69c93736 | ||
|
|
66006a0313 | ||
|
|
3a9e5cbd8c | ||
|
|
5a0bae2ad7 | ||
|
|
9e6f3be806 | ||
|
|
2df6cd64d4 | ||
|
|
3c23ddb2d5 | ||
|
|
d137f0f2bf | ||
|
|
3350c6bf53 | ||
|
|
11ee72eaa6 | ||
|
|
f1d2d7251d | ||
|
|
74dd356dcd | ||
|
|
ed54bb2724 | ||
|
|
ac478081c3 | ||
|
|
1abff01c66 | ||
|
|
aa8e5c5016 | ||
|
|
39378b9982 | ||
|
|
47b5ba3a89 | ||
|
|
a8c27b51b5 | ||
|
|
a66df55f4e | ||
|
|
e367c99864 | ||
|
|
11d242de85 | ||
|
|
1ff7de62f6 | ||
|
|
d17134baef | ||
|
|
1668983efa | ||
|
|
c246a0d194 | ||
|
|
ac70dfd9fe | ||
|
|
8c6e3c6251 | ||
|
|
8cddd86a4c | ||
|
|
d424134073 | ||
|
|
bfe5208e0e | ||
|
|
6d1d8afa57 | ||
|
|
35314c8397 | ||
|
|
6b1923bbe6 | ||
|
|
3680a79f38 | ||
|
|
56d98824e3 | ||
|
|
2936cbebfd | ||
|
|
d198f07890 | ||
|
|
2a916b143d | ||
|
|
6f27f85c3d | ||
|
|
44e6870e4e | ||
|
|
54045771c7 | ||
|
|
31888c610a | ||
|
|
752ddc153e | ||
|
|
37044eaad8 | ||
|
|
ff8d790f93 | ||
|
|
c3b415ffe8 | ||
|
|
e34f211dc1 | ||
|
|
27b71a0876 | ||
|
|
101b868cd4 | ||
|
|
f3cce99933 | ||
|
|
191cfd2c53 | ||
|
|
c10ad4ff01 | ||
|
|
f572cf8a05 | ||
|
|
73de12999d | ||
|
|
bc70d67ee7 | ||
|
|
46e4c3dc9b | ||
|
|
245dfc2c08 | ||
|
|
81ff63c66b | ||
|
|
4506912f6e | ||
|
|
20c9b02326 | ||
|
|
3bfd2aa3c9 | ||
|
|
71b621775b | ||
|
|
a62859bb39 | ||
|
|
6a2aa903ca | ||
|
|
b2a1129bd9 | ||
|
|
a640be9a24 | ||
|
|
e233fe0b71 | ||
|
|
716eab21e3 | ||
|
|
3daa8a3d04 | ||
|
|
8982bc5843 | ||
|
|
2a698ffd5f | ||
|
|
b84a47b4db | ||
|
|
5fc9f68941 | ||
|
|
c3d4802ac8 | ||
|
|
f9ccfe3a04 | ||
|
|
0423369f7f | ||
|
|
7598f09295 | ||
|
|
8e50464a1a | ||
|
|
a09172aa7e | ||
|
|
f045b1c680 | ||
|
|
fc6c2537ee | ||
|
|
900c795df2 | ||
|
|
f539cf1231 | ||
|
|
5afad64586 | ||
|
|
b0b4c3c7fa | ||
|
|
040cd95580 | ||
|
|
e143683196 | ||
|
|
1616295179 | ||
|
|
7aff1895bf | ||
|
|
2b2007bc3f | ||
|
|
c58de0d80e | ||
|
|
5755245609 | ||
|
|
166672fe16 | ||
|
|
e05d26567d | ||
|
|
8899d9cb6d | ||
|
|
08550c6ed9 | ||
|
|
c0a2388978 | ||
|
|
cec3ca6a70 | ||
|
|
82e35326b7 | ||
|
|
daf67f7baa | ||
|
|
a258caa7ab | ||
|
|
eb16ad3ad9 | ||
|
|
9f9510ddb1 | ||
|
|
3087b72438 | ||
|
|
b63941f456 | ||
|
|
2e0e767f93 | ||
|
|
b314430118 | ||
|
|
8ab0638be9 | ||
|
|
b9c234a341 | ||
|
|
7186c45de6 | ||
|
|
976833f171 | ||
|
|
2d50552522 | ||
|
|
9fb08e045a | ||
|
|
56c637c1f6 | ||
|
|
b4c5fb2d29 | ||
|
|
a98e9c1822 | ||
|
|
948cb3ef0a | ||
|
|
1d5aa4ca7e | ||
|
|
b1b3c7bf34 | ||
|
|
316134caf8 | ||
|
|
fcde1d668c | ||
|
|
bffddd7e15 | ||
|
|
aefacc9310 | ||
|
|
cb68f9a320 | ||
|
|
8d2f2b0101 | ||
|
|
d3a4ed87d1 | ||
|
|
a98b94f80e | ||
|
|
184bffbce3 | ||
|
|
acab2515e1 | ||
|
|
7ee3e98551 | ||
|
|
6699290766 | ||
|
|
c43bd472ac | ||
|
|
6deb80f66d | ||
|
|
852b799cd4 | ||
|
|
96649c716d | ||
|
|
14c8380507 | ||
|
|
98a4cb27b2 | ||
|
|
971b531d58 | ||
|
|
40b8da8755 | ||
|
|
6e9fa10e65 | ||
|
|
23ff3b1877 | ||
|
|
dc17e16897 | ||
|
|
48738bbf63 | ||
|
|
1073d6077b | ||
|
|
50b8094d0d | ||
|
|
cebef2bda3 | ||
|
|
8ca4f7a794 | ||
|
|
8845ca52c9 | ||
|
|
a73c6470f6 | ||
|
|
d0db15031a | ||
|
|
4e00e8ac68 | ||
|
|
1aa6a2a4a1 | ||
|
|
89d3083c9f | ||
|
|
2316937e58 | ||
|
|
610b733133 | ||
|
|
e387d2098d | ||
|
|
2b321b9ce8 | ||
|
|
23f9761297 | ||
|
|
9efa3ceccf | ||
|
|
492bd39619 | ||
|
|
01643ccd94 | ||
|
|
227b539193 | ||
|
|
a3a8978d77 | ||
|
|
02ef3d13a3 | ||
|
|
6410bd7261 | ||
|
|
64f39c9a42 | ||
|
|
60ba210a6b | ||
|
|
41b9f6bd03 | ||
|
|
e74b53d5dd | ||
|
|
30e129a91b | ||
|
|
ee4619687b | ||
|
|
cffa4fddec | ||
|
|
9c31e18a4f | ||
|
|
6a186f6ed0 | ||
|
|
f58cc1e83c | ||
|
|
17feccbbcf | ||
|
|
5c4be9f99b | ||
|
|
856851bb3c | ||
|
|
5b376188da | ||
|
|
d0ebdfba4b | ||
|
|
627ecc44d2 | ||
|
|
6d1e417250 | ||
|
|
e3f301a540 | ||
|
|
72823eeddb | ||
|
|
08ae942d72 | ||
|
|
18130e3120 | ||
|
|
f92a6a9594 | ||
|
|
7857e830a3 | ||
|
|
dd96cba415 | ||
|
|
df53187265 | ||
|
|
50c809dfe5 | ||
|
|
9203b83f24 | ||
|
|
2b1a70d66d | ||
|
|
9f4b77c5c2 | ||
|
|
020758a2f1 | ||
|
|
d65beb970d | ||
|
|
520c36d77f | ||
|
|
1081af930d | ||
|
|
2c558de891 | ||
|
|
6bf4fd3340 | ||
|
|
c04561f026 | ||
|
|
20dc750d6a | ||
|
|
3f6ff39d76 | ||
|
|
b766387069 | ||
|
|
ee25dcbae3 | ||
|
|
44cfc414ee | ||
|
|
1d92631ef0 | ||
|
|
5bc3b53e63 | ||
|
|
6cb0f3bb71 | ||
|
|
25643fa00a | ||
|
|
d46ad98434 | ||
|
|
e13971fcf0 | ||
|
|
59d2a83f30 | ||
|
|
bed04f1f16 | ||
|
|
85ba3259f8 | ||
|
|
0b39b22e14 | ||
|
|
640b73f5ec | ||
|
|
8c22e5d535 | ||
|
|
9da422696b | ||
|
|
a08358dce9 | ||
|
|
2b021ec54b | ||
|
|
48e7d29686 | ||
|
|
bd7fe4160d | ||
|
|
d8e91908a2 | ||
|
|
92cb9eb06d | ||
|
|
4c4e7c64d0 | ||
|
|
b902f42482 | ||
|
|
e49a5ee19f | ||
|
|
50dd0dda38 | ||
|
|
4b9e1f1060 | ||
|
|
2dde77f62c | ||
|
|
c63bea825d | ||
|
|
f9d0e57b0e | ||
|
|
e4678a4dc1 | ||
|
|
c26d30dffc | ||
|
|
acb0ddd9ef | ||
|
|
493386ed27 | ||
|
|
461776a29c | ||
|
|
ed774253b6 | ||
|
|
6177424fa6 | ||
|
|
0ab49dff3a | ||
|
|
a1c0c99045 | ||
|
|
909c4c9ffc | ||
|
|
f655ac31f7 | ||
|
|
853378960c | ||
|
|
a2bb96723a | ||
|
|
331225dfcb | ||
|
|
23aac2954b | ||
|
|
3859e83a78 | ||
|
|
84dfb668d3 | ||
|
|
638fdeb2f5 | ||
|
|
2b6795df78 | ||
|
|
0c3dfbad65 | ||
|
|
18d24eec7b | ||
|
|
e9525f49fd | ||
|
|
c7df65e1da | ||
|
|
9ada3d3178 | ||
|
|
4b6b759739 | ||
|
|
eb236a1a10 | ||
|
|
8c060d6622 | ||
|
|
91b69edb72 | ||
|
|
5c63f7003e | ||
|
|
74e89727ee | ||
|
|
3789a75ed6 | ||
|
|
7920b57d34 | ||
|
|
ab79b0d5e0 | ||
|
|
5f2d92f916 | ||
|
|
7a70833ba1 | ||
|
|
72e1147cce | ||
|
|
c814d13737 | ||
|
|
fe1a0e5f65 | ||
|
|
2c9d2e1d32 | ||
|
|
dd933de84f | ||
|
|
88123bdbd5 | ||
|
|
a01b1793eb | ||
|
|
60fa8ade1a | ||
|
|
5c6f7bdea0 | ||
|
|
db3a5a3b02 | ||
|
|
a0d92fcdb8 | ||
|
|
c47e9751bd | ||
|
|
e9773f237e | ||
|
|
5e60a1b32f | ||
|
|
e2280a1650 | ||
|
|
06fe755f8c | ||
|
|
f6863e3f4b | ||
|
|
97bbc8f965 | ||
|
|
be8f16ac3e | ||
|
|
83e5a64864 | ||
|
|
d8b95c263b | ||
|
|
de8794321b | ||
|
|
663e8fad9b | ||
|
|
5b6fdc96fc | ||
|
|
d34bbbceb2 | ||
|
|
0005407832 | ||
|
|
9730c7e333 | ||
|
|
82991ba378 | ||
|
|
91345a1568 | ||
|
|
24b7accbf2 | ||
|
|
650267b425 | ||
|
|
759b9ed1ad | ||
|
|
9aff45ae8c | ||
|
|
75111c4f1a | ||
|
|
220d143e44 | ||
|
|
755d2cce05 | ||
|
|
519eb334e9 | ||
|
|
5456175d07 | ||
|
|
e652af7518 | ||
|
|
0150d02683 | ||
|
|
a01a423c91 | ||
|
|
f01b205c30 | ||
|
|
7c968d4c60 | ||
|
|
2166aef737 | ||
|
|
3726cafb28 | ||
|
|
f8c1379f15 | ||
|
|
64a4713fe6 | ||
|
|
826c81ac18 | ||
|
|
f42f946f3b | ||
|
|
7ea5884ffc | ||
|
|
6c1906e43e | ||
|
|
04cca1edb1 | ||
|
|
8701b7d517 | ||
|
|
2b2587fde9 | ||
|
|
bdaf79e3b8 | ||
|
|
8f849c9438 | ||
|
|
731a98c266 | ||
|
|
32e2ab85b0 | ||
|
|
9fc7519972 | ||
|
|
8ed6364388 | ||
|
|
1b4f894e2d | ||
|
|
cdb44850d3 | ||
|
|
b6c558dce9 | ||
|
|
1c6164a0c5 | ||
|
|
1d4bd10701 | ||
|
|
48fd034cfe | ||
|
|
2da239d0c8 | ||
|
|
96d021b9d4 | ||
|
|
a528aa097a | ||
|
|
b26ac3c4fb | ||
|
|
115a605658 | ||
|
|
6d0936ca98 | ||
|
|
c2f0bb4fa8 | ||
|
|
f9fbe34644 | ||
|
|
6de46dfd2e | ||
|
|
c4686a1196 | ||
|
|
ffbbf69959 | ||
|
|
d6bae1a9a3 | ||
|
|
ceb04d3c11 | ||
|
|
c4f8af2665 | ||
|
|
2b429ee84c | ||
|
|
0879a9570c | ||
|
|
6c30bf2667 | ||
|
|
78e18981fb | ||
|
|
5aec67d5bb | ||
|
|
2426c58b9f | ||
|
|
a608d48ddf | ||
|
|
2e62543fdb | ||
|
|
c0e88ec69e | ||
|
|
c7195c8652 | ||
|
|
24e65e2e39 | ||
|
|
d7da035115 | ||
|
|
70a3bb7465 | ||
|
|
94f64ef464 | ||
|
|
7f1641e460 | ||
|
|
e8b4e0be6d | ||
|
|
b121212b23 | ||
|
|
2d9d55a6d3 | ||
|
|
88f107e0f9 | ||
|
|
77c00bc26d | ||
|
|
df0bbe0b0e | ||
|
|
ce354d6fd9 | ||
|
|
bbf8a4f2ec | ||
|
|
aaea28ae85 | ||
|
|
67b3c23281 | ||
|
|
e77df44ed5 | ||
|
|
57ce50a3d4 | ||
|
|
818840ca6a | ||
|
|
a8cca8e1b3 | ||
|
|
4164c9edec | ||
|
|
dcc4b8c313 | ||
|
|
0efd908e27 | ||
|
|
e27ebd0368 | ||
|
|
cdb87a7c4f | ||
|
|
e0233604fa | ||
|
|
0ab74e61d7 | ||
|
|
afac1e86bb | ||
|
|
1460105f71 | ||
|
|
59014a50f1 | ||
|
|
02d07655ce | ||
|
|
702646a4a3 | ||
|
|
8763b6925a | ||
|
|
6ecbc419c0 | ||
|
|
e590d90bf6 | ||
|
|
a80d944944 | ||
|
|
c8ec7b6ffb | ||
|
|
32a227ce77 | ||
|
|
dce6e14e3e | ||
|
|
1f941d1c87 | ||
|
|
8f50b00f13 | ||
|
|
e17198570e | ||
|
|
be789ffcf1 | ||
|
|
ffd48e3f83 | ||
|
|
1779a0511b | ||
|
|
286edaed68 | ||
|
|
3f611fe00d | ||
|
|
6f3e9c12fb | ||
|
|
ae12f04354 | ||
|
|
6426d4098c | ||
|
|
fd533b0c93 | ||
|
|
0f8fcab3bd | ||
|
|
d5dc25adef | ||
|
|
20f961cbd8 | ||
|
|
dd13bbb1e2 | ||
|
|
2f8b3cfdaf | ||
|
|
f9a64b663c | ||
|
|
f7ad6cf4e6 | ||
|
|
36947cef3a | ||
|
|
21e86227bc | ||
|
|
4da7e89d6b | ||
|
|
e5ea76c689 | ||
|
|
2d15c6d990 | ||
|
|
ad24b25af0 | ||
|
|
985c01116b | ||
|
|
7fff1770e0 | ||
|
|
08541b68f7 | ||
|
|
92541c49a6 | ||
|
|
bb4ee67357 | ||
|
|
c1492da15b | ||
|
|
b585583ec7 | ||
|
|
6616bd4593 | ||
|
|
7e3bcb1e39 | ||
|
|
8eec092851 | ||
|
|
94afc1a340 | ||
|
|
ccb968ff7d | ||
|
|
53eb666ed0 | ||
|
|
3bf050ed30 | ||
|
|
45bcb7f48f | ||
|
|
37bae7bc1f | ||
|
|
5d434944eb | ||
|
|
9b21c88bc6 | ||
|
|
5309bda8b6 | ||
|
|
de87ecfc62 | ||
|
|
49b3d520a9 | ||
|
|
24b1f269be | ||
|
|
9212fc0dc6 | ||
|
|
50164336af | ||
|
|
0f052357ef | ||
|
|
686f53a5c3 | ||
|
|
ce1e6c16fb | ||
|
|
7ce19216f4 | ||
|
|
4a5b7be4e7 | ||
|
|
8c168d7943 | ||
|
|
be9e157a3d | ||
|
|
7db3e461ca | ||
|
|
5cf8c49cb8 | ||
|
|
bc2c7db4e9 | ||
|
|
ed52d5a211 | ||
|
|
6cdb823187 | ||
|
|
ebd0796fc0 | ||
|
|
539e5212ab | ||
|
|
6e15c6b707 | ||
|
|
5230adfd63 | ||
|
|
28fdc51a76 | ||
|
|
acc46f70b7 | ||
|
|
7898113f99 | ||
|
|
a9569eb41e | ||
|
|
7d12bdc8bc | ||
|
|
349c15dfe4 | ||
|
|
be994641ef | ||
|
|
40b31876d2 | ||
|
|
458b4d6fc4 | ||
|
|
555835c95b | ||
|
|
91cb3decdb | ||
|
|
4e98a0f64a | ||
|
|
dd9793cdc7 | ||
|
|
c5877b5575 | ||
|
|
6e481127ce | ||
|
|
ae43d13b90 | ||
|
|
b6c440852b |
2
README
2
README
@@ -13,7 +13,7 @@ the project's official website:
|
||||
[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
|
||||
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom
|
||||
kernel for running Genode directly on ARM-based hardware. 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
|
||||
|
||||
@@ -29,13 +29,6 @@ Applications and library infrastructure
|
||||
platform. This would allow Chrome to be considered as a secure interface to
|
||||
the web for use cases in the high-assurance domain.
|
||||
|
||||
:Qemu or Virtual Box on Genode:
|
||||
|
||||
Using Genode as hosting platform for virtual machines running in Qemu or
|
||||
Virtual Box would enable the execution of security-sensitive functions (for
|
||||
example cryptography) with a minimally-complex trusted computing base
|
||||
beside running Windows on the same machine.
|
||||
|
||||
:VNC server implementing Genode's framebuffer session interface:
|
||||
|
||||
With 'Input' and 'Framebuffer', Genode provides two low-level interfaces
|
||||
@@ -217,19 +210,6 @@ Device drivers
|
||||
decomposition of this solution such that the USB host driver and each USB
|
||||
device driver runs in a separate process.
|
||||
|
||||
:IOMMU support on the NOVA Hypervisor:
|
||||
|
||||
The NOVA hypervisor is the first open-source microkernel with thorough
|
||||
support for IOMMUs, which principally enables the use of untrusted device
|
||||
drivers alongside sensitive software on one machine. Without an IOMMU, each
|
||||
device driver for a device that operates with DMA, is able to indirectly
|
||||
access the whole physical memory through programming the device. With IOMMU,
|
||||
the physical memory addressable by DMA operations can be restrained per
|
||||
device. The goal of this challenge is to enhance Genode with I/O protection
|
||||
when running on the NOVA kernel. This would clear the way towards reusing
|
||||
complex untrusted device drivers running in dedicated device-driver OS
|
||||
instances.
|
||||
|
||||
:I/O Kit:
|
||||
|
||||
I/O Kit is the device-driver framework as used by the Darwin operating
|
||||
@@ -323,22 +303,6 @@ Runtime environments
|
||||
removed from the trusted computing base of Android, facilitating the use of
|
||||
this mobile OS in high-assurance settings.
|
||||
|
||||
:Vancouver VMM for Genode on the NOVA hypervisor:
|
||||
|
||||
Vancouver is the user-level virtual-machine monitor accompanying the NOVA
|
||||
hypervisor. It combines a VT-based CPU virtualization with a rich set of
|
||||
device models to run unmodified guest operating systems at near-native
|
||||
performance. Since NOVA is a supported base platform of Genode, running
|
||||
Vancouver in the dynamic Genode environment has become feasible. By running
|
||||
Vancouver on Genode instead of NOVA's original static userland would open up
|
||||
new use cases where the combination of faithful virtualization with dynamic
|
||||
applications is desired.
|
||||
|
||||
Genode 11.11 introduced the initial integration of Vancouver into Genode.
|
||||
This version of Vancouver is able to bootstrap another kernel (e.g.,
|
||||
Fiasco.OC) within the virtual machine. However, several pieces are missing
|
||||
for reaching the goal of running a fully-fledged Linux OS as guest.
|
||||
|
||||
:Runtime for the D programming language:
|
||||
|
||||
The D systems programming language was designed to overcome many gripes that
|
||||
@@ -359,12 +323,11 @@ Platforms
|
||||
:Evaluation of MP scheduling models on different Genode base platforms:
|
||||
|
||||
Several of Genode's supported base platforms come with multi-processor
|
||||
support, i.e., Linux, NOVA, L4ka::Pistachio, Codezero, and Fiasco.OC. Each of
|
||||
support, i.e., Linux, NOVA, L4ka::Pistachio, and Fiasco.OC. Each of
|
||||
these kernels follows a different approach for utilizing multiple CPUs. For
|
||||
example, Linux and Codezero manage the association of threads with CPUs
|
||||
largely transparent for user-level programs. In contrast, NOVA makes the use
|
||||
of multiple CPUs explicit and constraints the modes of IPC interaction of
|
||||
threads running on different CPUs. Furthermore, kernels differ with regard to
|
||||
example, Linux manages the association of threads with CPUs largely
|
||||
transparent for user-level programs - not so for the available microkernels.
|
||||
Furthermore, microkernels differ with reagrd to
|
||||
thread migration and scheduling. The goal of this project is to identify ways
|
||||
to support the SMP features of the respective kernels at Genode's API level
|
||||
such that SMP can be easily utilized by Genode programs in a largely kernel
|
||||
@@ -400,23 +363,6 @@ Platforms
|
||||
Finally, this project has the potential to ignite a further collaboration
|
||||
between the HelenOS and Genode communities.
|
||||
|
||||
:Support for the seL4 kernel:
|
||||
|
||||
The seL4 kernel developed by NICTA and OK-Labs is the first formally verified
|
||||
microkernel. It runs on the x86 and ARM architectures and supports the
|
||||
execution of a paravirtualized version of Linux on top. Even though seL4 is
|
||||
proprietary technology, a free binary release and the specification of the
|
||||
kernel API has been published early 2011. Being a capability-based kernel,
|
||||
seL4 is in the line of the current-generation L4 kernels alongside NOVA and
|
||||
Fiasco.OC. Genode already supports the latter two kernel, which hints at the
|
||||
feasibility to support seL4 as well. Currently, the seL4 kernel comes with a
|
||||
rather static user land, which is far from utilizing the full potential of
|
||||
the kernel with regard to dynamic resource management. By adapting Genode to
|
||||
seL4, a rich dynamic application workload would become available to this
|
||||
kernel, which could potentially spawn interest in extending the formal
|
||||
verification efforts at NICTA to the Genode system executing dynamic
|
||||
real-world applications.
|
||||
|
||||
:Support for the Barrelfish kernel:
|
||||
|
||||
[http://barrelfish.org - `Barrelfish] is a so-called multi-kernel OS designed
|
||||
|
||||
@@ -85,16 +85,16 @@ UART devices
|
||||
|
||||
The UART device drivers implement the UART-session interface.
|
||||
|
||||
:'os/src/drivers/uart/pl011':
|
||||
:'os/src/drivers/uart/spec/pl011':
|
||||
Driver for the PL011 UART as found on many ARM-based platforms.
|
||||
|
||||
:'os/src/drivers/uart/i8250':
|
||||
:'os/src/drivers/uart/spec/i8250':
|
||||
Driver for the i8250 UART as found on PC hardware.
|
||||
|
||||
:'os/src/drivers/uart/omap4':
|
||||
:'os/src/drivers/uart/spec/omap4':
|
||||
Driver for the UART as found on OMAP4-based hardware.
|
||||
|
||||
:'os/src/drivers/uart/exynos5':
|
||||
:'os/src/drivers/uart/spec/exynos5':
|
||||
Driver for the UART as found on Exynos-5-based hardware.
|
||||
|
||||
|
||||
@@ -109,15 +109,11 @@ input-session interfaces respectively.
|
||||
to resolve a dependency from an input session for scenarios where no user
|
||||
input is required.
|
||||
|
||||
:'os/src/drivers/input/fiasco_ux':
|
||||
Driver for the virtual hardware provided by the user-mode version of the
|
||||
Fiasco kernel.
|
||||
|
||||
:'os/src/drivers/input/ps2/x86':
|
||||
:'os/src/drivers/input/spec/ps2/x86':
|
||||
Driver for the 'i8042' PS/2 controller as found in x86 PCs. It supports both
|
||||
mouse (including ImPS/2, ExPS/2) and keyboard.
|
||||
|
||||
:'os/src/drivers/input/ps2/pl050':
|
||||
:'os/src/drivers/input/spec/ps2/pl050':
|
||||
Driver for the PL050 PS/2 controller as found on ARM platforms such as
|
||||
VersatilePB. The physical base address used by the driver is obtained at
|
||||
compile time from a header file called 'pl050_defs.h'. The version of the
|
||||
@@ -125,32 +121,37 @@ input-session interfaces respectively.
|
||||
is made available to the driver via the SPECS machinery of the Genode build
|
||||
system.
|
||||
|
||||
:'os/src/drivers/input/spec/imx53':
|
||||
Input driver for Egalaxy touchscreen and Freescale's MPR121
|
||||
capacitative touch buttons on i.MX53.
|
||||
|
||||
:'libports/src/drivers/framebuffer/vesa':
|
||||
Driver using VESA mode setting on x86 PCs. For more information, please refer
|
||||
to the README file in the driver directory.
|
||||
|
||||
:'os/src/drivers/framebuffer/pl11x':
|
||||
:'os/src/drivers/framebuffer/spec/pl11x':
|
||||
Driver for the PL110/PL111 LCD display.
|
||||
|
||||
:'os/src/drivers/framebuffer/omap4':
|
||||
:'os/src/drivers/framebuffer/spec/omap4':
|
||||
Driver for HDMI output on OMAP4 SoCs.
|
||||
|
||||
:'os/src/drivers/framebuffer/exynos5':
|
||||
:'os/src/drivers/framebuffer/spec/exynos5':
|
||||
Driver for HDMI output on Exynos-5 SoCs.
|
||||
|
||||
:'os/src/drivers/framebuffer/imx53':
|
||||
:'os/src/drivers/framebuffer/spec/imx53':
|
||||
Driver for LCD output on i.MX53 SoCs.
|
||||
|
||||
:'os/src/drivers/framebuffer/imx53':
|
||||
Driver for touchscreen input on i.MX53 quick start board.
|
||||
|
||||
:'os/src/drivers/framebuffer/rpi':
|
||||
:'os/src/drivers/framebuffer/spec/rpi':
|
||||
Driver for the HDMI output of the Raspberry Pi.
|
||||
|
||||
:'os/src/drivers/framebuffer/sdl':
|
||||
:'os/src/drivers/framebuffer/spec/sdl':
|
||||
Serves as both framebuffer and input driver on Linux using libSDL. This
|
||||
driver is only usable on the Linux base platform.
|
||||
|
||||
:'dde_linux/src/drivers/framebuffer/intel':
|
||||
Framebuffer driver for Intel i915 compatible graphic cards based on
|
||||
the Linux Intel KMS driver.
|
||||
|
||||
:'dde_linux/src/drivers/usb':
|
||||
USB driver that makes USB HID and USB storage devices available as input
|
||||
sessions and block session respectively. For examples of using this driver,
|
||||
@@ -162,19 +163,19 @@ Timer drivers
|
||||
=============
|
||||
|
||||
The timer driver located at 'os/src/drivers/timer' implements the timer-session
|
||||
interface. Technically, it is is both a device driver (accessing a timer
|
||||
interface. Technically, it is both a device driver (accessing a timer
|
||||
device) and a resource multiplexer (supporting multiple timer-session clients
|
||||
at the same time). Depending on the base platform, the implementation uses of
|
||||
at the same time). Depending on the base platform, the implementation uses
|
||||
different time sources. Time sources are either hardware timers, a time source
|
||||
provided by the kernel, or a pseudo time source (busy):
|
||||
|
||||
:'nova': NOVA kernel semaphores as time source
|
||||
:'codezero': busy time source
|
||||
:'okl4_x86': PIT as time source
|
||||
:'foc': IPC timeout as time source
|
||||
:'fiasco': IPC timeout as time source
|
||||
:'pistachio': IPC timeout as time source
|
||||
:'linux': nanosleep as time source
|
||||
:'hw': hardware timers depending on platform, e.g., PIT on x86
|
||||
|
||||
|
||||
Audio drivers
|
||||
@@ -184,7 +185,7 @@ Audio drivers implement the Audio_out session interface defined at
|
||||
'os/include/audio_out_session/' for playback and optionally the audio_in
|
||||
interface for recording.
|
||||
|
||||
:'os/src/drivers/audio/linux':
|
||||
:'os/src/drivers/audio/spec/linux':
|
||||
Uses ALSA as back-end on the Linux base platform and supports only playback.
|
||||
|
||||
:'dde_bsd/src/drivers/audio':
|
||||
@@ -199,21 +200,21 @@ Block drivers
|
||||
All block drivers implement the block-session interface defined at
|
||||
'os/include/block_session/'.
|
||||
|
||||
:'os/src/drivers/sd_card/pl180':
|
||||
:'os/src/drivers/sd_card/spec/pl180':
|
||||
Driver for SD-cards connected via the PL180 device as found on the PBX-A9
|
||||
platform.
|
||||
|
||||
:'os/src/drivers/sd_card/omap4':
|
||||
:'os/src/drivers/sd_card/spec/omap4':
|
||||
Driver for SD-cards connected to the SD-card controller of the OMAP4 SoC.
|
||||
|
||||
:'os/src/drivers/sd_card/exynos5':
|
||||
:'os/src/drivers/sd_card/spec/exynos5':
|
||||
Driver for SD-cards and eMMC connected to Exynos-5-based platforms.
|
||||
|
||||
:'os/src/drivers/sd_card/imx53':
|
||||
:'os/src/drivers/sd_card/spec/imx53':
|
||||
Driver for SD-cards connected to the Freescale i.MX53 platform like the
|
||||
Quick Start Board or the USB armory device.
|
||||
|
||||
:'os/src/drivers/sd_card/rpi':
|
||||
:'os/src/drivers/sd_card/spec/rpi':
|
||||
Driver for SD-cards connected to the Raspberry Pi.
|
||||
|
||||
:'dde_linux/src/drivers/usb':
|
||||
@@ -224,6 +225,9 @@ All block drivers implement the block-session interface defined at
|
||||
:'os/src/drivers/ahci':
|
||||
Driver for SATA disks and CD-ROMs on x86 PCs.
|
||||
|
||||
:'os/src/drivers/usb_block':
|
||||
USB Mass Storage Bulk-Only driver using the USB session interface.
|
||||
|
||||
|
||||
Network interface drivers
|
||||
=========================
|
||||
@@ -231,14 +235,18 @@ Network interface drivers
|
||||
All network interface drivers implement the NIC session interface
|
||||
defined at 'os/include/nic_session'.
|
||||
|
||||
:'os/src/drivers/nic/linux':
|
||||
:'os/src/drivers/nic/spec/linux':
|
||||
Driver that uses a Linux tap device as back end. It is only useful on the
|
||||
Linux base platform.
|
||||
|
||||
:'os/src/drivers/nic/lan9118':
|
||||
:'os/src/drivers/nic/spec/lan9118':
|
||||
Native device driver for the LAN9118 network adaptor as featured on the
|
||||
PBX-A9 platform.
|
||||
|
||||
:'os/src/drivers/nic/gem':
|
||||
Device driver for Cadence EMAC PS network adaptor as featured on the
|
||||
Xilinx Zynq.
|
||||
|
||||
:'dde_ipxe/src/drivers/nic':
|
||||
Device drivers ported from the iPXE project. Supported devices are Intel
|
||||
E1000 and pcnet32.
|
||||
@@ -254,15 +262,19 @@ defined at 'os/include/nic_session'.
|
||||
General-purpose I/O drivers
|
||||
===========================
|
||||
|
||||
:'os/src/drivers/gpio/omap4':
|
||||
:'os/src/drivers/gpio/spec/omap4':
|
||||
Driver for accessing the GPIO pins of OMAP4 platforms.
|
||||
|
||||
:'os/src/drivers/gpio/imx53':
|
||||
:'os/src/drivers/gpio/spec/imx53':
|
||||
Driver for accessing the GPIO pins of i.MX53 platforms.
|
||||
|
||||
:'os/src/drivers/gpio/rpi':
|
||||
:'os/src/drivers/gpio/spec/rpi':
|
||||
Driver for accessing the GPIO pins of Raspberry Pi platforms.
|
||||
|
||||
:'os/src/drivers/gpio/spec/exynos5':
|
||||
Driver for accessing the GPIO pins of Exynos4 platforms, e.g.,
|
||||
Odroid-X2.
|
||||
|
||||
|
||||
Resource multiplexers
|
||||
#####################
|
||||
@@ -369,13 +381,26 @@ Separate components:
|
||||
:'os/src/server/log_terminal':
|
||||
Adapter for forwarding terminal output to a LOG session.
|
||||
|
||||
:'libports/src/server/fs_log':
|
||||
:'os/src/server/fs_log':
|
||||
Adapter that writes LOG messages to files on a file system.
|
||||
|
||||
:'demo/src/server/nitlog':
|
||||
Provides a LOG session, printing log output on screen via a nitpicker
|
||||
session.
|
||||
|
||||
:'os/src/app/rom_logger':
|
||||
The rom_logger component requests a ROM session and writes the
|
||||
content of the ROM dataspace to the LOG.
|
||||
|
||||
:'os/src/server/rom_filter':
|
||||
The ROM filter provides a ROM module that depends on the content of
|
||||
other ROM modules steered by the filter configuration, e.g., dynamic
|
||||
switching between configuration variants dependent on the state of
|
||||
the system.
|
||||
|
||||
:'os/src/server/vfs':
|
||||
A file-system server using the VFS library and plugins as backend.
|
||||
|
||||
:'os/src/server/log_terminal':
|
||||
Forwards terminal output to a LOG session.
|
||||
|
||||
@@ -412,6 +437,12 @@ Separate components:
|
||||
A service that implements both the report session interface and the ROM
|
||||
session interface. It reflects incoming reports as ROM modules.
|
||||
|
||||
:'os/src/server/clipboard':
|
||||
This component is both a report service and a ROM service. The
|
||||
clients of the report service can issue new clipboard content, which
|
||||
is then propagated to the clients of the ROM service according to a
|
||||
configurable information-flow policy.
|
||||
|
||||
:'ports/src/app/openvpn':
|
||||
OpenVPN enables access to remote network resources through a secure tunnel
|
||||
by providing an encrypted connection to a remote host. It is plugged between
|
||||
|
||||
136
doc/news.txt
136
doc/news.txt
@@ -4,6 +4,142 @@
|
||||
===========
|
||||
|
||||
|
||||
Genode OS Framework release 16.02 | 2016-02-26
|
||||
##############################################
|
||||
|
||||
| Genode 16.02 introduces the RISC-V hardware architecture to the framework,
|
||||
| enables the secure pass-through of USB devices to virtual machines, and
|
||||
| updates the Muen separation kernel and the seL4 microkernel.
|
||||
|
||||
In contrast to the feature-oriented previous release, the new version focuses
|
||||
on diverse topics around low-level platform support. First, there is the
|
||||
addition of a new hardware architecture. With the addition of RISC-V,
|
||||
we anticipate future trustworthy open-source hardware platforms.
|
||||
|
||||
Second, as the major functional addition motivated by Genode's use as
|
||||
day-to-day OS, the new version adds the ability to assign USB devices to
|
||||
virtual machines in a dynamic yet secure way. This clears the way to cover
|
||||
many typical desktop work-flows with a Genode-based system.
|
||||
|
||||
With respect to the framework's underlying kernels, we are happy to
|
||||
announce the update of the Muen separation kernel to version 0.7 and the
|
||||
update of the seL4 kernel to version 2.1. The new version of Muen comes with
|
||||
welcome work-flow improvements. In fact, the separation kernel can now be
|
||||
targeted by Genode's automation tools in the same uniform way as all the other
|
||||
base platforms.
|
||||
|
||||
An in-depth coverage of these and many more improvements is provided by the
|
||||
[http:/documentation/release-notes/16.02 - release documentation of version 16.02...]
|
||||
|
||||
|
||||
Road Map for 2016 | 2016-01-15
|
||||
##############################
|
||||
|
||||
| We finalized the road map for 2016, which is primarily focused on extending
|
||||
| the community of users.
|
||||
|
||||
After having passed the point where a few enthusiasts use Genode as
|
||||
their day-to-day OS, it is time to extend the user base beyond
|
||||
the inner circle of developers. The road map outlines the plan to make Genode
|
||||
appealing to two target audiences, namely system builders and a narrow group
|
||||
of privacy-considerate end users. Hence, the overall theme of 2016 is to
|
||||
help a growing community to leverage the full potential of Genode.
|
||||
|
||||
The new road map is available at the [http:/about/road-map - road-map page].
|
||||
|
||||
|
||||
Genode at FOSDEM 2016 | 2016-01-12
|
||||
##################################
|
||||
|
||||
| There are four Genode-related talks scheduled at this year's FOSDEM,
|
||||
| covering the USB Armory, seL4, the Nix package manager, and Genode
|
||||
| as desktop OS.
|
||||
|
||||
[https://fosdem.org/2016 - FOSDEM] is the worlds biggest gathering of
|
||||
open-source and free-software enthusiasts. It takes place during 30 and 31 of
|
||||
January in Brussels. This year, Genode will show a strong presence again. On
|
||||
Saturday, Emery, Martin, and Norman will contribute to the
|
||||
[https://fosdem.org/2016/schedule/track/microkernels/ - microkernel devroom].
|
||||
On Sunday, we have the opportunity to present the current state of Genode as
|
||||
desktop OS at the desktops devroom. The summary of the Genode-related parts of
|
||||
the FOSDEM schedule is as follows.
|
||||
|
||||
Saturday 10:40 *An exploration of the seL4 kernel from Genode's perspective*
|
||||
_Microkernel devroom (K.4.601)_
|
||||
[https://fosdem.org/2016/schedule/event/microkernels_genode_sel4/ - abstract...]
|
||||
|
||||
Saturday 14:10 *Porting Nix to Genode - Package management without a canonical file system*
|
||||
_Microkernel devroom (K.4.601)_
|
||||
[https://fosdem.org/2016/schedule/event/microkernels_genode_nix/ - abstract...]
|
||||
|
||||
Saturday 15:55 *Genode's TrustZone demo on the USB Armory*
|
||||
_Microkernel devroom (K.4.601)_
|
||||
[https://fosdem.org/2016/schedule/event/microkernels_genode_usb_armory/ - abstract...]
|
||||
|
||||
Sunday 10:20 *Genode as Desktop OS*
|
||||
_Desktops devroom (K.4.401)_
|
||||
[https://fosdem.org/2016/schedule/event/genode_as_a_desktop_os/ - abstract...]
|
||||
|
||||
|
||||
The story behind Genode's TrustZone demo on the USB Armory | 2015-12-08
|
||||
#######################################################################
|
||||
|
||||
| Our latest article provides a look behind the scenes of the
|
||||
| development of Genode's support for the USB Armory platform.
|
||||
|
||||
The [http://inversepath.com/usbarmory - USB Armory] is a computer in the form
|
||||
of a USB stick. It normally runs Linux. But thanks to the ARM TrustZone
|
||||
capabilities of the device, it is possible to run Genode behind the back of
|
||||
Linux. This is useful for shielding sensitive information like cryptographic
|
||||
keys from Linux by exposing it to Genode only and thereby drastically reducing
|
||||
the attack surface. Even in the event Linux gets compromised, e.g., by a
|
||||
vulnerability in the USB stack, the secrets remain protected.
|
||||
|
||||
The article "The story behind Genode's TrustZone demo on the USB Armory"
|
||||
presents the adventurous story behind enabling this scenario. The biggest challenge
|
||||
was splitting the hardware platform into two worlds while maintaining the
|
||||
full functionality of Linux. The article goes on to explain the interplay
|
||||
between the secure world (Genode) and the normal world (Linux). Furthermore,
|
||||
it provides all the pointers needed to reproduce the scenario.
|
||||
[http:/documentation/articles/usb_armory - Read the article...]
|
||||
|
||||
|
||||
Genode OS Framework release 15.11 | 2015-11-30
|
||||
##############################################
|
||||
|
||||
| The primary focus of version 15.11 is the use of Genode as a desktop
|
||||
| OS. It vastly improves the GUI and audio stacks, features the port of Intel
|
||||
| KMS from Linux, extends the support for the USB Armory and Xilinx Zynq-7000,
|
||||
| and introduces new file-system infrastructure such as a VFS server.
|
||||
|
||||
Whereas the previous release marked the point where the very first user adopted
|
||||
Genode as day-to-day OS, we maintained the direction to create a Genode-based
|
||||
desktop OS. Most improvements of the new version are related to this goal:
|
||||
The GUI and audio stacks have become much more modular, dynamic, and flexible.
|
||||
With a new copy-and-paste mechanism, we added a universally expected
|
||||
desktop-integration feature in a unique way that mitigates the misuse of the
|
||||
clipboard as a covert communication mechanism. Those higher-level features
|
||||
are complemented with profound low-level device-driver improvements, most
|
||||
noteworthy the addition of the Intel KMS driver. This driver allows us to
|
||||
drive multiple displays and switch screen resolutions on the fly.
|
||||
|
||||
What high- and low-level components have in common, is the use of Genode's
|
||||
uniform configuration concept, which solves a variety of configuration
|
||||
problems with a single low-complexity mechanism. It allows us to modify
|
||||
all kinds of system configurations - ranging from the wireless driver
|
||||
to the style of window decoration - live by merely editing and saving
|
||||
text files.
|
||||
|
||||
Even though the majority of improvements are attributed to the use of
|
||||
Genode as desktop OS, the release also covers other areas.
|
||||
Xilinx Zynq-7000 has been added to the supported platforms, TrustZone on
|
||||
the USB Armory received a lot of attention, and a new VFS server makes
|
||||
Genode's file-system infrastructure much more flexible.
|
||||
|
||||
These and many more topics are covered in detail by the
|
||||
[http:/documentation/release-notes/15.11 - release documentation of version 15.11...]
|
||||
|
||||
|
||||
Genode OS Framework release 15.08 | 2015-08-31
|
||||
##############################################
|
||||
|
||||
|
||||
@@ -811,7 +811,7 @@ are mapped to VFS directories. For example
|
||||
! ...
|
||||
! <config>
|
||||
! ...
|
||||
! <libc> <vfs> <dir name="ram"> <fs label="ram" /> </vfs> </libc>
|
||||
! <libc> <vfs> <dir name="ram"> <fs label="ram" /> </dir> </vfs> </libc>
|
||||
! <share host="/ram/miezekatze" guest="miezekatze" />
|
||||
! ...
|
||||
! </config>
|
||||
|
||||
1429
doc/release_notes-15-11.txt
Normal file
1429
doc/release_notes-15-11.txt
Normal file
File diff suppressed because it is too large
Load Diff
652
doc/release_notes-16-02.txt
Normal file
652
doc/release_notes-16-02.txt
Normal file
@@ -0,0 +1,652 @@
|
||||
|
||||
|
||||
===============================================
|
||||
Release notes for the Genode OS Framework 16.02
|
||||
===============================================
|
||||
|
||||
Genode Labs
|
||||
|
||||
|
||||
|
||||
With version 16.02, we add RISC-V to the Genode's supported CPU architectures,
|
||||
enable the secure pass-through of individual USB devices to virtual machines,
|
||||
and update the support for the Muen and seL4 kernels.
|
||||
|
||||
Trustworthy hardware becomes an increasingly pressing problem. With each new
|
||||
generation of today's commodity hardware comes a dramatic increase of
|
||||
complexity, the addition of proprietary companion processors, and opaque
|
||||
firmware blobs. Even with a perfectly secure operating system, the user's
|
||||
privacy and security remains at risk as there is no way to assess the
|
||||
trustworthiness of our underlying hardware. RISC-V is a new hardware
|
||||
architecture that tries to overcome this problem by the means of open source
|
||||
and transparency. It is designed to scale from micro controllers to
|
||||
general-purpose computers, and to be both synthesizable as FPGA softcores and
|
||||
implementable in ASICs. The prospect of a scalable and trustworthy open-source
|
||||
hardware platform motivated us to add RISC-V to Genode's supported CPU
|
||||
architectures. Section [New support for the RISC-V CPU architecture] gives a
|
||||
brief overview of this line of work.
|
||||
|
||||
Thanks to the growing number of our regular developers using Genode as day to
|
||||
day OS, we create a natural incentive to address typical desktop-OS work
|
||||
flows. In particular, the new version comes with the ability to assign
|
||||
individual USB devices to VirtualBox instances. Conceptually, this looks like
|
||||
a relatively straight-forward feature. But as discussed in Section
|
||||
[Assignment of USB devices to virtual machines], we had to overcome a number of
|
||||
challenging problems caused by the inherently dynamic nature of USB-device
|
||||
hot-plugging. Also on the account of day-to-day computing, the GUI stack
|
||||
received welcomed usability improvements like keyboard shortcuts for certain
|
||||
window-management operations.
|
||||
|
||||
With respect to Genode's underlying base platforms, we are happy to announce
|
||||
the updates of the Muen and seL4 kernels. The Muen separation kernel received
|
||||
an update to version 0.7, which accommodates Genode's regular work flows (via
|
||||
run scripts) much better than the previous version. As described in Section
|
||||
[Muen separation kernel], this change clears the way to subject Muen to
|
||||
Genode's regular automated tests. The seL4 kernel represents an exciting
|
||||
playground as a future base platform for Genode. We have updated the kernel to
|
||||
version 2.1, which prompted us to fundamentally revisit the low-level resource
|
||||
management of Genode on this kernel. A summary of this undertaking is presented
|
||||
in Section [seL4 version 2.1].
|
||||
|
||||
According to the [http:/about/road-map - road map], we originally planned to
|
||||
revise the framework API in this release. Even though this topic is
|
||||
[https://github.com/genodelabs/genode/issues/1832 - very actively pursued], we
|
||||
decided to not rush it. We find it important to provide a smooth migration path
|
||||
from the old API to the new one. Determining the best path is actually trickier
|
||||
than revising the API, though. To let our decisions settle a bit, we postpone
|
||||
the transition to the upcoming release.
|
||||
|
||||
|
||||
Assignment of USB devices to virtual machines
|
||||
#############################################
|
||||
|
||||
As a migration strategy for running Genode on a daily basis, using VirtualBox
|
||||
to execute a feature-rich OS is vital. In release
|
||||
[http://genode.org/documentation/release-notes/15.05#USB-device_pass-through_support - 15.05],
|
||||
we added USB pass-through support to VirtualBox by enabling its integrated USB
|
||||
proxy service. Since we use the open-source edition of VirtualBox, we were
|
||||
merely able to use the OHCI device model and were therefore limited to using
|
||||
USB 1.x devices in low and full speed mode only. To make matters worse, when
|
||||
using the OHCI controller model, it is difficult if not impossible to access
|
||||
USB mass-storage devices. Usually, VirtualBox facilitates the EHCI or xHCI
|
||||
device models for the pass-through of storage devices. Unfortunately, those
|
||||
models are only available as a proprietary extension, which cannot be used by
|
||||
our VirtualBox port.
|
||||
|
||||
Having support for the pass-through of high-speed and super-speed USB devices
|
||||
is a must in such controller models. Therefore, we either have to implement
|
||||
these models ourselves or port existing ones from another VMM or emulator to
|
||||
fill the gap. We went for porting existing models first because device-model
|
||||
development from scratch could end up being time consuming if we want to
|
||||
guarantee them to work with a variety of different OS drivers.
|
||||
|
||||
|
||||
QEMU xHCI device model
|
||||
----------------------
|
||||
|
||||
QEMU features a NEC xHCI (UPD720200) device model that works well with Windows
|
||||
guests. For this reason, we decided to give porting this device model a shot.
|
||||
We applied the DDE approach and started by creating a QEMU emulation
|
||||
environment so that only the bare minimum amount of source code needed to be
|
||||
taken from the QEMU sources. It came down to a handful of source files, mainly
|
||||
the USB core and the xHCI device model files. We iteratively extended the
|
||||
emulation environment until the QEMU sources compiled and linked fine. One
|
||||
particular cumbersome issue we had to overcome was the emulation of the QEMU
|
||||
Object Model. Since QEMU is written in C, it uses its own object model to
|
||||
implement inheritance. This object model is used throughout QEMU. We took the
|
||||
easy way out and just used a C++ wrapper class that contains all QEMU objects
|
||||
that are used in the USB subsystem.
|
||||
|
||||
The next step was to develop an USB host device model. This model connects a
|
||||
USB device attached to Genode's USB host-controller driver to the xHCI device
|
||||
model. Lucky for us, QEMU already contains an USB host device model that uses
|
||||
libusb, which we could use as blueprint. We implemented a USB host device that
|
||||
leverages Genode's custom USB session interface. This host device reacts to a
|
||||
USB device report coming from another component such as the host-controller
|
||||
driver. It tries to claim all devices it finds in that report and then creates
|
||||
a QEMU USB device for each of them that is attached to the xHCI device model.
|
||||
|
||||
The xHCI device model needs infrastructure that normally is provided by QEMU
|
||||
itself such as a timer queue and PCI device handling. We introduced an QEMU
|
||||
USB controller interface _repos/libports/include/qemu/usb.h_ whose back-end
|
||||
library interface has to be implemented by a component, i.e. the VMM, that
|
||||
wants to use the library.
|
||||
|
||||
In the end, this work resulted in a small library that contains the xHCI
|
||||
device model and works in a standalone way. All required resources have to be
|
||||
provided by the component using the library. This makes it easy to integrate
|
||||
the library in different VMMs because the user of the library is not forced to
|
||||
employ the library in a certain way but free to use it any way he chooses.
|
||||
|
||||
|
||||
xHCI device model wrapper in VirtualBox
|
||||
---------------------------------------
|
||||
|
||||
We implemented an xHCI device model _repos/port/src/virtualbox/devxhci.cc_ in
|
||||
VirtualBox that merely wraps the QEMU USB library and provides the back-end
|
||||
functionality required by the library to glue QEMU's xHCI device model to
|
||||
VirtualBox. For now, this device is always part of a VM because there is
|
||||
currently no way to disable it from within the VirtualBox configuration
|
||||
front end. Therefore, it is necessary to always give VirtualBox access to a
|
||||
_usb_devices_ ROM module.
|
||||
|
||||
We removed the afore mentioned USB proxy service from our VirtualBox port
|
||||
because it became redundant with the advent of our xHCI device model.
|
||||
|
||||
|
||||
USB device report filter
|
||||
------------------------
|
||||
|
||||
With the xHCI support in VirtualBox in place, we had to come up with a
|
||||
mechanism to select, which USB devices it may access. Since USB devices are
|
||||
usually hot-plugged by the user of the system, we need to be able to configure
|
||||
the access permissions dynamically at run-time. On this account, we created a
|
||||
component that intercepts the report from the USB host-controller driver. On
|
||||
the one hand, this USB device report-filter component screens the device
|
||||
report coming from the USB host-controller driver by checking each reported
|
||||
device against a given white list of devices. Only approved devices are
|
||||
reported to a consumer of the report, i.e. VirtualBox. On the other hand, this
|
||||
component generates a new configuration for the USB host-controller driver.
|
||||
The configuration has to be changed each time the filter component finds a
|
||||
suitable device because the driver will hand out access to a given device to a
|
||||
client only if there is a valid policy. As we do not know in advance, which
|
||||
devices might be plugged in, this policy must be maintained dynamically. The
|
||||
report filter will send the device report only if the host-controller driver
|
||||
has changed its configuration. This ensures that a matching policy will be in
|
||||
effect at the time when the client component tries to access the device.
|
||||
|
||||
The configuration of the report-filter component can also be changed at run
|
||||
time.
|
||||
|
||||
See _repos/os/src/app/usb_report_filter/README_ for more details on how the
|
||||
USB device report filter may be configured.
|
||||
|
||||
|
||||
Example configuration
|
||||
---------------------
|
||||
|
||||
The following figure illustrates the interplay and configuration of the
|
||||
involved components:
|
||||
|
||||
[image qemu_xhci]
|
||||
|
||||
When the user plugs in a USB device, the USB host-controller driver generates
|
||||
a device report that is consumed by the USB device report-filter component
|
||||
(1). The filter component then examines the report and checks if it contains a
|
||||
device it should report to its report consumer. It then reconfigures the
|
||||
host-controller driver (2). Afterwards it sends a report to its consumer (3).
|
||||
The consumer, in this case a VMM, then accesses the USB device (4).
|
||||
|
||||
|
||||
New support for the RISC-V CPU architecture
|
||||
###########################################
|
||||
|
||||
We became aware of [http://riscv.org - RISC-V] when attending several talks
|
||||
about the project at [https://fosdem.org - FOSDEM] in 2015. RISC-V aims to be
|
||||
an open-source hardware architecture and is now complemented by many projects
|
||||
that target the release of real hardware or ASICs (for example,
|
||||
[http://lowrisc.org - the LowRISC project]). We have experience with various
|
||||
major CPU architectures and many systems on a chip and, therefore, embrace a
|
||||
sharp eye on certain platform properties. Intel's ME and ARM's Trustzone
|
||||
practically lock out operating systems of certain hardware and firmware
|
||||
features. The true nature of these mechanisms becomes increasingly dubious,
|
||||
especially when trying to build a secure open-source operating system. Intel's
|
||||
AMT technology for instance comes with a complete TCP/IP stack that intercepts
|
||||
packets from the integrated NIC and a VNC server that can magically expose a
|
||||
mouse and a keyboard at the USB controller. If you are interested in more
|
||||
details about this topic
|
||||
[http://blog.invisiblethings.org/papers/2015/x86_harmful.pdf - Intel x86 considered harmful]
|
||||
by Joanna Rutkowska is a very good read. We decided to have a deeper look at
|
||||
the RISC-V architecture as an alternative open hardware platform. Especially,
|
||||
since the LowRISC project promises a completely open system on chip, including
|
||||
the peripherals.
|
||||
|
||||
RISC-V comes with a lot of optional features, so it can cover a large field of
|
||||
applications reaching from simple I/O processors to general-purpose computing.
|
||||
For example, there are 64 and 32 bit ISA (instruction set architecture)
|
||||
versions, three page table formats with the option to omit paging at all, up
|
||||
to four privilege modes, and a minimal integer core ISA (I). Everything else,
|
||||
like multiplication and division (M), atomic instructions (A), and floating
|
||||
point support (F) are subject to ISA extensions and are completely optional
|
||||
for a specific hardware implementation.
|
||||
|
||||
For Genode, we chose to add the RISC-V support to our custom _base-hw_ kernel.
|
||||
Since Genode may be used as a general purpose OS, we implemented the kernel
|
||||
using the 64 bit RISC-V version, the Sv39 three-level page table format, and
|
||||
the so-called general-purpose extension (G), which is the abbreviation for the
|
||||
IAMF extensions. The current implementation provides the kernel and the
|
||||
necessary adaptations of the user level part of core.
|
||||
|
||||
For testing, we used the RISC-V instruction emulator called
|
||||
[https://github.com/riscv/riscv-isa-sim - Spike]. There also exists a RISC-V
|
||||
implementation for various Zynq FPGAs. Genode's Zynq board support has kindly
|
||||
been added and contributed by Mark Vels.
|
||||
|
||||
In the current state, basic Genode applications including core, init, and
|
||||
components that use shared libraries can be executed on top of our RISC-V
|
||||
port. We did not enable the libc and postponed further activity as the
|
||||
platform currently does not specify the interaction with peripherals.
|
||||
|
||||
|
||||
Steps to test Genode on RISC-V
|
||||
------------------------------
|
||||
|
||||
# Building the instruction emulator
|
||||
|
||||
! # download the front end server
|
||||
! git clone https://github.com/ssumpf/riscv-fesvr.git
|
||||
!
|
||||
! # build the front end server
|
||||
! cd riscv-fesvr
|
||||
! mkdir build
|
||||
! cd build
|
||||
! export RISCV=<installation path>
|
||||
! ../configure --prefix=$RISCV
|
||||
! (sudo) make install
|
||||
!
|
||||
! # download the instruction emulator
|
||||
! cd ../../
|
||||
! git clone https://github.com/ssumpf/riscv-isa-sim.git
|
||||
! cd riscv-isa-sim
|
||||
!
|
||||
! # build the emulator
|
||||
! mkdir build
|
||||
! cd build
|
||||
! ../configure --prefix=$RISCV --with-fesvr=$RISCV
|
||||
! (sudo) make install
|
||||
!
|
||||
! # add $RISCV/bin to path
|
||||
! export PATH=$RISCV/bin:$PATH
|
||||
|
||||
# Building Genode and running a test scenario
|
||||
|
||||
! # download Genode
|
||||
! cd ../../
|
||||
! git clone https://github.com/ssumpf/genode.git
|
||||
!
|
||||
! # build the Genode tool chain
|
||||
! cd genode
|
||||
! ./tool/tool_chain riscv
|
||||
!
|
||||
! # create RISC-V build directory
|
||||
! ./tool/create_builddir hw_riscv
|
||||
! cd build/hw_riscv
|
||||
!
|
||||
! # build and execute the printf run script
|
||||
! make run/printf
|
||||
|
||||
|
||||
GUI stack usability improvements
|
||||
################################
|
||||
|
||||
Motivated by the daily use of Genode as desktop OS by an increasingly number
|
||||
of developers, the window-layouter component of the
|
||||
[http://genode.org/documentation/release-notes/15.11#GUI_stack - GUI stack]
|
||||
received welcomed usability improvements.
|
||||
|
||||
|
||||
Configurable window placement
|
||||
-----------------------------
|
||||
|
||||
The policy of the window layouter can be adjusted via its configuration. For
|
||||
a given window label, the window's initial position and its maximized state
|
||||
can be defined as follows:
|
||||
|
||||
! <config>
|
||||
! <policy label="mupdf" maximized="yes"/>
|
||||
! <policy label="nit_fb" xpos="50" ypos="50"/>
|
||||
! </config>
|
||||
|
||||
|
||||
Keyboard shortcuts
|
||||
------------------
|
||||
|
||||
The window layouter has become able to respond to key sequences. However,
|
||||
normally, the layouter is not a regular nitpicker client but receives only
|
||||
those input events that refer to the window decorations. It never owns the
|
||||
keyboard focus. In order to propagate global key sequences to the layouter,
|
||||
nitpicker must be explicitly configured to direct key sequences initiated with
|
||||
certain keys to the decorator. For example, the following nitpicker
|
||||
configuration routes key sequences starting with the left windows key to the
|
||||
decorator. The window manager, in turn, forwards those events to the layouter.
|
||||
|
||||
! <start name="nitpicker">
|
||||
! ...
|
||||
! <config>
|
||||
! ...
|
||||
! <global-key name="KEY_LEFTMETA" label="wm -> decorator" />
|
||||
! ...
|
||||
! </config>
|
||||
! ...
|
||||
! </start>
|
||||
|
||||
The response of the window layouter to key sequences can be expressed in the
|
||||
layouter configuration as follows:
|
||||
|
||||
! <config>
|
||||
! <press key="KEY_LEFTMETA">
|
||||
! <press key="KEY_TAB" action="next_window">
|
||||
! <release key="KEY_TAB">
|
||||
! <release key="KEY_LEFTMETA" action="raise_window"/>
|
||||
! </release>
|
||||
! </press>
|
||||
! <press key="KEY_LEFTSHIFT">
|
||||
! <press key="KEY_TAB" action="prev_window">
|
||||
! <release key="KEY_TAB">
|
||||
! <release key="KEY_LEFTMETA" action="raise_window"/>
|
||||
! </release>
|
||||
! </press>
|
||||
! </press>
|
||||
! <press key="KEY_ENTER" action="toggle_fullscreen"/>
|
||||
! </press>
|
||||
! </config>
|
||||
|
||||
Each '<press>' node defines the policy when the specified 'key' is pressed.
|
||||
It can be equipped with an 'action' attribute that triggers a window action.
|
||||
The supported window actions are:
|
||||
|
||||
:next_window: Focus the next window in the focus history.
|
||||
:prev_window: Focus the previous window in the focus history.
|
||||
:raise_window: Bring the focused window to the front.
|
||||
:toggle_fullscreen: Maximize/unmaximize the focused window.
|
||||
|
||||
By nesting '<press>' nodes, actions can be tied to key sequences. In the
|
||||
example above, the 'next_window' action is executed only if TAB is pressed
|
||||
while the left windows-key is kept pressed. Furthermore, key sequences can
|
||||
contain specific release events. In the example above, the release of the left
|
||||
windows key brings the focused window to front, but only if TAB was pressed
|
||||
before.
|
||||
|
||||
|
||||
Device drivers
|
||||
##############
|
||||
|
||||
USB host-controller driver enhancements
|
||||
=======================================
|
||||
|
||||
The _usb_drv_ component now solely uses a policy to grant other components
|
||||
access to USB devices exposed by its raw interface (USB session). On the basis
|
||||
of the 'label' attribute, it will choose a pre-configured device that is
|
||||
identified by either the 'bus' and 'dev' or the 'vendor' and 'product'
|
||||
attribute tuple. To accommodate policy decisions made at run time, the USB
|
||||
driver is now able to reload its configuration on demand. The USB device
|
||||
report now contains a 'bus' and a 'dev' attribute as well in order to identify
|
||||
a USB device more precisely. In addition to that, there is also a generated
|
||||
'label' attribute in form of 'usb-<bus>-<dev>' that may be used to form
|
||||
policies while configuring the system dynamically, e.g., when using the
|
||||
_usb_report_filter_ component.
|
||||
|
||||
|
||||
USB mass-storage driver
|
||||
=======================
|
||||
|
||||
Up to now, access to USB storage devices was provided by the USB
|
||||
host-controller driver only. However, its ability to do so is limited. E.g.,
|
||||
it only supports one storage device and the storage device cannot be changed
|
||||
at run-time. With this release we add a USB mass-storage driver that supports
|
||||
UMS bulk-only devices that use the SCSI Block Commands set (direct-access).
|
||||
This is still most common for USB sticks. Devices using different command
|
||||
sets, e.g SD/HC devices or some external disc drives, will not work properly
|
||||
if at all. The driver uses the USB session interface to access the USB device
|
||||
and provides its service as block session to its client.
|
||||
|
||||
This component is part of the first step providing the ability to mount and
|
||||
use USB sticks dynamically when using Genode as a general purpose OS. In the
|
||||
future, the _usb_drv_ component should solely be the host-controller driver
|
||||
while other tasks are handled by dedicated USB driver components such as this
|
||||
one.
|
||||
|
||||
|
||||
Audio output on Linux
|
||||
=====================
|
||||
|
||||
The audio-out driver for Linux was modernized by replacing its multi-threaded
|
||||
architecture by an event-driven architecture using Genode's server API. In
|
||||
addition, the playback is now driven by a timer. For now it is a periodic
|
||||
timer that triggers every 11 ms which is roughly the current audio-out period.
|
||||
|
||||
The driver now also behaves like the other BSD-based audio-out driver, i.e.,
|
||||
it always advances the play pointer. That is vital for the audio-out stack
|
||||
above the driver to work properly (e.g., the mixer).
|
||||
|
||||
|
||||
Libraries and applications
|
||||
##########################
|
||||
|
||||
New Genode-world repository
|
||||
===========================
|
||||
|
||||
With a growing number of users and contributors comes the desire to bring more
|
||||
and more existing software to Genode. Most of such libraries and applications,
|
||||
however, are outside of the scope of Genode as an OS framework. In contrast to
|
||||
device drivers, protocol stacks, and low-level OS services, which we subject
|
||||
to our regular automated tests, most 3rd-party software is pretty independent
|
||||
from Genode. The attempt to integrate the growing pool of such diverse
|
||||
software into the main repository does not scale.
|
||||
|
||||
For this reason, we introduce the new
|
||||
[https://github.com/genodelabs/genode-world - Genode World] repository, which
|
||||
is the designated place for hosting ported applications, libraries, and games.
|
||||
|
||||
To use it, you first need to obtain a clone of Genode:
|
||||
|
||||
! git clone https://github.com/genodelabs/genode.git genode
|
||||
|
||||
Now, clone the _genode-world.git_ repository to _genode/repos/world:_
|
||||
|
||||
! git clone https://github.com/genodelabs/genode-world.git genode/repos/world
|
||||
|
||||
By placing the _world_ repository under the _repos/_ directory, Genode's tools
|
||||
will automatically incorporate the ports provided by the _world_ repository.
|
||||
|
||||
For building software of the _world_ repository, the build-directory
|
||||
configuration _etc/build.conf_ must be extended with the following line:
|
||||
|
||||
! REPOSITORIES += $(GENODE_DIR)/repos/world
|
||||
|
||||
*Word of caution*
|
||||
|
||||
In contrast to the components found in the mainline Genode repository, the
|
||||
components within the _world_ repository are not subjected to the regular
|
||||
quality-assurance measures of Genode Labs. Hence, problems are to be expected.
|
||||
If you encounter bugs, build problems, or stability issues, please report them
|
||||
to the [https://github.com/genodelabs/genode-world/issues - issue tracker] or
|
||||
the [http://genode.org/community/mailing-lists - mailing list].
|
||||
|
||||
|
||||
Updated 3rd-party software
|
||||
==========================
|
||||
|
||||
The following 3rd-party code packages of the _ports_ and _libports_
|
||||
repositories have been ported or updated:
|
||||
|
||||
* Lynx 2.8.8rel.2 (noux package)
|
||||
* OpenSSH 7.1p1 (noux package)
|
||||
* tar-1.27 (noux package)
|
||||
* libssh 0.7.2
|
||||
* Lighttpd 1.4.38
|
||||
|
||||
|
||||
Platforms
|
||||
#########
|
||||
|
||||
Execution on bare hardware (base-hw)
|
||||
====================================
|
||||
|
||||
Within the last months, the initialization code of our custom kernel got
|
||||
re-arranged to simplify the addition of new architectures, e.g., the RISC-V
|
||||
port (Section [New support for the RISC-V CPU architecture]) while also make
|
||||
its implementation leaner. A positive side effect of this work was the
|
||||
generalization of multi-processor and L2-cache support for ARM's Cortex-A9
|
||||
CPUs. For instance, the Wandboard (Freescale i.MX6 SoC) is now driven with all
|
||||
four cores, and its memory can be accessed with full speed.
|
||||
|
||||
Besides those feature additions, we fixed an extremely rare and tricky race
|
||||
condition in the implementation of the kernel-protected capabilities,
|
||||
introduced in release 15.05. A capability's lifetime within a component is
|
||||
tracked by a reference-counting like mechanism that is under control of the
|
||||
component itself. When the kernel transfered a capability to a component, and
|
||||
the very same capability was deleted within the component simultaneously, the
|
||||
received capability was marked as invalid, which led to diverse, sporadic
|
||||
faults. This deficit in the capabilities reference-counting is solved with the
|
||||
current release.
|
||||
|
||||
|
||||
Muen separation kernel
|
||||
======================
|
||||
|
||||
Build integration
|
||||
-----------------
|
||||
|
||||
Building Genode scenarios running on top of the
|
||||
[http://muen.sk - Muen separation kernel] has been greatly simplified by
|
||||
properly integrating the Muen system build process into the Genode build system.
|
||||
As described in the
|
||||
[http://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - 15.08 release notes],
|
||||
the architecture with Muen is different since the entire hw_x86_64_muen Genode
|
||||
system runs as a guest VM on top of the separation kernel. This means that the
|
||||
Genode base-hw image must itself be packaged into the final Muen system image
|
||||
as an additional step after the Genode system build.
|
||||
|
||||
The packaging process of a Muen system image is performed by the new
|
||||
_image/muen_ run-tool plugin, which processes the following RUN_OPT parameters.
|
||||
|
||||
:--image-muen-external-build:
|
||||
Muen system is built automatically or externally
|
||||
|
||||
:--image-muen-system:
|
||||
Muen system policy
|
||||
|
||||
:--image-muen-components:
|
||||
Muen system components required for the given system policy
|
||||
|
||||
:--image-muen-hardware:
|
||||
Muen target hardware platform
|
||||
|
||||
:--image-muen-gnat-path:
|
||||
Path to GNAT toolchain
|
||||
|
||||
:--image-muen-spark-path:
|
||||
Path to SPARK toolchain
|
||||
|
||||
The options are automatically added to the _etc/build.conf_ file for the
|
||||
hw_x86_64_muen base-hw platform. The
|
||||
[http://genode.org/documentation/platforms/muen - documentation] has been
|
||||
updated to reflect the new, simplified build process.
|
||||
|
||||
A port file was added to facilitate the download of the Muen sources v0.7 and
|
||||
to check the required dependencies.
|
||||
|
||||
Using the new _image/muen_ script in combination with iPXE allows to run the
|
||||
Genode test suite via the autopilot tool.
|
||||
|
||||
|
||||
MSI support
|
||||
-----------
|
||||
|
||||
Muen employs Intel VT-d interrupt remapping (IR) besides DMA remapping for
|
||||
secure device assignment. As a consequence, PCI devices using Message Signaled
|
||||
Interrupts (MSI) must be programmed to trigger requests in remappable format
|
||||
(see Intel VT-d specification, Section 5.1.2.2 for further details).
|
||||
|
||||
To enable the use of MSIs with the base-hw kernel, a platform-specific
|
||||
function has been introduced that returns the necessary MSI parameters for a
|
||||
given PCI device. If either the platform or the specific device does not
|
||||
support MSI, the function returns false.
|
||||
|
||||
On hw_x86_64_muen, the function consults the Muen subject info page to supply
|
||||
the appropriate information to the IRQ session. This allows Genode device
|
||||
drivers to transparently use MSIs for passed-through PCI devices.
|
||||
|
||||
|
||||
seL4 version 2.1
|
||||
================
|
||||
|
||||
By the end of 2015, the [http://sel4.systems/ - seL4 kernel] version 2.0 was
|
||||
published. With the current release, we update Genode's preliminary support
|
||||
for this kernel from the experimental branch of one year ago to the master
|
||||
branch of version 2.1. Note that this line of work is still considered as an
|
||||
exploration. As of now, there is still a way to go until we can leverage seL4
|
||||
as a fully featured base platform. Under the hood of Genode, the transition to
|
||||
the version 2.1 master branch had the following implications.
|
||||
|
||||
In contrast to the experimental branch, the seL4 master branch has no way to
|
||||
manually define the allocation of kernel objects within untyped memory ranges.
|
||||
Instead, the kernel maintains a built-in allocation policy. This policy rules
|
||||
out the deallocation of once-used parts of untyped memory. The only way to
|
||||
reuse memory is to revoke the entire untyped memory range. Consequently, we
|
||||
cannot share a large untyped memory range for kernel objects of different
|
||||
protection domains. In order to reuse memory at a reasonably fine granularity,
|
||||
we need to split the initial untyped memory ranges into small chunks that can
|
||||
be individually revoked. Those chunks are called "untyped pages". An untyped
|
||||
page is a 4 KiB untyped memory region.
|
||||
|
||||
The bootstrapping of core has to employ a two-stage allocation approach now.
|
||||
For creating the initial kernel objects for core, which remain static during
|
||||
the entire lifetime of the system, kernel objects are created directly out of
|
||||
the initial untyped memory regions as reported by the kernel. The so-called
|
||||
"initial untyped pool" keeps track of the consumption of those untyped memory
|
||||
ranges by mimicking the kernel's internal allocation policy. Kernel objects
|
||||
created this way can be of any size. For example the CNode, which is used to
|
||||
store page-frame capabilities is 16 MiB in size. Also, core's CSpace uses a
|
||||
relatively large CNode.
|
||||
|
||||
After the initial setup phase, all remaining untyped memory is turned into
|
||||
untyped pages. From this point on, newly created kernel objects cannot exceed
|
||||
4 KiB in size because one kernel object cannot span multiple untyped memory
|
||||
regions. The capability selectors for untyped pages are organized similarly to
|
||||
those of page-frame capabilities. There is a new 2nd-level CNode
|
||||
(UNTYPED_CORE_CNODE) that is dimensioned according to the maximum amount of
|
||||
physical memory (1M entries, each entry representing 4 KiB). The CNode is
|
||||
organized such that an index into the CNode directly corresponds to the
|
||||
physical frame number of the underlying memory. This way, we can easily
|
||||
determine an untyped page selector for any physical addresses, i.e., for
|
||||
revoking the kernel objects allocated at a specific physical page. The
|
||||
downside is the need for another 16 MiB chunk of meta data. Also, we need to
|
||||
keep in mind that this approach won't scale to 64-bit systems. We will
|
||||
eventually need to replace the PHYS_CORE_CNODE and UNTYPED_CORE_CNODE by CNode
|
||||
hierarchies to model a sparsely populated CNode. The following figure
|
||||
illustrates the layout of core's capability space.
|
||||
|
||||
[image sel4_core_cspace_master]
|
||||
Organization of core's capability space on seL4
|
||||
|
||||
For each protection domain, core maintains a so-called VM CSpace that holds
|
||||
capability selectors for page frames and page tables. The size constraint of
|
||||
kernel objects has the immediate implication that the VM CSpaces of protection
|
||||
domains must be organized via several levels of CNodes. I.e., as the top-level
|
||||
CNode of core has a size of 2^12, the remaining 20 PD-specific CSpace address
|
||||
bits are organized as a 2nd-level 2^4 padding CNode, a 3rd-level 2^8 CNode,
|
||||
and several 4th-level 2^8 leaf CNodes. The latter contain the actual selectors
|
||||
for the page tables and page-table entries of the respective PD.
|
||||
|
||||
As another slight difference from the experimental branch, the master branch
|
||||
requires the explicit assignment of page directories to an ASID pool.
|
||||
|
||||
Functionality-wise the update to version 2.1 brings no changes. The
|
||||
preliminary support is still limited to Genode's most fundamental mechanisms
|
||||
like the bootstrapping, the creation of protection domains, the execution of
|
||||
threads, and inter-component communication. User-level device drivers are not
|
||||
supported yet. Such functional improvements are scheduled for Genode 16.08.
|
||||
|
||||
|
||||
Linux
|
||||
=====
|
||||
|
||||
We started to experience crashes of our dynamic linker (ldso) when using
|
||||
Genode's _base-linux_ platform on recent Linux kernels. Ldso is primarily a
|
||||
shared object, which is linked to dynamic binaries. But ldso is also an
|
||||
executable, which, once started loads the dynamically-linked binary along with
|
||||
all shared libraries required by the binary. Up to now, ldso had to be loaded
|
||||
at a link address defined at compilation time, which we enforced through
|
||||
linker-script magic. Unfortunately, this does not work any longer on recent
|
||||
Linux versions. The kernel notices that ldso is a shared object and loads it
|
||||
at an arbitrary (randomized) address, which ultimately results in a
|
||||
segmentation fault during ldso initialization. We found a fix for this issue
|
||||
by marking ldso as an executable in the ELF header. But since ldso is linked
|
||||
to all dynamic binaries (it contains Genode's base libraries) the GNU linker
|
||||
then refused to link because ldso was not marked as a shared object.
|
||||
Therefore, we decided to implement true self relocation within ldso. This
|
||||
feature only works on Genode's base-linux platform as it requires some
|
||||
symbol-address magic.
|
||||
|
||||
162
doc/road_map.txt
162
doc/road_map.txt
@@ -14,56 +14,99 @@ The road map is not fixed. If there is commercial interest of pushing the
|
||||
Genode technology to a certain direction, we are willing to revisit our plans.
|
||||
|
||||
|
||||
Review of 2014
|
||||
Review of 2015
|
||||
##############
|
||||
|
||||
Most of the progress in 2014 was motivated by our goal to use
|
||||
Genode as general-purpose OS on x86-based platforms. To highlight a
|
||||
few achievements, we started to use [http://rumpkernel.org/ - Rump kernels]
|
||||
as file-system providers, enabled VirtualBox on NOVA, pulled off the
|
||||
engineering feat to run the Intel Wireless stack natively on microkernels, and
|
||||
came up with a new GUI architecture. We regard these features as the
|
||||
groundwork to make Genode a feasible platform for day-to-day computing.
|
||||
In the beginning of 2015, we declared four main topics to work on, namely
|
||||
Genode as general-purpose OS, our custom base-hw kernel platform, thorough
|
||||
documentation, and the seL4 kernel. It goes without saying that the stability
|
||||
and performance of the base system is a fundamental requirement for the first
|
||||
topic.
|
||||
|
||||
That said, even though we are proud about the progress, we are still not there
|
||||
yet. So what keeps us back? The answer is actually not technical. Most
|
||||
developments over the past years were concerned with individual features or
|
||||
technical challenges. But the integration of sophisticated system scenarios
|
||||
was a rare occurrence. For the most part, such integration activities were
|
||||
solely triggered by a particular project or by a presentation. In order to
|
||||
make Genode fit for regular use, we need to make the composing of advanced
|
||||
systems a habit for most of the regular developers.
|
||||
In mid of 2015, we eventually reached the point where a hand full of
|
||||
developers started using Genode as their day-to-day OS in the form of the
|
||||
so-called
|
||||
[https://github.com/genodelabs/genode/issues/1552 - Turmvilla scenario].
|
||||
By the end of the year, the performance, stability, and device-driver support
|
||||
had reached a level that leaves people impressed every time we have the chance
|
||||
to show off our system. Once people become interested, the Genode Foundations
|
||||
book - published in Spring - provides a smooth introduction into Genode. The
|
||||
Turmvilla scenario is currently based on the NOVA kernel. For the future, we
|
||||
want to use also other kernels, in particular our custom base-hw kernel and
|
||||
seL4. Thanks to the contribution of
|
||||
[http://codelabs.ch - Codelabs], base-hw became usable on the 64-bit x86
|
||||
architecture and on the Muen separation kernel in particular. With our work
|
||||
on seL4, we reached the point where basic Genode scenarios are executable
|
||||
on this kernel.
|
||||
|
||||
After having passed the point where a few enthusiasts are able to use Genode
|
||||
as day-to-day OS, we should put the emphasis of 2016 on
|
||||
ways to make Genode accessible for a wider community.
|
||||
|
||||
|
||||
Big picture for 2015
|
||||
Big picture for 2016
|
||||
####################
|
||||
|
||||
On the account of this realization, the overall theme of 2015 will be the
|
||||
consolidation and cultivation of the existing feature set rather than the
|
||||
conquering of new grounds. This implies the following topics:
|
||||
We identified two possible ways to extend the Genode community.
|
||||
|
||||
* Advancing our automated test and integration infrastructure towards
|
||||
the continuous integration of real-world system scenarios,
|
||||
* Fostering good-quality documentation,
|
||||
* Optimization of performance and stability,
|
||||
* Improvement of our tooling
|
||||
By community we refer to two groups of people. The first group are
|
||||
maker-minded people with a strong incentive to build things. By publishing a
|
||||
series of step-by-step guides that explain how to put Genode components
|
||||
together in order to create custom system scenarios, we intend to spark
|
||||
interest of system builders in Genode. Those articles could be accompanied by
|
||||
screencasts or live-system images.
|
||||
|
||||
Furthermore, we have to address outstanding limitations of the most
|
||||
commonly used base platforms, namely base-hw and NOVA. I.e., only
|
||||
with kernel-protected capabilities, base-hw can be considered as a viable
|
||||
base platform for security-critical systems, and only with proper
|
||||
kernel-resource management, NOVA can be recommended as a kernel for
|
||||
general-purpose computing.
|
||||
The second group are certain end users with a strong desire for privacy and
|
||||
security. We expect this narrow user group to willingly trade the comfort and
|
||||
features of traditional desktop OSes for the benefits of Genode. We plan to
|
||||
showcase a system with practical value for this group, for example a
|
||||
disposable OS like Tails that allows the user to browse the internet via the
|
||||
Tor network.
|
||||
|
||||
Besides the cultivation of the existing feature set, there will still be room
|
||||
for new things. We are particularly excited about the prospect of combining
|
||||
Genode with the [http://sel4.systems - seL4 kernel] and
|
||||
the [http://nixos.org/nix/ - Nix package manager]. Furthermore, we desire to
|
||||
continue the work on our new GUI architecture towards a capability-based
|
||||
desktop environment.
|
||||
In this spirit, the leitmotif for 2016 will be: Let us make Genode accessible
|
||||
to the world outside the inner circle of us enthusiasts.
|
||||
|
||||
On a technical level, this motive implicates the following topics:
|
||||
|
||||
* The deployment, management, and configuration of Genode systems, i.e., by
|
||||
bringing forward our work on the Nix package manager and by fostering
|
||||
dynamic configurability. This direction also reinforces the need to achieve
|
||||
binary compatibility between the various base platforms to make the
|
||||
distribution of binary packages, reproducible builds, and continuous test
|
||||
and integration scalable.
|
||||
|
||||
* Accommodation of common desktop use cases like plugging in a USB
|
||||
stick to work with the files stored on it. Also disk encryption comes
|
||||
into mind.
|
||||
|
||||
* Optimization of Genode for the use on a laptop, e.g., addressing
|
||||
fan control, power management, suspend/resume, and similar features.
|
||||
|
||||
* Identifying ways of how Genode could contribute additional value to
|
||||
Xen-based environments like Amazon EC2 and Qubes OS.
|
||||
|
||||
* Foster the cross-pollination of the seL4 and Genode communities.
|
||||
Genode would allow the seL4 community to move beyond static system
|
||||
scenarios.
|
||||
|
||||
* As most use cases rely on networking, we acknowledge the need for
|
||||
improving Genode's network support such as NAT, the robustness of the
|
||||
available TCP/IP stacks and drivers, encryption, and possibly IPv6.
|
||||
|
||||
* Genode as distributed system, e.g., a system spread over multiple FPGA-based
|
||||
softcore CPUs, over multiple domains of the Muen separation kernel, or a
|
||||
local machine and a cloud-service provider.
|
||||
|
||||
Assuming that we succeed in drawing the attention of a broader audience
|
||||
to our project, we should make sure that Genode's API won't undergo
|
||||
major changes soon after this point. Today, there are still a number of
|
||||
deficiencies in the current API. We should finalize the renovation of
|
||||
the Genode API until the mid of 2016. This will also be right the time for
|
||||
updating the Genode book. Also, the planned step-by-step guides will
|
||||
be based on the modernized API.
|
||||
|
||||
|
||||
Milestones for 2015
|
||||
Milestones for 2016
|
||||
###################
|
||||
|
||||
In the following, we present a rough schedule of the planned work. As usual,
|
||||
@@ -71,38 +114,41 @@ it is not set in stone. If you are interested in a particular line of work,
|
||||
please get in touch.
|
||||
|
||||
|
||||
February - Release 15.02
|
||||
February - Release 16.02
|
||||
========================
|
||||
|
||||
* ARM virtualization on top of the base-hw kernel
|
||||
* Modularized tooling for automated tests
|
||||
* RISC-V architecture support
|
||||
* seL4 version 2.0
|
||||
* Assignment of USB devices to VirtualBox guests
|
||||
* API modernization (introduction of new component API, deprecation
|
||||
of API legacies)
|
||||
|
||||
|
||||
May - Release 15.05
|
||||
May - Release 16.05
|
||||
===================
|
||||
|
||||
* Comprehensive documentation of the Genode foundations
|
||||
* Kernel-protected capabilities for the base-hw kernel
|
||||
* seL4 microkernel as base platform
|
||||
* Refined platform-driver architecture (support for MSIs, assignment of
|
||||
I/O resources to drivers, standardized configuration)
|
||||
* VirtualBox on top of the Muen separation kernel
|
||||
* Update of the Genode Foundations book
|
||||
* NAT component
|
||||
* API modernization (removal of API legacies)
|
||||
* Definition of "packages"
|
||||
|
||||
|
||||
August - Release 15.08
|
||||
August - Release 16.08
|
||||
======================
|
||||
|
||||
* Capability-based desktop environment allowing the interactive installation
|
||||
and management of Genode subsystems and the interaction with files
|
||||
* Accommodation of typical desktop-computing tasks (e.g., email)
|
||||
* Interactive tools for observing the system behavior
|
||||
* NOVA kernel-resource management
|
||||
* Cross-kernel binary compatibility
|
||||
* Interactive system scenarios on top of seL4
|
||||
* Networking via Tor
|
||||
* Block encryption
|
||||
* Build-system support for handling packages
|
||||
|
||||
|
||||
November - Release 15.11
|
||||
November - Release 16.11
|
||||
========================
|
||||
|
||||
* Achieving cross-kernel binary compatibility
|
||||
* Package management
|
||||
* Modern web browser
|
||||
|
||||
* Genode on top of Xen
|
||||
* Exploration of Genode as distributed system
|
||||
* Deployment of packages
|
||||
* On-target building of packages
|
||||
|
||||
|
||||
12
repos/README
12
repos/README
@@ -40,10 +40,12 @@ but build upon of each other:
|
||||
See [http://genode.org/documentation/platforms/foc]
|
||||
|
||||
:'hw':
|
||||
The hw platform allows the execution of Genode on bare ARM hardware
|
||||
The hw platform allows the execution of Genode on bare ARM and x86 hardware
|
||||
without the need for a separate kernel. The kernel functionality is
|
||||
included in core.
|
||||
See [http://genode.org/documentation/platforms/hw]
|
||||
included in core except in the special case of the Muen separation
|
||||
kernel.
|
||||
See [http://genode.org/documentation/platforms/hw] and
|
||||
[http://genode.org/documentation/platforms/muen]
|
||||
|
||||
:'okl4':
|
||||
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
|
||||
@@ -57,10 +59,6 @@ but build upon of each other:
|
||||
L4/Fiasco kernel developed at University of Technology Dresden.
|
||||
See [http://genode.org/documentation/platforms/fiasco]
|
||||
|
||||
:'codezero':
|
||||
Codezero microkernel developed by B-Labs
|
||||
See [http://genode.org/documentation/platforms/codezero]
|
||||
|
||||
:'sel4':
|
||||
seL4 microkernel developed at NICTA/General Dynamics
|
||||
See[https://sel4.systems/]
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#
|
||||
# \brief Download and prepare the Codezero kernel
|
||||
# \author Norman Feske
|
||||
# \date 2011-08-05
|
||||
#
|
||||
|
||||
VERBOSE ?= @
|
||||
ECHO := @echo
|
||||
|
||||
#
|
||||
# Print help information by default
|
||||
#
|
||||
help::
|
||||
|
||||
prepare:
|
||||
$(VERBOSE)../../tool/ports/prepare_port codezero
|
||||
|
||||
help::
|
||||
$(ECHO)
|
||||
$(ECHO) "Prepare the codezero base repository"
|
||||
$(ECHO)
|
||||
$(ECHO) "--- available commands ---"
|
||||
$(ECHO) "prepare - checkout upstream source codes"
|
||||
$(ECHO) "clean - remove upstream source codes"
|
||||
$(ECHO)
|
||||
@@ -1,3 +0,0 @@
|
||||
This repository contains the port of Genode to the Codezero microkernel
|
||||
For instructions about using Genode with Codezero, please refer to
|
||||
'doc/codezero.txt'.
|
||||
@@ -1,240 +0,0 @@
|
||||
#
|
||||
# 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=0x41000
|
||||
CONFIG_CONT0_PAGER_VMA=0x100000
|
||||
|
||||
|
||||
#
|
||||
# Container 0 Pager Physical Memory Regions (Capabilities)
|
||||
#
|
||||
CONFIG_CONT0_PAGER_PHYSMEM_REGIONS=1
|
||||
CONFIG_CONT0_PAGER_PHYS0_START=0x41000
|
||||
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=0x41000
|
||||
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!
|
||||
@@ -1,274 +0,0 @@
|
||||
|
||||
==================================
|
||||
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.com]
|
||||
|
||||
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:
|
||||
! 0x41000 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
|
||||
! 0x41000 Physical Region 0 Start Address
|
||||
! 0x4000000 Physical Region 0 End Address
|
||||
We only use 64MB of memory. The physical memory between 0 and 0x41000 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.
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
SPECS = genode
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* \brief Atomic operations for ARM on codezero
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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_ */
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* \brief IPC message buffer
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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_ */
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* \brief Dummy definitions for native types used for compiling unit tests
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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_
|
||||
|
||||
#include <base/native_capability.h>
|
||||
#include <base/stdint.h>
|
||||
|
||||
namespace Codezero {
|
||||
|
||||
struct l4_mutex;
|
||||
|
||||
enum { NILTHREAD = -1 };
|
||||
}
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_thread;
|
||||
|
||||
struct Cap_dst_policy
|
||||
{
|
||||
typedef int Dst;
|
||||
|
||||
static bool valid(Dst tid) { return tid != Codezero::NILTHREAD; }
|
||||
static Dst invalid() { return Codezero::NILTHREAD; }
|
||||
static void copy(void* dst, Native_capability_tpl<Cap_dst_policy>* src);
|
||||
};
|
||||
|
||||
typedef Cap_dst_policy::Dst Native_thread_id;
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
typedef Native_capability_tpl<Cap_dst_policy> Native_capability;
|
||||
typedef int Native_connection_state;
|
||||
|
||||
struct Native_config
|
||||
{
|
||||
/**
|
||||
* Thread-context area configuration.
|
||||
*/
|
||||
static constexpr addr_t context_area_virtual_base() {
|
||||
return 0x40000000UL; }
|
||||
static constexpr addr_t context_area_virtual_size() {
|
||||
return 0x10000000UL; }
|
||||
|
||||
/**
|
||||
* Size of virtual address region holding the context of one thread
|
||||
*/
|
||||
static constexpr addr_t context_virtual_size() { return 0x00100000UL; }
|
||||
};
|
||||
|
||||
struct Native_pd_args { };
|
||||
}
|
||||
|
||||
|
||||
#endif /* _INCLUDE__BASE__NATIVE_TYPES_H_ */
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* \brief Aggregate Codezero syscall bindings
|
||||
* \author Norman Feske
|
||||
* \date 2010-02-16
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 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
|
||||
|
||||
/*
|
||||
* Turn '#define cacheable' (as defined in the codezero headers) into an enum
|
||||
* value. Otherwise, the define will conflict with variables named 'cacheable'.
|
||||
*/
|
||||
enum { _codezero_cacheable = cacheable /* #define value */ };
|
||||
#undef cacheable
|
||||
enum { cacheable = _codezero_cacheable };
|
||||
|
||||
} }
|
||||
|
||||
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_ */
|
||||
@@ -1 +0,0 @@
|
||||
REP_INC_DIR += include/codezero/dummies
|
||||
@@ -1,11 +0,0 @@
|
||||
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
|
||||
|
||||
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
|
||||
@@ -1,3 +0,0 @@
|
||||
LIBS += l4_arm_v5
|
||||
|
||||
include $(REP_DIR)/lib/mk/l4.inc
|
||||
@@ -1,33 +0,0 @@
|
||||
#
|
||||
# \brief Portions of base library shared by core and non-core processes
|
||||
# \author Norman Feske
|
||||
# \date 2013-02-14
|
||||
#
|
||||
|
||||
LIBS += cxx syscall startup
|
||||
|
||||
SRC_CC += cap_copy.cc
|
||||
SRC_CC += ipc/ipc.cc ipc/ipc_marshal_cap.cc
|
||||
SRC_CC += avl_tree/avl_tree.cc
|
||||
SRC_CC += allocator/slab.cc
|
||||
SRC_CC += allocator/allocator_avl.cc
|
||||
SRC_CC += heap/heap.cc heap/sliced_heap.cc
|
||||
SRC_CC += console/console.cc
|
||||
SRC_CC += child/child.cc
|
||||
SRC_CC += process/process.cc
|
||||
SRC_CC += elf/elf_binary.cc
|
||||
SRC_CC += lock/lock.cc
|
||||
SRC_CC += signal/signal.cc signal/common.cc signal/platform.cc
|
||||
SRC_CC += server/server.cc server/common.cc
|
||||
SRC_CC += thread/thread.cc thread/myself.cc thread/thread_bootstrap.cc thread/trace.cc
|
||||
SRC_CC += thread/context_allocator.cc env/utcb.cc
|
||||
SRC_CC += lock/cmpxchg.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
INC_DIR += $(REP_DIR)/include/codezero/dummies
|
||||
|
||||
vpath cap_copy.cc $(BASE_DIR)/src/platform
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
vpath %.cc $(BASE_DIR)/src/base
|
||||
@@ -1,14 +0,0 @@
|
||||
SRC_CC += console/log_console.cc
|
||||
SRC_CC += cpu/cache.cc
|
||||
SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc
|
||||
SRC_CC += thread/thread_start.cc
|
||||
SRC_CC += irq/platform.cc
|
||||
|
||||
INC_DIR += $(BASE_DIR)/src/base/env
|
||||
INC_DIR += $(REP_DIR)/include/codezero/dummies
|
||||
|
||||
LIBS += base-common
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
vpath %.cc $(BASE_DIR)/src/base
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ifeq ($(filter-out $(SPECS),platform_vpb926),)
|
||||
CODEZERO_CML = $(REP_DIR)/config/vpb926.cml
|
||||
endif
|
||||
@@ -1,51 +0,0 @@
|
||||
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
|
||||
|
||||
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)
|
||||
|
||||
#
|
||||
# Dummies
|
||||
#
|
||||
SRC_C += dummy.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
|
||||
vpath %.c $(REP_DIR)/src/lib/syscall
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
SRC_CC = core_printf.cc
|
||||
INC_DIR += $(REP_DIR)/src/base/console/pl011
|
||||
INC_DIR += $(REP_DIR)/include/codezero/dummies
|
||||
|
||||
vpath core_printf.cc $(BASE_DIR)/src/base/console
|
||||
@@ -1,33 +0,0 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
include $(BASE_DIR)/lib/mk/startup.inc
|
||||
|
||||
INC_DIR += $(REP_DIR)/include/codezero/dummies
|
||||
|
||||
vpath crt0.s $(BASE_DIR)/src/platform/arm
|
||||
@@ -1,39 +0,0 @@
|
||||
#
|
||||
# Specifics for the Codezero kernel API
|
||||
#
|
||||
|
||||
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
|
||||
|
||||
#
|
||||
# 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
|
||||
#
|
||||
INC_DIR += $(CODEZERO_DIR)/include
|
||||
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libl4/include
|
||||
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libdev/uart/include
|
||||
|
||||
#
|
||||
# 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
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# 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)
|
||||
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# Specifics for Codezero on ARMv5
|
||||
#
|
||||
|
||||
SPECS += codezero_arm
|
||||
|
||||
CC_OPT += -D__SUBARCH__=v5
|
||||
|
||||
include $(call select_from_repositories,mk/spec-codezero_arm.mk)
|
||||
@@ -1,6 +0,0 @@
|
||||
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)
|
||||
@@ -1,67 +0,0 @@
|
||||
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.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
--- src/kernel/codezero/src/arch/arm/vectors.S
|
||||
+++ src/kernel/codezero/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
|
||||
--- src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memcpy.S
|
||||
+++ src/kernel/codezero/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)
|
||||
--- src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memset.S
|
||||
+++ src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memset.S
|
||||
@@ -65,4 +65,4 @@ BEGIN_PROC(memset)
|
||||
bne end
|
||||
|
||||
ldmfd sp!, {r4 - r11, pc}
|
||||
-END_PROC(_memset)
|
||||
+END_PROC(memset)
|
||||
@@ -1,166 +0,0 @@
|
||||
--- src/kernel/codezero/src/api/map.c
|
||||
+++ src/kernel/codezero/src/api/map.c
|
||||
@@ -78,6 +78,6 @@ int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid)
|
||||
retval = ret;
|
||||
}
|
||||
|
||||
- return ret;
|
||||
+ return retval;
|
||||
}
|
||||
|
||||
--- src/kernel/codezero/src/api/thread.c
|
||||
+++ src/kernel/codezero/src/api/thread.c
|
||||
@@ -497,7 +497,7 @@ out_err:
|
||||
*/
|
||||
int sys_thread_control(unsigned int flags, struct task_ids *ids)
|
||||
{
|
||||
- struct ktcb *task = 0, *pager = 0;
|
||||
+ struct ktcb *task = 0;
|
||||
int err, ret = 0;
|
||||
|
||||
if ((err = check_access((unsigned long)ids, sizeof(*ids),
|
||||
@@ -508,8 +508,6 @@ int sys_thread_control(unsigned int flags, struct task_ids *ids)
|
||||
if (!(task = tcb_find(ids->tid)))
|
||||
return -ESRCH;
|
||||
|
||||
- pager = task->pager;
|
||||
-
|
||||
/*
|
||||
* Caller may operate on a thread if it shares
|
||||
* the same address space with that thread's pager
|
||||
--- src/kernel/codezero/src/arch/arm/mapping-common.c
|
||||
+++ src/kernel/codezero/src/arch/arm/mapping-common.c
|
||||
@@ -313,12 +313,11 @@ int check_mapping(unsigned long vaddr, unsigned long size,
|
||||
int remove_mapping_space(struct address_space *space, unsigned long vaddr)
|
||||
{
|
||||
pmd_table_t *pmd_table;
|
||||
- int pgd_i, pmd_i;
|
||||
+ int pmd_i;
|
||||
pmd_t *pmd;
|
||||
unsigned int pmd_type, pte_type;
|
||||
|
||||
vaddr = page_align(vaddr);
|
||||
- pgd_i = PGD_INDEX(vaddr);
|
||||
pmd_i = PMD_INDEX(vaddr);
|
||||
|
||||
/*
|
||||
--- src/kernel/codezero/src/glue/arm/init.c
|
||||
+++ src/kernel/codezero/src/glue/arm/init.c
|
||||
@@ -68,8 +68,6 @@ void print_sections(void)
|
||||
/* The kip is non-standard, using 0xBB to indicate mine for now ;-) */
|
||||
void kip_init()
|
||||
{
|
||||
- struct utcb **utcb_ref;
|
||||
-
|
||||
/*
|
||||
* TODO: Adding utcb size might be useful
|
||||
*/
|
||||
@@ -86,9 +84,6 @@ void kip_init()
|
||||
|
||||
kip_init_syscalls();
|
||||
|
||||
- /* KIP + 0xFF0 is pointer to UTCB segment start address */
|
||||
- utcb_ref = (struct utcb **)((unsigned long)&kip + UTCB_KIP_OFFSET);
|
||||
-
|
||||
add_boot_mapping(virt_to_phys(&kip), USER_KIP_PAGE, PAGE_SIZE,
|
||||
MAP_USR_RO);
|
||||
printk("%s: Kernel built on %s, %s\n", __KERNELNAME__,
|
||||
--- src/kernel/codezero/loader/libs/elf/src/elf.c
|
||||
+++ src/kernel/codezero/loader/libs/elf/src/elf.c
|
||||
@@ -339,16 +339,12 @@ elf_loadFile(void *elfFile, bool phys)
|
||||
{
|
||||
int i;
|
||||
int num_pheaders;
|
||||
- int pheader_offset;
|
||||
- int pheader_type;
|
||||
if (elf_checkFile(elfFile) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
num_pheaders = elf_getNumProgramHeaders(elfFile);
|
||||
- pheader_offset = elf_getProgramHeaderOffset(elfFile, 0);
|
||||
//printf("Number of program headers: %d\n", num_pheaders);
|
||||
- //printf("Program header offset of first header from file beginning: 0x%p\n",pheader_offset);
|
||||
|
||||
/*
|
||||
* FIXME:
|
||||
@@ -373,8 +369,6 @@ elf_loadFile(void *elfFile, bool phys)
|
||||
// printf("This section's size in file: %p\n", len);
|
||||
src = (uint64_t) (uintptr_t) elfFile + elf_getProgramHeaderOffset(elfFile, i);
|
||||
// printf("Elf program header offset: %p\n", src);
|
||||
- pheader_type = elf_getProgramHeaderType(elfFile, i);
|
||||
- // printf("Elf program header type: %p\n", pheader_type);
|
||||
// Comment
|
||||
printf("Copying to range from 0x%x to 0x%x of size: 0x%x\n", (unsigned int)dest, (unsigned int)dest + (unsigned int)len, (unsigned int)len);
|
||||
memcpy((void*) (uintptr_t) dest, (void*) (uintptr_t) src, len);
|
||||
--- src/kernel/codezero/loader/libs/elf/src/elf32.c
|
||||
+++ src/kernel/codezero/loader/libs/elf/src/elf32.c
|
||||
@@ -248,7 +248,6 @@ elf32_fprintf(FILE *f, struct Elf32_Header *file, int size, const char *name, in
|
||||
struct Elf32_Shdr *sections;
|
||||
unsigned numSections;
|
||||
int i, r;
|
||||
- char *str_table;
|
||||
|
||||
fprintf(f, "Found an elf32 file called \"%s\" located "
|
||||
"at address 0x%p\n", name, file);
|
||||
@@ -307,7 +306,6 @@ elf32_fprintf(FILE *f, struct Elf32_Header *file, int size, const char *name, in
|
||||
}
|
||||
}
|
||||
if (flags & ELF_PRINT_SECTIONS) {
|
||||
- str_table = elf32_getSegmentStringTable(file);
|
||||
|
||||
printf("Section Headers:\n");
|
||||
printf(" [Nr] Name Type Addr Off\n");
|
||||
--- src/kernel/codezero/src/generic/capability.c
|
||||
+++ src/kernel/codezero/src/generic/capability.c
|
||||
@@ -403,7 +403,7 @@ struct capability *cap_match_mem(struct capability *cap,
|
||||
{
|
||||
struct sys_map_args *args = args_ptr;
|
||||
struct ktcb *target = args->task;
|
||||
- unsigned long long start, end, pfn_point;
|
||||
+ unsigned long long start, pfn_point;
|
||||
unsigned long pfn;
|
||||
unsigned int perms;
|
||||
|
||||
@@ -415,7 +415,6 @@ struct capability *cap_match_mem(struct capability *cap,
|
||||
|
||||
/* Long long range check to avoid overflow */
|
||||
start = cap->start;
|
||||
- end = cap->end;
|
||||
pfn_point = pfn;
|
||||
if (start > pfn_point || cap->end < pfn_point + args->npages)
|
||||
return 0;
|
||||
--- src/kernel/codezero/loader/main.c
|
||||
+++ src/kernel/codezero/loader/main.c
|
||||
@@ -26,7 +26,6 @@ int load_elf_image(unsigned long **entry, void *filebuf);
|
||||
int load_container_image(void *cont_section)
|
||||
{
|
||||
struct Elf32_Header *elf_header = (struct Elf32_Header *)cont_section;
|
||||
- struct Elf32_Shdr *sect_header;
|
||||
int nsect;
|
||||
int nimgs = 0;
|
||||
unsigned long *image_entry;
|
||||
@@ -36,7 +35,6 @@ int load_container_image(void *cont_section)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- sect_header = elf32_getSectionTable(elf_header);
|
||||
nsect = elf32_getNumSections(elf_header);
|
||||
|
||||
for (int i = 0; i < nsect; i++) {
|
||||
@@ -59,7 +57,6 @@ int load_container_image(void *cont_section)
|
||||
int load_container_images(unsigned long start, unsigned long end)
|
||||
{
|
||||
struct Elf32_Header *elf_header = (struct Elf32_Header *)start;
|
||||
- struct Elf32_Shdr *sect_header;
|
||||
int nsect = 0;
|
||||
int nconts = 0;
|
||||
|
||||
@@ -68,7 +65,6 @@ int load_container_images(unsigned long start, unsigned long end)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- sect_header = elf32_getSectionTable(elf_header);
|
||||
nsect = elf32_getNumSections(elf_header);
|
||||
|
||||
for (int i = 0; i < nsect; i++) {
|
||||
@@ -1,8 +0,0 @@
|
||||
--- src/kernel/codezero/loader/main.c
|
||||
+++ src/kernel/codezero/loader/main.c
|
||||
@@ -135,3 +135,5 @@ int main(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+
|
||||
+asm(".global __aeabi_unwind_cpp_pr0; __aeabi_unwind_cpp_pr0:");
|
||||
@@ -1,19 +0,0 @@
|
||||
--- src/kernel/codezero/conts/userlibs/SConstruct
|
||||
+++ src/kernel/codezero/conts/userlibs/SConstruct
|
||||
@@ -11,6 +11,7 @@ PROJRELROOT = '../..'
|
||||
sys.path.append(PROJRELROOT)
|
||||
|
||||
from scripts.config.config_invoke import *
|
||||
+from scripts.config.projpaths import *
|
||||
|
||||
config = configuration_retrieve()
|
||||
gcc_arch_flag = config.gcc_arch_flag
|
||||
@@ -28,7 +29,7 @@ env = Environment(CC = config.toolchain_userspace + 'gcc',
|
||||
ASFLAGS = ['-D__ASSEMBLY__', '-march=' + gcc_arch_flag],
|
||||
ENV = {'PATH' : os.environ['PATH']},
|
||||
LIBS = 'gcc', # libgcc.a - Required for division routines.
|
||||
- CPPPATH = KERNEL_HEADERS,
|
||||
+ CPPPATH = [KERNEL_HEADERS, LIBC_INCLUDE],
|
||||
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
|
||||
|
||||
# Set the build directory for this source tree
|
||||
@@ -1,91 +0,0 @@
|
||||
--- src/kernel/codezero/src/drivers/SConscript
|
||||
+++ src/kernel/codezero/src/drivers/SConscript
|
||||
@@ -8,24 +8,24 @@ src_local = []
|
||||
objs = []
|
||||
|
||||
objs += SConscript("uart/pl011/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'pl011'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'pl011'))
|
||||
|
||||
objs += SConscript("timer/sp804/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'timer'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'timer'))
|
||||
|
||||
objs += SConscript("irq/pl190/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'vic'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'vic'))
|
||||
|
||||
objs += SConscript("irq/gic/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'gic'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'gic'))
|
||||
|
||||
objs += SConscript("irq/omap3/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'omap/intc'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'omap/intc'))
|
||||
|
||||
objs += SConscript("uart/omap/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'omap/uart'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'omap/uart'))
|
||||
|
||||
objs += SConscript("timer/omap/SConscript", exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = join(bdir, 'omap/timer'))
|
||||
+ duplicate=0, variant_dir = join(bdir, 'omap/timer'))
|
||||
|
||||
Return('objs')
|
||||
--- src/kernel/codezero/conts/baremetal/empty/SConstruct
|
||||
+++ src/kernel/codezero/conts/baremetal/empty/SConstruct
|
||||
@@ -48,7 +48,7 @@ env = Environment(CC = config.toolchain_userspace + 'gcc',
|
||||
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
|
||||
|
||||
objs = SConscript('SConscript', exports = { 'env' : env },
|
||||
- duplicate=0, build_dir = builddir)
|
||||
+ duplicate=0, variant_dir = builddir)
|
||||
|
||||
Depends(objs, join(PROJROOT, CONFIG_H))
|
||||
prog = env.Program(join(builddir, 'main.elf'), objs)
|
||||
--- src/kernel/codezero/SConstruct
|
||||
+++ src/kernel/codezero/SConstruct
|
||||
@@ -71,35 +71,35 @@ env = Environment(CC = config.toolchain_kernel + 'gcc',
|
||||
objects = []
|
||||
objects += SConscript('src/generic/SConscript',
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, 'generic'))
|
||||
+ variant_dir = join(builddir, 'generic'))
|
||||
|
||||
objects += SConscript(join(join('src/glue', arch), 'SConscript'),
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, join('glue',arch)))
|
||||
+ variant_dir = join(builddir, join('glue',arch)))
|
||||
|
||||
objects += SConscript(join(join('src/arch', arch), 'SConscript'),
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, join('arch', arch)))
|
||||
+ variant_dir = join(builddir, join('arch', arch)))
|
||||
|
||||
objects += SConscript(join(join('src/arch', arch), join(subarch, 'SConscript')),
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, join(join('arch',arch), subarch)))
|
||||
+ variant_dir = join(builddir, join(join('arch',arch), subarch)))
|
||||
|
||||
objects += SConscript('src/lib/SConscript',
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, 'lib'))
|
||||
+ variant_dir = join(builddir, 'lib'))
|
||||
|
||||
objects += SConscript('src/api/SConscript',
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, 'api'))
|
||||
+ variant_dir = join(builddir, 'api'))
|
||||
|
||||
objects += SConscript('src/drivers/SConscript',
|
||||
exports = { 'env' : env, 'bdir' : 'driver/'}, duplicate = 0,
|
||||
- build_dir = join(builddir, 'driver'))
|
||||
+ variant_dir = join(builddir, 'driver'))
|
||||
|
||||
objects += SConscript(join(join('src/platform', platform), 'SConscript'),
|
||||
exports = { 'env' : env }, duplicate = 0,
|
||||
- build_dir = join(builddir, join('platform', platform)))
|
||||
+ variant_dir = join(builddir, join('platform', platform)))
|
||||
|
||||
|
||||
# Add builders for generating kernel linker scripts
|
||||
@@ -1,11 +0,0 @@
|
||||
--- src/kernel/codezero/include/l4/generic/tcb.h
|
||||
+++ src/kernel/codezero/include/l4/generic/tcb.h
|
||||
@@ -70,7 +70,7 @@ struct task_ids {
|
||||
|
||||
struct container;
|
||||
|
||||
-#define tcb_pagerid(tcb) ((tcb)->pager->tid)
|
||||
+#define tcb_pagerid(tcb) 4
|
||||
|
||||
#define space_is_pager(tcb) \
|
||||
((tcb)->space->spid == (tcb)->pager->space->spid)
|
||||
@@ -1 +0,0 @@
|
||||
fb29b6a49c1e6ee759e034da8a59cf66b7ed74ef
|
||||
@@ -1,9 +0,0 @@
|
||||
LICENSE := GPLv3
|
||||
VERSION := git
|
||||
DOWNLOADS := codezero.git
|
||||
|
||||
URL(codezero) := https://github.com/nfeske/codezero.git
|
||||
REV(codezero) := 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8
|
||||
DIR(codezero) := src/kernel/codezero
|
||||
|
||||
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)
|
||||
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
* \brief Console backend for PL011 UART on Codezero
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-03
|
||||
*
|
||||
* This code assumes a PL011 UART as provided by 'qemu -M versatilepb'. Prior
|
||||
* executing this code, the kernel already initialized the UART to print some
|
||||
* startup message. So we can skip the UART initialization here. The kernel
|
||||
* maps the UART registers to the magic address PL011_BASE when starting mm0.
|
||||
* So we can just start using the device without any precautions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/console.h>
|
||||
|
||||
/* codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
|
||||
/**
|
||||
* Base address of default-mapped UART device
|
||||
*
|
||||
* defined in 'l4/arch/arm/io.h'
|
||||
*/
|
||||
enum { PL011_BASE = USERSPACE_CONSOLE_VBASE };
|
||||
|
||||
/**
|
||||
* UART registers
|
||||
*/
|
||||
enum { PL011_REG_UARTDR = PL011_BASE + 0x00 };
|
||||
enum { PL011_REG_UARTFR = PL011_BASE + 0x18 };
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if UART is ready to transmit a character
|
||||
*/
|
||||
static bool pl011_tx_ready()
|
||||
{
|
||||
enum { PL011_TX_FIFO_FULL = 1 << 5 };
|
||||
return !(*((volatile unsigned *)PL011_REG_UARTFR) & PL011_TX_FIFO_FULL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output character to serial port
|
||||
*/
|
||||
static void pl011_out_char(uint8_t c)
|
||||
{
|
||||
/* wait until serial port is ready */
|
||||
while (!pl011_tx_ready());
|
||||
|
||||
/* output character */
|
||||
*((volatile unsigned int *)PL011_REG_UARTDR) = c;
|
||||
}
|
||||
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
class Core_console : public Console
|
||||
{
|
||||
protected:
|
||||
|
||||
void _out_char(char c) {
|
||||
if(c == '\n')
|
||||
pl011_out_char('\r');
|
||||
pl011_out_char(c);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* \brief Support for exceptions libsupc++
|
||||
* \author Norman Feske
|
||||
* \author Sebastian Sumpf
|
||||
* \date 2006-07-21
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-2013 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.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
|
||||
extern "C" char __eh_frame_start__[]; /* from linker script */
|
||||
extern "C" void __register_frame (const void *begin); /* from libgcc_eh */
|
||||
|
||||
/*
|
||||
* This symbol is set by Genode's dynamic linker (ldso) during binary setup.
|
||||
* After setup, the symbol will point to the actual implementation of
|
||||
* 'dl_iterate_phdr', which is located within the linker. 'dl_iterate_phdr'
|
||||
* iterates through all (linker loaded) binaries and shared libraries. This
|
||||
* function has to be implemented in order to support C++ exceptions within
|
||||
* shared libraries.
|
||||
* Return values of dl_iterate_phdr (gcc 4.2.4):
|
||||
* < 0 = error
|
||||
* 0 = continue program header iteration
|
||||
* > 0 = stop iteration (no errors occured)
|
||||
*
|
||||
* See also: man dl_iterate_phdr
|
||||
*/
|
||||
int (*genode__dl_iterate_phdr) (int (*callback) (void *info, unsigned long size, void *data), void *data) = 0;
|
||||
|
||||
extern "C" int dl_iterate_phdr(int (*callback) (void *info, unsigned long size, void *data), void *data) __attribute__((weak));
|
||||
extern "C" int dl_iterate_phdr(int (*callback) (void *info, unsigned long size, void *data), void *data)
|
||||
{
|
||||
if (!genode__dl_iterate_phdr)
|
||||
return -1;
|
||||
|
||||
return genode__dl_iterate_phdr(callback, data);
|
||||
}
|
||||
|
||||
extern "C" void raise()
|
||||
{
|
||||
PDBG("raise called - not implemented\n");
|
||||
}
|
||||
|
||||
void init_exception_handling()
|
||||
{
|
||||
// __register_frame(__eh_frame_start__);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* \brief Functions required for using the arm-none-linux-gnueabi tool chain
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
#include <base/stdint.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
extern "C" int raise(int sig)
|
||||
{
|
||||
PWRN("raise - not yet implemented");
|
||||
return 0;
|
||||
}
|
||||
30
repos/base-codezero/src/base/env/utcb.cc
vendored
30
repos/base-codezero/src/base/env/utcb.cc
vendored
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* \brief Helper functions UTCB access on Codezero
|
||||
* \author Norman Feske
|
||||
* \date 2012-03-01
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread.h>
|
||||
|
||||
|
||||
Genode::Native_utcb *Genode::Thread_base::utcb()
|
||||
{
|
||||
/*
|
||||
* If 'utcb' is called on the object returned by 'myself',
|
||||
* the 'this' pointer may be NULL (if the calling thread is
|
||||
* the main thread). Therefore we handle this special case
|
||||
* here.
|
||||
*/
|
||||
if (this == 0) return 0;
|
||||
|
||||
return &_context->utcb;
|
||||
}
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
* \brief Codezero implementation of the IPC API
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/ipc.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/blocking.h>
|
||||
#include <util/misc_math.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Codezero;
|
||||
|
||||
enum { verbose_ipc = false };
|
||||
|
||||
|
||||
/*****************
|
||||
** Ipc_ostream **
|
||||
*****************/
|
||||
|
||||
void Ipc_ostream::_send()
|
||||
{
|
||||
if (verbose_ipc)
|
||||
PDBG("thread %d sends IPC to %d, write_offset=%d",
|
||||
thread_myself(), _dst.dst(), _write_offset);
|
||||
|
||||
umword_t snd_size = min(_write_offset, (unsigned)L4_IPC_EXTENDED_MAX_SIZE);
|
||||
|
||||
*(umword_t *)_snd_msg->addr() = _dst.local_name();
|
||||
|
||||
int ret = l4_send_extended(_dst.dst(), L4_IPC_TAG_SYNC_EXTENDED,
|
||||
snd_size, _snd_msg->addr());
|
||||
if (ret < 0)
|
||||
PERR("l4_send_extended (to thread %d) returned ret=%d",
|
||||
_dst.dst(), ret);
|
||||
|
||||
_write_offset = sizeof(umword_t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ipc_ostream::Ipc_ostream(Native_capability dst, Msgbuf_base *snd_msg)
|
||||
:
|
||||
Ipc_marshaller((char *)snd_msg->addr(), snd_msg->size()),
|
||||
_snd_msg(snd_msg), _dst(dst)
|
||||
{
|
||||
_write_offset = sizeof(umword_t);
|
||||
}
|
||||
|
||||
|
||||
/*****************
|
||||
** Ipc_istream **
|
||||
*****************/
|
||||
|
||||
void Ipc_istream::_wait()
|
||||
{
|
||||
umword_t *rcv_buf = (umword_t *)_rcv_msg->addr();
|
||||
umword_t rcv_size = min(_rcv_msg->size(), (unsigned)L4_IPC_EXTENDED_MAX_SIZE);
|
||||
|
||||
if (verbose_ipc)
|
||||
PDBG("thread %d waits for IPC from %d, rcv_buf at %p, rcv_size=%d",
|
||||
dst(), _rcv_cs, rcv_buf, (int)rcv_size);
|
||||
|
||||
int ret = l4_receive_extended(_rcv_cs, rcv_size, rcv_buf);
|
||||
if (ret < 0)
|
||||
PERR("l4_receive_extended (from any) returned ret=%d", ret);
|
||||
|
||||
if (verbose_ipc)
|
||||
PDBG("thread %d received IPC from %d",
|
||||
dst(), l4_get_sender());
|
||||
|
||||
_read_offset = sizeof(umword_t);
|
||||
}
|
||||
|
||||
|
||||
Ipc_istream::Ipc_istream(Msgbuf_base *rcv_msg)
|
||||
:
|
||||
Ipc_unmarshaller((char *)rcv_msg->addr(), rcv_msg->size()),
|
||||
Native_capability(thread_myself(), 0),
|
||||
_rcv_msg(rcv_msg)
|
||||
{
|
||||
_rcv_cs = L4_ANYTHREAD;
|
||||
_read_offset = sizeof(umword_t);
|
||||
}
|
||||
|
||||
|
||||
Ipc_istream::~Ipc_istream() { }
|
||||
|
||||
|
||||
/****************
|
||||
** Ipc_client **
|
||||
****************/
|
||||
|
||||
void Ipc_client::_call()
|
||||
{
|
||||
#warning l4_sendrecv_extended is not yet implemented in l4lib/arch/syslib.h
|
||||
_send();
|
||||
_rcv_cs = Ipc_ostream::_dst.dst();
|
||||
_wait();
|
||||
_rcv_cs = L4_ANYTHREAD;
|
||||
|
||||
_write_offset = _read_offset = sizeof(umword_t);
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{ }
|
||||
|
||||
|
||||
/****************
|
||||
** Ipc_server **
|
||||
****************/
|
||||
|
||||
void Ipc_server::_prepare_next_reply_wait()
|
||||
{
|
||||
/* now we have a request to reply */
|
||||
_reply_needed = true;
|
||||
|
||||
/* leave space for return value at the beginning of the msgbuf */
|
||||
_write_offset = 2*sizeof(umword_t);
|
||||
|
||||
/* receive buffer offset */
|
||||
_read_offset = sizeof(umword_t);
|
||||
}
|
||||
|
||||
|
||||
void Ipc_server::_wait()
|
||||
{
|
||||
/* wait for new server request */
|
||||
try { Ipc_istream::_wait(); } catch (Blocking_canceled) { }
|
||||
|
||||
/* define destination of next reply */
|
||||
Ipc_ostream::_dst = Native_capability(l4_get_sender(), badge());
|
||||
|
||||
_prepare_next_reply_wait();
|
||||
}
|
||||
|
||||
|
||||
void Ipc_server::_reply()
|
||||
{
|
||||
try { _send(); } catch (Ipc_error) { }
|
||||
|
||||
_prepare_next_reply_wait();
|
||||
}
|
||||
|
||||
|
||||
void Ipc_server::_reply_wait()
|
||||
{
|
||||
if (_reply_needed)
|
||||
_reply();
|
||||
|
||||
_wait();
|
||||
}
|
||||
|
||||
|
||||
Ipc_server::Ipc_server(Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg)
|
||||
:
|
||||
Ipc_istream(rcv_msg), Ipc_ostream(Native_capability(), snd_msg),
|
||||
_reply_needed(false)
|
||||
{ }
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* \brief Codezero-specific implementation of cmpxchg
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <cpu/atomic.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/lock.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
|
||||
static bool mutex_initialized;
|
||||
static Codezero::l4_mutex mutex;
|
||||
|
||||
int Genode::cmpxchg(volatile int *dest, int cmp_val, int new_val)
|
||||
{
|
||||
if (!mutex_initialized) {
|
||||
Codezero::l4_mutex_init(&mutex);
|
||||
mutex_initialized = true;
|
||||
}
|
||||
|
||||
int ret = Codezero::l4_mutex_lock(&mutex);
|
||||
if (ret < 0)
|
||||
mutex_initialized = false;
|
||||
|
||||
bool result = false;
|
||||
if (*dest == cmp_val) {
|
||||
*dest = new_val;
|
||||
result = true;
|
||||
}
|
||||
|
||||
ret = Codezero::l4_mutex_unlock(&mutex);
|
||||
if (ret < 0)
|
||||
mutex_initialized = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* \brief Helper functions for the Lock implementation
|
||||
* \author Norman Feske
|
||||
* \date 2010-04-20
|
||||
*
|
||||
* For documentation about the interface, please revisit the 'base-pistachio'
|
||||
* implementation.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/native_types.h>
|
||||
#include <base/thread.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
|
||||
extern Genode::Native_thread_id main_thread_tid;
|
||||
extern Codezero::l4_mutex main_thread_running_lock;
|
||||
|
||||
|
||||
static inline void thread_yield()
|
||||
{
|
||||
Codezero::l4_thread_switch(-1);
|
||||
}
|
||||
|
||||
|
||||
static inline bool thread_check_stopped_and_restart(Genode::Thread_base *thread_base)
|
||||
{
|
||||
Codezero::l4_mutex *running_lock = thread_base ?
|
||||
thread_base->utcb()->running_lock() :
|
||||
&main_thread_running_lock;
|
||||
Codezero::l4_mutex_unlock(running_lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static inline void thread_switch_to(Genode::Thread_base *thread_base)
|
||||
{
|
||||
Genode::Native_thread_id tid = thread_base ?
|
||||
thread_base->tid().l4id :
|
||||
main_thread_tid;
|
||||
Codezero::l4_thread_switch(tid);
|
||||
}
|
||||
|
||||
|
||||
static inline void thread_stop_myself()
|
||||
{
|
||||
Genode::Thread_base *myself = Genode::Thread_base::myself();
|
||||
Codezero::l4_mutex *running_lock = myself ?
|
||||
myself->utcb()->running_lock() :
|
||||
&main_thread_running_lock;
|
||||
Codezero::l4_mutex_lock(running_lock);
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* \brief Thread bootstrap code
|
||||
* \author Christian Prochaska
|
||||
* \author Martin Stein
|
||||
* \date 2013-02-15
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread.h>
|
||||
#include <base/env.h>
|
||||
#include <util/string.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
Genode::Native_thread_id main_thread_tid;
|
||||
Codezero::l4_mutex main_thread_running_lock;
|
||||
|
||||
|
||||
/*****************************
|
||||
** Startup library support **
|
||||
*****************************/
|
||||
|
||||
void prepare_init_main_thread()
|
||||
{
|
||||
/* initialize codezero environment */
|
||||
Codezero::__l4_init();
|
||||
|
||||
/* provide kernel identification of thread through temporary environment */
|
||||
main_thread_tid = Codezero::thread_myself();
|
||||
}
|
||||
|
||||
void prepare_reinit_main_thread() { prepare_init_main_thread(); }
|
||||
|
||||
|
||||
/****************************
|
||||
** Codezero libl4 support **
|
||||
****************************/
|
||||
|
||||
/*
|
||||
* Unfortunately, the function 'exregs_print_registers' in 'exregs.c' refers to
|
||||
* 'memset'. Because we do not want to link core against a C library, we have to
|
||||
* resolve this function here.
|
||||
*/
|
||||
extern "C" void *memset(void *s, int c, Genode::size_t n) __attribute__((weak));
|
||||
extern "C" void *memset(void *s, int c, Genode::size_t n)
|
||||
{
|
||||
return Genode::memset(s, c, n);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Same problem as for 'memset'. The 'printf' symbol is referenced from
|
||||
* 'mutex.c' and 'exregs.c' of Codezero's libl4.
|
||||
*/
|
||||
extern "C" int printf(const char *format, ...) __attribute__((weak));
|
||||
extern "C" int printf(const char *format, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, format);
|
||||
Genode::vprintf(format, list);
|
||||
va_end(list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************
|
||||
** Thread_base **
|
||||
*****************/
|
||||
|
||||
void Genode::Thread_base::_thread_bootstrap()
|
||||
{
|
||||
Codezero::l4_mutex_init(utcb()->running_lock());
|
||||
Codezero::l4_mutex_lock(utcb()->running_lock()); /* block on first mutex lock */
|
||||
}
|
||||
|
||||
|
||||
void Genode::Thread_base::_init_platform_thread(size_t, Type type)
|
||||
{
|
||||
if (type == NORMAL) { return; }
|
||||
|
||||
/* adjust values whose computation differs for a main thread */
|
||||
_tid.l4id = main_thread_tid;
|
||||
_thread_cap = Genode::env()->parent()->main_thread_cap();
|
||||
|
||||
/* get first mutex lock (normally done by _thread_bootstrap) */
|
||||
Codezero::l4_mutex_init(utcb()->running_lock());
|
||||
Codezero::l4_mutex_lock(utcb()->running_lock());
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* \brief NOVA-specific implementation of the Thread API
|
||||
* \author Norman Feske
|
||||
* \date 2010-01-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/sleep.h>
|
||||
#include <base/env.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
/**
|
||||
* Entry point entered by new threads
|
||||
*/
|
||||
void Thread_base::_thread_start()
|
||||
{
|
||||
Thread_base::myself()->_thread_bootstrap();
|
||||
Thread_base::myself()->entry();
|
||||
Thread_base::myself()->_join_lock.unlock();
|
||||
Genode::sleep_forever();
|
||||
}
|
||||
|
||||
|
||||
/*****************
|
||||
** Thread base **
|
||||
*****************/
|
||||
|
||||
void Thread_base::_deinit_platform_thread()
|
||||
{
|
||||
_cpu_session->kill_thread(_thread_cap);
|
||||
env()->rm_session()->remove_client(_pager_cap);
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::start()
|
||||
{
|
||||
/* if no cpu session is given, use it from the environment */
|
||||
if (!_cpu_session)
|
||||
_cpu_session = env()->cpu_session();
|
||||
|
||||
/* create thread at core */
|
||||
char buf[48];
|
||||
name(buf, sizeof(buf));
|
||||
enum { WEIGHT = Cpu_session::DEFAULT_WEIGHT };
|
||||
_thread_cap = _cpu_session->create_thread(WEIGHT, buf);
|
||||
|
||||
/* assign thread to protection domain */
|
||||
env()->pd_session()->bind_thread(_thread_cap);
|
||||
|
||||
/* create new pager object and assign it to the new thread */
|
||||
_pager_cap = env()->rm_session()->add_client(_thread_cap);
|
||||
_cpu_session->set_pager(_thread_cap, _pager_cap);
|
||||
|
||||
/* register initial IP and SP at core */
|
||||
_cpu_session->start(_thread_cap, (addr_t)_thread_start, _context->stack_top());
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::cancel_blocking()
|
||||
{
|
||||
Codezero::l4_mutex_unlock(utcb()->running_lock());
|
||||
_cpu_session->cancel_blocking(_thread_cap);
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* \brief Core-local RM session
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* core includes */
|
||||
#include <core_rm_session.h>
|
||||
#include <platform.h>
|
||||
#include <map_local.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
Rm_session::Local_addr
|
||||
Core_rm_session::attach(Dataspace_capability ds_cap, size_t size,
|
||||
off_t offset, bool use_local_addr,
|
||||
Rm_session::Local_addr local_addr,
|
||||
bool executable)
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
Object_pool<Dataspace_component>::Guard ds(_ds_ep->lookup_and_lock(ds_cap));
|
||||
if (!ds)
|
||||
throw Invalid_dataspace();
|
||||
|
||||
if (size == 0)
|
||||
size = ds->size();
|
||||
|
||||
size_t page_rounded_size = (size + get_page_size() - 1) & get_page_mask();
|
||||
size_t num_pages = page_rounded_size >> get_page_size_log2();
|
||||
|
||||
if (use_local_addr) {
|
||||
PERR("Parameter 'use_local_addr' not supported within core");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (offset) {
|
||||
PERR("Parameter 'offset' not supported within core");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* allocate range in core's virtual address space */
|
||||
void *virt_addr;
|
||||
if (!platform()->region_alloc()->alloc(page_rounded_size, &virt_addr)) {
|
||||
PERR("Could not allocate virtual address range in core of size %zd\n",
|
||||
page_rounded_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!map_local(ds->phys_addr(), (addr_t)virt_addr, num_pages)) {
|
||||
PERR("core-local memory mapping failed virt=%lx, phys=%lx\n",
|
||||
(addr_t)virt_addr, ds->phys_addr());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return virt_addr;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* \brief Platform-specific parts of cores CPU-service
|
||||
* \author Martin Stein
|
||||
* \date 2012-04-17
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* Core includes */
|
||||
#include <cpu_session_component.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability thread_cap)
|
||||
{
|
||||
PERR("%s: Not implemented", __PRETTY_FUNCTION__);
|
||||
return Ram_dataspace_capability();
|
||||
}
|
||||
|
||||
|
||||
Cpu_session::Quota Cpu_session_component::quota() { return Quota(); }
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* \brief Core-local region manager session
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 _CORE__INCLUDE__CORE_RM_SESSION_H_
|
||||
#define _CORE__INCLUDE__CORE_RM_SESSION_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <rm_session/rm_session.h>
|
||||
|
||||
/* core includes */
|
||||
#include <dataspace_component.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Core_rm_session : public Rm_session
|
||||
{
|
||||
private:
|
||||
|
||||
Rpc_entrypoint *_ds_ep;
|
||||
|
||||
public:
|
||||
|
||||
Core_rm_session(Rpc_entrypoint *ds_ep) : _ds_ep(ds_ep) { }
|
||||
|
||||
Local_addr attach(Dataspace_capability ds_cap, size_t size = 0,
|
||||
off_t offset = 0, bool use_local_addr = false,
|
||||
Local_addr local_addr = 0,
|
||||
bool executable = false);
|
||||
|
||||
void detach(Local_addr) { }
|
||||
|
||||
Pager_capability add_client(Thread_capability) {
|
||||
return Pager_capability(); }
|
||||
|
||||
void remove_client(Pager_capability) { }
|
||||
|
||||
void fault_handler(Signal_context_capability) { }
|
||||
|
||||
State state() { return State(); }
|
||||
|
||||
Dataspace_capability dataspace() { return Dataspace_capability(); }
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__CORE_RM_SESSION_H_ */
|
||||
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* \brief Dummy pager support for Genode
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 _CORE__INCLUDE__IPC_PAGER_H_
|
||||
#define _CORE__INCLUDE__IPC_PAGER_H_
|
||||
|
||||
#include <base/cache.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,
|
||||
Cache_attribute const cacheability, bool io_mem,
|
||||
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
|
||||
{
|
||||
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:
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Returns true if the last request was send from a core thread
|
||||
*/
|
||||
bool request_from_core() { return true; }
|
||||
|
||||
/**
|
||||
* Return badge for faulting thread
|
||||
*/
|
||||
unsigned long badge() const { return _last; }
|
||||
|
||||
/**
|
||||
* 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 /* _CORE__INCLUDE__IPC_PAGER_H_ */
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* \brief Core-local mapping
|
||||
* \author Norman Feske
|
||||
* \date 2010-02-15
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 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 _CORE__INCLUDE__MAP_LOCAL_H_
|
||||
#define _CORE__INCLUDE__MAP_LOCAL_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* core includes */
|
||||
#include <util.h>
|
||||
|
||||
|
||||
namespace Genode {
|
||||
|
||||
/**
|
||||
* Map physical pages to core-local virtual address range
|
||||
*
|
||||
* On Codezero, mappings originate from the physical address space.
|
||||
*
|
||||
* \param from_phys physical source address
|
||||
* \param to_virt core-local destination address
|
||||
* \param num_pages number of pages to map
|
||||
*
|
||||
* \return true on success
|
||||
*/
|
||||
inline bool map_local(addr_t from_phys, addr_t to_virt, size_t num_pages)
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
int res = l4_map((void *)from_phys, (void *)to_virt,
|
||||
num_pages, MAP_USR_RW, thread_myself());
|
||||
if (res < 0) {
|
||||
PERR("l4_map phys 0x%lx -> 0x%lx returned %d", from_phys, to_virt, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
inline bool unmap_local(addr_t virt_addr, size_t num_pages)
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
int res = l4_unmap((void *)virt_addr, num_pages, thread_myself());
|
||||
if (res < 0) {
|
||||
PERR("l4_unmap returned %d", res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__MAP_LOCAL_H_ */
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* \brief Platform interface
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 _CORE__INCLUDE__PLATFORM_H_
|
||||
#define _CORE__INCLUDE__PLATFORM_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* local includes */
|
||||
#include <platform_generic.h>
|
||||
#include <core_mem_alloc.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform : public Platform_generic
|
||||
{
|
||||
private:
|
||||
|
||||
typedef Core_mem_allocator::Phys_allocator Phys_allocator;
|
||||
|
||||
Core_mem_allocator _core_mem_alloc; /* core-accessible memory */
|
||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
||||
Phys_allocator _irq_alloc; /* IRQ allocator */
|
||||
Rom_fs _rom_fs; /* ROM file system */
|
||||
|
||||
/**
|
||||
* Virtual address range usable by non-core processes
|
||||
*/
|
||||
addr_t _vm_base;
|
||||
size_t _vm_size;
|
||||
|
||||
int _init_rom_fs();
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform();
|
||||
|
||||
|
||||
/********************************
|
||||
** Generic platform interface **
|
||||
********************************/
|
||||
|
||||
Range_allocator *ram_alloc() { return _core_mem_alloc.phys_alloc(); }
|
||||
Range_allocator *io_mem_alloc() { return &_io_mem_alloc; }
|
||||
Range_allocator *io_port_alloc() { return &_io_port_alloc; }
|
||||
Range_allocator *irq_alloc() { return &_irq_alloc; }
|
||||
Range_allocator *region_alloc() { return _core_mem_alloc.virt_alloc(); }
|
||||
Range_allocator *core_mem_alloc() { return &_core_mem_alloc; }
|
||||
addr_t vm_start() const { return _vm_base; }
|
||||
size_t vm_size() const { return _vm_size; }
|
||||
Rom_fs *rom_fs() { return &_rom_fs; }
|
||||
|
||||
void wait_for_exit();
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__PLATFORM_H_ */
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* \brief Protection-domain facility
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 _CORE__INCLUDE__PLATFORM_PD_H_
|
||||
#define _CORE__INCLUDE__PLATFORM_PD_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/allocator.h>
|
||||
|
||||
/* core includes */
|
||||
#include <platform_thread.h>
|
||||
#include <address_space.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_thread;
|
||||
class Platform_pd : public Address_space
|
||||
{
|
||||
private:
|
||||
|
||||
enum { MAX_THREADS_PER_PD = 32 };
|
||||
enum { UTCB_VIRT_BASE = 0x30000000 };
|
||||
enum { UTCB_AREA_SIZE = MAX_THREADS_PER_PD*sizeof(struct Codezero::utcb) };
|
||||
|
||||
unsigned _space_id;
|
||||
|
||||
bool utcb_in_use[MAX_THREADS_PER_PD];
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructors
|
||||
*/
|
||||
Platform_pd(bool core);
|
||||
Platform_pd(Allocator * md_alloc, char const *,
|
||||
signed pd_id = -1, bool create = true);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Platform_pd();
|
||||
|
||||
/**
|
||||
* Register quota donation at allocator guard
|
||||
*/
|
||||
void upgrade_ram_quota(size_t ram_quota) { }
|
||||
|
||||
/**
|
||||
* Bind thread to protection domain
|
||||
*
|
||||
* \return 0 on success or
|
||||
* -1 if thread ID allocation failed.
|
||||
*/
|
||||
int bind_thread(Platform_thread *thread);
|
||||
|
||||
/**
|
||||
* Unbind thread from protection domain
|
||||
*
|
||||
* Free the thread's slot and update thread object.
|
||||
*/
|
||||
void unbind_thread(Platform_thread *thread);
|
||||
|
||||
/**
|
||||
* Assign parent interface to protection domain
|
||||
*/
|
||||
int assign_parent(Native_capability parent) { return 0; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
void flush(addr_t, size_t) { PDBG("not implemented"); }
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */
|
||||
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
* \brief Thread facility
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 _CORE__INCLUDE__PLATFORM_THREAD_H_
|
||||
#define _CORE__INCLUDE__PLATFORM_THREAD_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread_state.h>
|
||||
#include <base/native_types.h>
|
||||
|
||||
/* core includes */
|
||||
#include <pager.h>
|
||||
#include <address_space.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_pd;
|
||||
class Platform_thread
|
||||
{
|
||||
private:
|
||||
|
||||
friend class Platform_pd;
|
||||
|
||||
enum { PD_NAME_MAX_LEN = 64 };
|
||||
|
||||
unsigned _tid; /* global codezero thread ID */
|
||||
unsigned _space_id;
|
||||
Weak_ptr<Address_space> _address_space;
|
||||
addr_t _utcb;
|
||||
char _name[PD_NAME_MAX_LEN];
|
||||
Pager_object *_pager;
|
||||
|
||||
/**
|
||||
* Assign physical thread ID and UTCB address to thread
|
||||
*
|
||||
* This function is called from 'Platform_pd::bind_thread'.
|
||||
*/
|
||||
void _assign_physical_thread(unsigned tid, unsigned space_id,
|
||||
addr_t utcb,
|
||||
Weak_ptr<Address_space> address_space)
|
||||
{
|
||||
_tid = tid; _space_id = space_id; _utcb = utcb;
|
||||
_address_space = address_space;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
enum { THREAD_INVALID = -1 }; /* invalid thread number */
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_thread(size_t, const char *name = 0, unsigned priority = 0,
|
||||
addr_t utcb = 0, int thread_id = THREAD_INVALID);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Platform_thread();
|
||||
|
||||
/**
|
||||
* Start thread
|
||||
*
|
||||
* \param ip instruction pointer to start at
|
||||
* \param sp stack pointer to use
|
||||
* \param cpu_no target cpu
|
||||
*
|
||||
* \retval 0 successful
|
||||
* \retval -1 thread could not be started
|
||||
*/
|
||||
int start(void *ip, void *sp, unsigned int cpu_no = 0);
|
||||
|
||||
/**
|
||||
* Pause this thread
|
||||
*/
|
||||
void pause();
|
||||
|
||||
/**
|
||||
* Resume this thread
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* Override thread state with 's'
|
||||
*
|
||||
* \throw Cpu_session::State_access_failed
|
||||
*/
|
||||
void state(Thread_state s);
|
||||
|
||||
/**
|
||||
* Read thread state
|
||||
*
|
||||
* \throw Cpu_session::State_access_failed
|
||||
*/
|
||||
Thread_state state();
|
||||
|
||||
/**
|
||||
* Return the address space to which the thread is bound
|
||||
*/
|
||||
Weak_ptr<Address_space> address_space();
|
||||
|
||||
|
||||
/************************
|
||||
** Accessor functions **
|
||||
************************/
|
||||
|
||||
/**
|
||||
* Set pager capability
|
||||
*/
|
||||
Pager_object *pager(Pager_object *pager) const { return _pager; }
|
||||
void pager(Pager_object *pager) { _pager = pager; }
|
||||
Pager_object *pager() { return _pager; }
|
||||
|
||||
/**
|
||||
* Return identification of thread when faulting
|
||||
*/
|
||||
unsigned long pager_object_badge() const { return _tid; }
|
||||
|
||||
/**
|
||||
* Set the executing CPU for this thread
|
||||
*/
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Get the executing CPU for this thread
|
||||
*/
|
||||
Affinity::Location affinity() const { return Affinity::Location(); }
|
||||
|
||||
/**
|
||||
* Get thread name
|
||||
*/
|
||||
const char *name() const { return "noname"; }
|
||||
|
||||
|
||||
/***********************
|
||||
** Codezero specific **
|
||||
***********************/
|
||||
|
||||
addr_t utcb() const { return _utcb; }
|
||||
|
||||
/**
|
||||
* Set CPU quota of the thread to 'quota'
|
||||
*/
|
||||
void quota(size_t const quota) { /* not supported*/ }
|
||||
|
||||
/**
|
||||
* Return execution time consumed by the thread
|
||||
*/
|
||||
unsigned long long execution_time() const { return 0; }
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* \brief Core-internal utilities
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 _CORE__INCLUDE__UTIL_H_
|
||||
#define _CORE__INCLUDE__UTIL_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <rm_session/rm_session.h>
|
||||
#include <base/printf.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
constexpr size_t get_page_size_log2() { return 12; }
|
||||
constexpr size_t get_page_size() { return 1 << get_page_size_log2(); }
|
||||
constexpr addr_t get_page_mask() { return ~(get_page_size() - 1); }
|
||||
inline addr_t trunc_page(addr_t addr) { return addr & get_page_mask(); }
|
||||
inline addr_t round_page(addr_t addr) { return trunc_page(addr + get_page_size() - 1); }
|
||||
|
||||
inline addr_t map_src_addr(addr_t core_local, addr_t phys) { return phys; }
|
||||
inline size_t constrain_map_size_log2(size_t size_log2) { return get_page_size_log2(); }
|
||||
|
||||
inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip,
|
||||
Rm_session::Fault_type pf_type,
|
||||
unsigned long faulter_badge)
|
||||
{
|
||||
printf("%s (%s pf_addr=%p pf_ip=%p from %02lx)\n", msg,
|
||||
pf_type == Rm_session::WRITE_FAULT ? "WRITE" : "READ",
|
||||
(void *)pf_addr, (void *)pf_ip,
|
||||
faulter_badge);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__UTIL_H_ */
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* \brief Implementation of the IO_MEM session interface
|
||||
* \author Norman Feske
|
||||
* \date 2009-03-29
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* core includes */
|
||||
#include <io_mem_session_component.h>
|
||||
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
void Io_mem_session_component::_unmap_local(addr_t base, size_t size)
|
||||
{ }
|
||||
|
||||
|
||||
addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
|
||||
{ return 0; }
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
* \brief Implementation of IRQ session component
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* core includes */
|
||||
#include <irq_root.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
bool Irq_object::_associate() { return true; }
|
||||
|
||||
|
||||
void Irq_object::_wait_for_irq()
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
/* block for IRQ */
|
||||
int ret = l4_irq_control(IRQ_CONTROL_WAIT, 0, _irq);
|
||||
if (ret < 0)
|
||||
PWRN("l4_irq_control(IRQ_CONTROL_WAIT) returned %d", ret);
|
||||
}
|
||||
|
||||
|
||||
void Irq_object::start()
|
||||
{
|
||||
::Thread_base::start();
|
||||
_sync_bootup.lock();
|
||||
}
|
||||
|
||||
|
||||
void Irq_object::entry()
|
||||
{
|
||||
if (!_associate()) {
|
||||
PERR("Could not associate with IRQ 0x%x", _irq);
|
||||
return;
|
||||
}
|
||||
|
||||
/* thread is up and ready */
|
||||
_sync_bootup.unlock();
|
||||
|
||||
/* wait for first ack_irq */
|
||||
_sync_ack.lock();
|
||||
|
||||
using namespace Codezero;
|
||||
|
||||
/* attach thread to IRQ when first called */
|
||||
int ret = l4_irq_control(IRQ_CONTROL_REGISTER, 0, _irq);
|
||||
if (ret < 0) {
|
||||
PERR("l4_irq_control(IRQ_CONTROL_REGISTER) returned %d", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
|
||||
_wait_for_irq();
|
||||
|
||||
if (!_sig_cap.valid())
|
||||
continue;
|
||||
|
||||
Genode::Signal_transmitter(_sig_cap).submit(1);
|
||||
|
||||
_sync_ack.lock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Irq_object::Irq_object(unsigned irq)
|
||||
:
|
||||
Thread<4096>("irq"),
|
||||
_sync_ack(Lock::LOCKED), _sync_bootup(Lock::LOCKED),
|
||||
_irq(irq)
|
||||
{ }
|
||||
|
||||
|
||||
Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
const char *args)
|
||||
:
|
||||
_irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
|
||||
_irq_alloc(irq_alloc),
|
||||
_irq_object(_irq_number)
|
||||
{
|
||||
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
|
||||
if (msi)
|
||||
throw Root::Unavailable();
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
|
||||
PERR("Unavailable IRQ 0x%x requested", _irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
||||
_irq_object.start();
|
||||
}
|
||||
|
||||
|
||||
Irq_session_component::~Irq_session_component()
|
||||
{
|
||||
PERR("Not yet implemented.");
|
||||
}
|
||||
|
||||
|
||||
void Irq_session_component::ack_irq()
|
||||
{
|
||||
_irq_object.ack_irq();
|
||||
}
|
||||
|
||||
|
||||
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
|
||||
{
|
||||
_irq_object.sigh(cap);
|
||||
}
|
||||
|
||||
|
||||
Genode::Irq_session::Info Irq_session_component::info()
|
||||
{
|
||||
/* no MSI support */
|
||||
return { .type = Genode::Irq_session::Info::Type::INVALID };
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
/*
|
||||
* \brief Pager support for Codezero
|
||||
* \author Norman Feske
|
||||
* \date 2010-02-16
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <pager.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <ipc_pager.h>
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Codezero;
|
||||
|
||||
enum { verbose_page_faults = false };
|
||||
|
||||
|
||||
/************************
|
||||
** Page-fault utility **
|
||||
************************/
|
||||
|
||||
class Fault
|
||||
{
|
||||
public:
|
||||
|
||||
enum Type { READ, WRITE, EXEC, UNKNOWN };
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Translate Codezero page-fault information to generic fault type
|
||||
*
|
||||
* \param sr status
|
||||
* \param pte page-table entry
|
||||
*/
|
||||
static Type _fault_type(umword_t sr, umword_t pte)
|
||||
{
|
||||
if (is_prefetch_abort(sr))
|
||||
return EXEC;
|
||||
|
||||
if ((pte & PTE_PROT_MASK) == (__MAP_USR_RO & PTE_PROT_MASK))
|
||||
return WRITE;
|
||||
|
||||
return READ;
|
||||
}
|
||||
|
||||
Type _type;
|
||||
umword_t _addr;
|
||||
umword_t _ip;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* \param kdata Codezero-specific page-fault information
|
||||
*/
|
||||
Fault(struct fault_kdata const &kdata)
|
||||
:
|
||||
_type(_fault_type(kdata.fsr, kdata.pte)),
|
||||
_addr(_type == EXEC ? kdata.faulty_pc : kdata.far),
|
||||
_ip(kdata.faulty_pc)
|
||||
{ }
|
||||
|
||||
Type type() const { return _type; }
|
||||
umword_t addr() const { return _addr; }
|
||||
umword_t ip() const { return _ip; }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Print page-fault information in a human-readable form
|
||||
*/
|
||||
inline void print_page_fault(Fault &fault, int from)
|
||||
{
|
||||
printf("page (%s%s%s) fault from %d at pf_addr=%lx, pf_ip=%lx\n",
|
||||
fault.type() == Fault::READ ? "r" : "-",
|
||||
fault.type() == Fault::WRITE ? "w" : "-",
|
||||
fault.type() == Fault::EXEC ? "x" : "-",
|
||||
from, fault.addr(), fault.ip());
|
||||
}
|
||||
|
||||
|
||||
/***************
|
||||
** IPC pager **
|
||||
***************/
|
||||
|
||||
void Ipc_pager::wait_for_fault()
|
||||
{
|
||||
for (;;) {
|
||||
int ret = l4_receive(L4_ANYTHREAD);
|
||||
|
||||
if (ret < 0) {
|
||||
PERR("pager: l4_received returned ret=%d", ret);
|
||||
continue;
|
||||
}
|
||||
|
||||
umword_t tag = l4_get_tag();
|
||||
int faulter_tid = l4_get_sender();
|
||||
|
||||
if (tag != L4_IPC_TAG_PFAULT) {
|
||||
PWRN("got an unexpected IPC from %d", faulter_tid);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* copy fault information from message registers */
|
||||
struct fault_kdata fault_kdata;
|
||||
for (unsigned i = 0; i < sizeof(fault_kdata_t)/sizeof(umword_t); i++)
|
||||
((umword_t *)&fault_kdata)[i] = read_mr(MR_UNUSED_START + i);
|
||||
|
||||
Fault fault(fault_kdata);
|
||||
|
||||
if (verbose_page_faults)
|
||||
print_page_fault(fault, faulter_tid);
|
||||
|
||||
/* determine corresponding page in our own address space */
|
||||
_pf_addr = fault.addr();
|
||||
_pf_write = fault.type() == Fault::WRITE;
|
||||
_pf_ip = fault.ip();
|
||||
_last = faulter_tid;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Ipc_pager::reply_and_wait_for_fault()
|
||||
{
|
||||
/* install mapping */
|
||||
umword_t flags = _reply_mapping.writeable() ? MAP_USR_RW
|
||||
: MAP_USR_RO;
|
||||
|
||||
/*
|
||||
* XXX: remove heuristics for mapping device registers.
|
||||
*/
|
||||
if (_reply_mapping.from_phys() == 0x10120000 /* LCD */
|
||||
|| _reply_mapping.from_phys() == 0x10006000 /* keyboard */
|
||||
|| _reply_mapping.from_phys() == 0x10007000) /* mouse */
|
||||
flags = MAP_USR_IO;
|
||||
|
||||
int ret = l4_map((void *)_reply_mapping.from_phys(),
|
||||
(void *)_reply_mapping.to_virt(),
|
||||
_reply_mapping.num_pages(), flags, _last);
|
||||
|
||||
/* wake up faulter if mapping succeeded */
|
||||
if (ret < 0)
|
||||
PERR("l4_map returned %d, putting thread %d to sleep", ret, _last);
|
||||
else
|
||||
acknowledge_wakeup();
|
||||
|
||||
/* wait for next page fault */
|
||||
wait_for_fault();
|
||||
}
|
||||
|
||||
|
||||
void Ipc_pager::acknowledge_wakeup()
|
||||
{
|
||||
enum { SUCCESS = 0 };
|
||||
l4_set_sender(_last);
|
||||
l4_ipc_return(SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
** Pager entrypoint **
|
||||
**********************/
|
||||
|
||||
Untyped_capability Pager_entrypoint::_manage(Pager_object *obj)
|
||||
{
|
||||
return Untyped_capability(_tid.l4id, obj->badge());
|
||||
}
|
||||
@@ -1,302 +0,0 @@
|
||||
/*
|
||||
* \brief Platform interface implementation
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/sleep.h>
|
||||
#include <base/thread.h>
|
||||
|
||||
/* core includes */
|
||||
#include <core_parent.h>
|
||||
#include <platform.h>
|
||||
#include <map_local.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
enum { verbose_boot_info = true };
|
||||
|
||||
/*
|
||||
* Memory-layout information provided by the linker script
|
||||
*/
|
||||
|
||||
/* virtual address range consumed by core's program image */
|
||||
extern unsigned _prog_img_beg, _prog_img_end;
|
||||
|
||||
/* physical address range occupied by core */
|
||||
extern addr_t _vma_start, _lma_start;
|
||||
|
||||
|
||||
/**************************
|
||||
** Boot-module handling **
|
||||
**************************/
|
||||
|
||||
/**
|
||||
* Scan ROM module image for boot modules
|
||||
*
|
||||
* By convention, the boot modules start at the page after core's BSS segment.
|
||||
*/
|
||||
int Platform::_init_rom_fs()
|
||||
{
|
||||
/**
|
||||
* Format of module meta-data as found in the ROM module image
|
||||
*/
|
||||
struct Module
|
||||
{
|
||||
long name; /* physical address of null-terminated string */
|
||||
long base; /* physical address of module data */
|
||||
long size; /* size of module data in bytes */
|
||||
};
|
||||
|
||||
/* find base address of ROM module image */
|
||||
addr_t phys_base = round_page((addr_t)&_prog_img_end);
|
||||
|
||||
/* map the first page of the image containing the module meta data */
|
||||
class Out_of_virtual_memory_during_rom_fs_init { };
|
||||
void *virt_base = 0;
|
||||
if (!_core_mem_alloc.virt_alloc()->alloc(get_page_size(), &virt_base))
|
||||
throw Out_of_virtual_memory_during_rom_fs_init();
|
||||
|
||||
if (!map_local(phys_base, (addr_t)virt_base, 1)) {
|
||||
PERR("map_local failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* remove page containing module infos from physical memory allocator */
|
||||
_core_mem_alloc.phys_alloc()->remove_range(phys_base, get_page_size());
|
||||
|
||||
/* validate the presence of a ROM image by checking the magic cookie */
|
||||
const char cookie[4] = {'G', 'R', 'O', 'M'};
|
||||
for (size_t i = 0; i < sizeof(cookie); i++)
|
||||
if (cookie[i] != ((char *)virt_base)[i]) {
|
||||
PERR("could not detect ROM modules");
|
||||
return -2;
|
||||
}
|
||||
|
||||
printf("detected ROM module image at 0x%p\n", (void *)phys_base);
|
||||
|
||||
/* detect overly large meta data, we only support 4K */
|
||||
addr_t end_of_header = ((long *)virt_base)[1];
|
||||
size_t header_size = end_of_header - (long)phys_base;
|
||||
if (header_size > get_page_size()) {
|
||||
PERR("ROM fs module header exceeds %d bytes", get_page_size());
|
||||
return -3;
|
||||
}
|
||||
|
||||
/* start of module list */
|
||||
Module *module = (Module *)((addr_t)virt_base + 2*sizeof(long));
|
||||
|
||||
/*
|
||||
* Interate over module list and populate core's ROM file system with
|
||||
* 'Rom_module' objects.
|
||||
*/
|
||||
for (; module->name; module++) {
|
||||
|
||||
/* convert physical address of module name to core-local address */
|
||||
char *name = (char *)(module->name - phys_base + (addr_t)virt_base);
|
||||
|
||||
printf("ROM module \"%s\" at physical address 0x%p, size=%zd\n",
|
||||
name, (void *)module->base, (size_t)module->size);
|
||||
|
||||
Rom_module *rom_module = new (core_mem_alloc())
|
||||
Rom_module(module->base, module->size, name);
|
||||
|
||||
_rom_fs.insert(rom_module);
|
||||
|
||||
/* remove module from physical memory allocator */
|
||||
_core_mem_alloc.phys_alloc()->remove_range(module->base, round_page(module->size));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/****************************************
|
||||
** Support for core memory management **
|
||||
****************************************/
|
||||
|
||||
bool Core_mem_allocator::Mapped_mem_allocator::_map_local(addr_t virt_addr,
|
||||
addr_t phys_addr,
|
||||
unsigned size)
|
||||
{
|
||||
return map_local(phys_addr, virt_addr, size / get_page_size());
|
||||
}
|
||||
|
||||
|
||||
bool Core_mem_allocator::Mapped_mem_allocator::_unmap_local(addr_t virt_addr,
|
||||
unsigned size)
|
||||
{
|
||||
return unmap_local(virt_addr, size / get_page_size());
|
||||
}
|
||||
|
||||
|
||||
/************************
|
||||
** Platform interface **
|
||||
************************/
|
||||
|
||||
Platform::Platform() :
|
||||
_io_mem_alloc(core_mem_alloc()), _io_port_alloc(core_mem_alloc()),
|
||||
_irq_alloc(core_mem_alloc()), _vm_base(0), _vm_size(0)
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
/* init core UTCB */
|
||||
static char main_utcb[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
|
||||
static struct exregs_data exregs;
|
||||
exregs_set_utcb(&exregs, (unsigned long)&main_utcb[0]);
|
||||
l4_exchange_registers(&exregs, thread_myself());
|
||||
|
||||
/* error handling is futile at this point */
|
||||
|
||||
/* read number of capabilities */
|
||||
int num_caps;
|
||||
int ret;
|
||||
if ((ret = l4_capability_control(CAP_CONTROL_NCAPS,
|
||||
0, &num_caps)) < 0) {
|
||||
PERR("l4_capability_control(CAP_CONTROL_NCAPS) returned %d", ret);
|
||||
class Could_not_obtain_num_of_capabilities { };
|
||||
throw Could_not_obtain_num_of_capabilities();
|
||||
}
|
||||
|
||||
struct capability cap_array[num_caps];
|
||||
|
||||
if (verbose_boot_info)
|
||||
printf("allocated cap array[%d] of size %d on stack\n",
|
||||
num_caps, sizeof(cap_array));
|
||||
|
||||
/* read all capabilities */
|
||||
if ((ret = l4_capability_control(CAP_CONTROL_READ,
|
||||
0, cap_array)) < 0) {
|
||||
PERR("l4_capability_control(CAP_CONTROL_READ) returned %d", ret);
|
||||
class Read_caps_failed { };
|
||||
throw Read_caps_failed();
|
||||
}
|
||||
|
||||
/* initialize core allocators */
|
||||
bool phys_mem_defined = false;
|
||||
addr_t dev_mem_base = 0;
|
||||
for (int i = 0; i < num_caps; i++) {
|
||||
struct capability *cap = &cap_array[i];
|
||||
|
||||
addr_t base = cap->start << get_page_size_log2(),
|
||||
size = cap->size << get_page_size_log2();
|
||||
|
||||
if (verbose_boot_info)
|
||||
printf("cap type=%x, rtype=%x, base=%lx, size=%lx\n",
|
||||
cap_type(cap), cap_rtype(cap), base, size);
|
||||
|
||||
switch (cap_type(cap)) {
|
||||
|
||||
case CAP_TYPE_MAP_VIRTMEM:
|
||||
|
||||
/*
|
||||
* Use first non-UTCB virtual address range as default
|
||||
* virtual memory range usable for all processes.
|
||||
*/
|
||||
if (_vm_size == 0) {
|
||||
|
||||
/* exclude page at virtual address 0 */
|
||||
if (base == 0 && size >= get_page_size()) {
|
||||
base += get_page_size();
|
||||
size -= get_page_size();
|
||||
}
|
||||
|
||||
_vm_base = base;
|
||||
_vm_size = size;
|
||||
|
||||
/* add range as free range to core's virtual address allocator */
|
||||
_core_mem_alloc.virt_alloc()->add_range(base, size);
|
||||
break;
|
||||
}
|
||||
|
||||
PWRN("ignoring additional virtual address range [%lx,%lx)",
|
||||
base, base + size);
|
||||
break;
|
||||
|
||||
case CAP_TYPE_MAP_PHYSMEM:
|
||||
|
||||
/*
|
||||
* We interpret the first physical memory resource that is bigger
|
||||
* than typical device resources as RAM.
|
||||
*/
|
||||
enum { RAM_SIZE_MIN = 16*1024*1024 };
|
||||
if (!phys_mem_defined && size > RAM_SIZE_MIN) {
|
||||
_core_mem_alloc.phys_alloc()->add_range(base, size);
|
||||
phys_mem_defined = true;
|
||||
dev_mem_base = base + size;
|
||||
}
|
||||
break;
|
||||
|
||||
case CAP_TYPE_IPC:
|
||||
case CAP_TYPE_UMUTEX:
|
||||
case CAP_TYPE_IRQCTRL:
|
||||
case CAP_TYPE_QUANTITY:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
addr_t core_virt_beg = trunc_page((addr_t)&_prog_img_beg),
|
||||
core_virt_end = round_page((addr_t)&_prog_img_end);
|
||||
size_t core_size = core_virt_end - core_virt_beg;
|
||||
|
||||
printf("core image:\n");
|
||||
printf(" virtual address range [%08lx,%08lx) size=0x%zx\n",
|
||||
core_virt_beg, core_virt_end, core_size);
|
||||
printf(" physically located at 0x%08lx\n", _lma_start);
|
||||
|
||||
/* remove core image from core's virtual address allocator */
|
||||
_core_mem_alloc.virt_alloc()->remove_range(core_virt_beg, core_size);
|
||||
|
||||
/* preserve context area in core's virtual address space */
|
||||
_core_mem_alloc.virt_alloc()->raw()->remove_range(Native_config::context_area_virtual_base(),
|
||||
Native_config::context_area_virtual_size());
|
||||
|
||||
/* remove used core memory from physical memory allocator */
|
||||
_core_mem_alloc.phys_alloc()->remove_range(_lma_start, core_size);
|
||||
|
||||
/* remove magically mapped UART from core virtual memory */
|
||||
_core_mem_alloc.virt_alloc()->remove_range(USERSPACE_CONSOLE_VBASE, get_page_size());
|
||||
|
||||
/* add boot modules to ROM fs */
|
||||
if (_init_rom_fs() < 0) {
|
||||
PERR("initialization of romfs failed - halt.");
|
||||
while(1);
|
||||
}
|
||||
|
||||
/* initialize interrupt allocator */
|
||||
_irq_alloc.add_range(0, 255);
|
||||
|
||||
/* regard physical addresses higher than memory area as MMIO */
|
||||
_io_mem_alloc.add_range(dev_mem_base, 0x80000000 - dev_mem_base);
|
||||
|
||||
/*
|
||||
* Print statistics about allocator initialization
|
||||
*/
|
||||
printf("VM area at [%08lx,%08lx)\n", _vm_base, _vm_base + _vm_size);
|
||||
|
||||
if (verbose_boot_info) {
|
||||
printf(":phys_alloc: "); _core_mem_alloc.phys_alloc()->raw()->dump_addr_tree();
|
||||
printf(":virt_alloc: "); _core_mem_alloc.virt_alloc()->raw()->dump_addr_tree();
|
||||
printf(":io_mem_alloc: "); _io_mem_alloc.raw()->dump_addr_tree();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Platform::wait_for_exit()
|
||||
{
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
||||
void Core_parent::exit(int exit_value) { }
|
||||
@@ -1,130 +0,0 @@
|
||||
/*
|
||||
* \brief Protection-domain facility
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* core includes */
|
||||
#include <platform_pd.h>
|
||||
#include <platform.h>
|
||||
#include <util.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Codezero;
|
||||
|
||||
|
||||
/***************************
|
||||
** Public object members **
|
||||
***************************/
|
||||
|
||||
int Platform_pd::bind_thread(Platform_thread *thread)
|
||||
{
|
||||
/* allocate new thread at the kernel */
|
||||
struct task_ids ids = { 1, _space_id, TASK_ID_INVALID };
|
||||
int ret = l4_thread_control(THREAD_CREATE | TC_SHARE_SPACE, &ids);
|
||||
if (ret < 0) {
|
||||
PERR("l4_thread_control returned %d, tid=%d\n", ret, ids.tid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* allocate UTCB for new thread */
|
||||
int utcb_idx;
|
||||
for (utcb_idx = 0; utcb_idx < MAX_THREADS_PER_PD; utcb_idx++)
|
||||
if (!utcb_in_use[utcb_idx]) break;
|
||||
|
||||
if (utcb_idx == MAX_THREADS_PER_PD) {
|
||||
PERR("UTCB allocation failed");
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* mark UTCB as being in use */
|
||||
utcb_in_use[utcb_idx] = true;
|
||||
|
||||
/* map UTCB area for the first thread of a new PD */
|
||||
if (utcb_idx == 0) {
|
||||
void *utcb_phys = 0;
|
||||
if (!platform()->ram_alloc()->alloc(UTCB_AREA_SIZE, &utcb_phys)) {
|
||||
PERR("could not allocate physical pages for UTCB");
|
||||
return -3;
|
||||
}
|
||||
|
||||
ret = l4_map(utcb_phys, (void *)UTCB_VIRT_BASE,
|
||||
UTCB_AREA_SIZE/get_page_size(), MAP_USR_RW, ids.tid);
|
||||
if (ret < 0) {
|
||||
PERR("UTCB mapping into new PD failed, ret=%d", ret);
|
||||
return -4;
|
||||
}
|
||||
}
|
||||
|
||||
addr_t utcb_addr = UTCB_VIRT_BASE + utcb_idx*sizeof(struct utcb);
|
||||
thread->_assign_physical_thread(ids.tid, _space_id, utcb_addr,
|
||||
this->Address_space::weak_ptr());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void Platform_pd::unbind_thread(Platform_thread *thread)
|
||||
{
|
||||
/* find UTCB index of thread */
|
||||
unsigned utcb_idx;
|
||||
for (utcb_idx = 0; utcb_idx < MAX_THREADS_PER_PD; utcb_idx++)
|
||||
if (thread->utcb() == UTCB_VIRT_BASE + utcb_idx*sizeof(struct utcb))
|
||||
break;
|
||||
|
||||
if (utcb_idx == MAX_THREADS_PER_PD) {
|
||||
PWRN("could not find UTCB index of thread");
|
||||
return;
|
||||
}
|
||||
|
||||
utcb_in_use[utcb_idx] = false;
|
||||
|
||||
PWRN("not fully implemented");
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::Platform_pd(bool core)
|
||||
{
|
||||
PWRN("not yet implemented");
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::Platform_pd(Allocator * md_alloc, char const *,
|
||||
signed pd_id, bool create)
|
||||
: _space_id(TASK_ID_INVALID)
|
||||
{
|
||||
_space_id = TASK_ID_INVALID;
|
||||
|
||||
/* mark all UTCBs of the new PD as free */
|
||||
for (int i = 0; i < MAX_THREADS_PER_PD; i++)
|
||||
utcb_in_use[i] = false;
|
||||
|
||||
struct task_ids ids = { TASK_ID_INVALID, TASK_ID_INVALID, TASK_ID_INVALID };
|
||||
|
||||
int ret = l4_thread_control(THREAD_CREATE | TC_NEW_SPACE, &ids);
|
||||
if (ret < 0) {
|
||||
PERR("l4_thread_control(THREAD_CREATE | TC_NEW_SPACE) returned %d", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* set space ID to valid value to indicate success */
|
||||
_space_id = ids.spid;
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::~Platform_pd()
|
||||
{
|
||||
/* invalidate weak pointers to this object */
|
||||
Address_space::lock_for_destruction();
|
||||
|
||||
PWRN("not yet implemented");
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* \brief Thread facility
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <util/string.h>
|
||||
|
||||
/* core includes */
|
||||
#include <platform_thread.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
enum { verbose_thread_start = true };
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Codezero;
|
||||
|
||||
|
||||
int Platform_thread::start(void *ip, void *sp, unsigned int cpu_no)
|
||||
{
|
||||
Native_thread_id pager = _pager ? _pager->cap().dst() : THREAD_INVALID;
|
||||
|
||||
/* setup thread context */
|
||||
struct exregs_data exregs;
|
||||
memset(&exregs, 0, sizeof(exregs));
|
||||
exregs_set_stack(&exregs, (unsigned long)sp);
|
||||
exregs_set_pc (&exregs, (unsigned long)ip);
|
||||
exregs_set_pager(&exregs, pager);
|
||||
exregs_set_utcb (&exregs, _utcb);
|
||||
|
||||
int ret = l4_exchange_registers(&exregs, _tid);
|
||||
if (ret < 0) {
|
||||
printf("l4_exchange_registers returned ret=%d\n", ret);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* start execution */
|
||||
struct task_ids ids = { _tid, _space_id, _tid };
|
||||
ret = l4_thread_control(THREAD_RUN, &ids);
|
||||
if (ret < 0) {
|
||||
printf("Error: l4_thread_control(THREAD_RUN) returned %d\n", ret);
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (verbose_thread_start)
|
||||
printf("core started thread \"%s\" with ID %d inside space ID %d\n",
|
||||
_name, _tid, _space_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::pause()
|
||||
{
|
||||
PDBG("not implemented");
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::resume()
|
||||
{
|
||||
PDBG("not implemented");
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::state(Thread_state s)
|
||||
{
|
||||
PDBG("Not implemented");
|
||||
throw Cpu_session::State_access_failed();
|
||||
}
|
||||
|
||||
|
||||
Thread_state Platform_thread::state()
|
||||
{
|
||||
PDBG("Not implemented");
|
||||
throw Cpu_session::State_access_failed();
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
PDBG("not implemented");
|
||||
}
|
||||
|
||||
|
||||
Weak_ptr<Address_space> Platform_thread::address_space()
|
||||
{
|
||||
return _address_space;
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(size_t, const char *name, unsigned, addr_t,
|
||||
int thread_id)
|
||||
: _tid(THREAD_INVALID)
|
||||
{
|
||||
strncpy(_name, name, sizeof(_name));
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::~Platform_thread()
|
||||
{
|
||||
PDBG("not implemented");
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* \brief Export RAM dataspace as shared memory object (dummy)
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <util/misc_math.h>
|
||||
|
||||
/* core includes */
|
||||
#include <ram_session_component.h>
|
||||
#include <platform.h>
|
||||
#include <map_local.h>
|
||||
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
void Ram_session_component::_export_ram_ds(Dataspace_component *ds) { }
|
||||
void Ram_session_component::_revoke_ram_ds(Dataspace_component *ds) { }
|
||||
|
||||
void Ram_session_component::_clear_ds (Dataspace_component *ds)
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
/*
|
||||
* Map dataspace core-locally, memset, unmap dataspace
|
||||
*/
|
||||
|
||||
size_t page_rounded_size = (ds->size() + get_page_size() - 1) & get_page_mask();
|
||||
size_t num_pages = page_rounded_size >> get_page_size_log2();
|
||||
|
||||
/* allocate range in core's virtual address space */
|
||||
void *virt_addr;
|
||||
if (!platform()->region_alloc()->alloc(page_rounded_size, &virt_addr)) {
|
||||
PERR("Could not allocate virtual address range in core of size %zd\n",
|
||||
page_rounded_size);
|
||||
return;
|
||||
}
|
||||
|
||||
/* map the dataspace's physical pages to corresponding virtual addresses */
|
||||
if (!map_local(ds->phys_addr(), (addr_t)virt_addr, num_pages)) {
|
||||
PERR("core-local memory mapping failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(virt_addr, 0, ds->size());
|
||||
|
||||
/* unmap dataspace from core */
|
||||
if (!unmap_local((addr_t)virt_addr, num_pages)) {
|
||||
PERR("could not unmap %zd pages from virtual address range at %p",
|
||||
num_pages, virt_addr);
|
||||
return;
|
||||
}
|
||||
|
||||
/* free core's virtual address space */
|
||||
platform()->region_alloc()->free(virt_addr, page_rounded_size);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* \brief RM-session implementation
|
||||
* \author Norman Feske
|
||||
* \date 2009-10-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*/
|
||||
|
||||
/* core includes */
|
||||
#include <rm_session_component.h>
|
||||
#include <util.h>
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Codezero;
|
||||
|
||||
|
||||
void Rm_client::unmap(addr_t core_local_base, addr_t virt_base, size_t size)
|
||||
{
|
||||
l4_unmap((void *)virt_base, size >> get_page_size_log2(), badge());
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
TARGET = core
|
||||
|
||||
GEN_CORE_DIR = $(BASE_DIR)/src/core
|
||||
|
||||
SRC_CC += cap_session_component.cc \
|
||||
context_area.cc \
|
||||
core_mem_alloc.cc \
|
||||
core_rm_session.cc \
|
||||
cpu_session_component.cc \
|
||||
cpu_session_support.cc \
|
||||
dataspace_component.cc \
|
||||
dump_alloc.cc \
|
||||
io_mem_session_component.cc \
|
||||
io_mem_session_support.cc \
|
||||
irq_session_component.cc \
|
||||
main.cc \
|
||||
pager.cc \
|
||||
pager_ep.cc \
|
||||
pager_object.cc \
|
||||
pd_session_component.cc \
|
||||
platform.cc \
|
||||
platform_pd.cc \
|
||||
platform_services.cc \
|
||||
platform_thread.cc \
|
||||
ram_session_component.cc \
|
||||
ram_session_support.cc \
|
||||
rm_session_component.cc \
|
||||
rm_session_support.cc \
|
||||
rom_session_component.cc \
|
||||
signal_session_component.cc \
|
||||
signal_source_component.cc \
|
||||
thread_start.cc \
|
||||
trace_session_component.cc
|
||||
|
||||
LIBS += core_printf base-common
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/core/include \
|
||||
$(GEN_CORE_DIR)/include \
|
||||
$(REP_DIR)/include/codezero/dummies \
|
||||
$(BASE_DIR)/src/base/thread
|
||||
|
||||
include $(GEN_CORE_DIR)/version.inc
|
||||
|
||||
vpath main.cc $(GEN_CORE_DIR)
|
||||
vpath ram_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath rom_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath cap_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath cpu_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath pd_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath rm_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
|
||||
vpath platform_services.cc $(GEN_CORE_DIR)
|
||||
vpath signal_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath signal_source_component.cc $(GEN_CORE_DIR)
|
||||
vpath trace_session_component.cc $(GEN_CORE_DIR)
|
||||
vpath dataspace_component.cc $(GEN_CORE_DIR)
|
||||
vpath core_mem_alloc.cc $(GEN_CORE_DIR)
|
||||
vpath dump_alloc.cc $(GEN_CORE_DIR)
|
||||
vpath context_area.cc $(GEN_CORE_DIR)
|
||||
vpath pager_ep.cc $(GEN_CORE_DIR)
|
||||
vpath pager_object.cc $(GEN_CORE_DIR)
|
||||
vpath %.cc $(REP_DIR)/src/core
|
||||
@@ -1,4 +0,0 @@
|
||||
include $(PRG_DIR)/target.inc
|
||||
|
||||
LD_TEXT_ADDR = 0x100000
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* \brief Implementation of Thread API interface for core
|
||||
* \author Norman Feske
|
||||
* \date 2006-05-03
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-2013 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.
|
||||
*/
|
||||
|
||||
/* Codezero includes */
|
||||
#include <codezero/syscalls.h>
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/sleep.h>
|
||||
|
||||
/* core includes */
|
||||
#include <platform.h>
|
||||
#include <platform_thread.h>
|
||||
|
||||
enum { verbose_thread_start = true };
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
void Thread_base::_deinit_platform_thread() { }
|
||||
|
||||
|
||||
/**
|
||||
* Create and start new thread
|
||||
*
|
||||
* \param space_no space ID in which the new thread will be executed
|
||||
* \param sp initial stack pointer
|
||||
* \param ip initial instruction pointer
|
||||
* \return new thread ID, or
|
||||
* negative error code
|
||||
*/
|
||||
inline int create_thread(unsigned space_no,
|
||||
void *sp, void *ip,
|
||||
int pager_tid = 1)
|
||||
{
|
||||
using namespace Codezero;
|
||||
|
||||
struct task_ids ids = { 1U, space_no, TASK_ID_INVALID };
|
||||
|
||||
/* allocate new thread at the kernel */
|
||||
unsigned long flags = THREAD_CREATE | TC_SHARE_SPACE | TC_SHARE_GROUP;
|
||||
int ret = l4_thread_control(flags, &ids);
|
||||
if (ret < 0) {
|
||||
PERR("l4_thread_control returned %d, spid=%d\n",
|
||||
ret, ids.spid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned long utcb_base_addr = (unsigned long)l4_get_utcb();
|
||||
|
||||
/* calculate utcb address of new thread */
|
||||
unsigned long new_utcb = utcb_base_addr + ids.tid*sizeof(struct utcb);
|
||||
|
||||
/* setup thread context */
|
||||
struct exregs_data exregs;
|
||||
memset(&exregs, 0, sizeof(exregs));
|
||||
exregs_set_stack(&exregs, (unsigned long)sp);
|
||||
exregs_set_pc (&exregs, (unsigned long)ip);
|
||||
exregs_set_pager(&exregs, pager_tid);
|
||||
exregs_set_utcb (&exregs, new_utcb);
|
||||
|
||||
ret = l4_exchange_registers(&exregs, ids.tid);
|
||||
if (ret < 0) {
|
||||
printf("l4_exchange_registers returned ret=%d\n", ret);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* start execution */
|
||||
ret = l4_thread_control(THREAD_RUN, &ids);
|
||||
if (ret < 0) {
|
||||
printf("Error: l4_thread_control(THREAD_RUN) returned %d\n", ret);
|
||||
return -3;
|
||||
}
|
||||
|
||||
/* return new thread ID allocated by the kernel */
|
||||
return ids.tid;
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::_thread_start()
|
||||
{
|
||||
Thread_base::myself()->_thread_bootstrap();
|
||||
Thread_base::myself()->entry();
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::start()
|
||||
{
|
||||
/* create and start platform thread */
|
||||
_tid.pt = new(platform()->core_mem_alloc())
|
||||
Platform_thread(0, _context->name);
|
||||
|
||||
_tid.l4id = create_thread(1, stack_top(), (void *)&_thread_start);
|
||||
|
||||
if (_tid.l4id < 0)
|
||||
PERR("create_thread returned %d", _tid.l4id);
|
||||
|
||||
if (verbose_thread_start)
|
||||
printf("core started local thread \"%s\" with ID %d\n",
|
||||
_context->name, _tid.l4id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Thread_base::cancel_blocking()
|
||||
{
|
||||
PWRN("not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
TARGET = codezero
|
||||
|
||||
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
|
||||
|
||||
include $(REP_DIR)/lib/mk/codezero_cml.inc
|
||||
|
||||
TOOL_CHAIN_DIR = $(dir $(CROSS_DEV_PREFIX))
|
||||
CODEZERO_DST_DIR = $(BUILD_BASE_DIR)/kernel/codezero
|
||||
CODEZERO_BUILD_DIR = $(CODEZERO_DST_DIR)/build
|
||||
|
||||
.PHONY: $(TARGET)
|
||||
|
||||
MIRROR_COPY := conts/baremetal/empty conts/userlibs \
|
||||
build.py include SConstruct src loader
|
||||
|
||||
MIRROR_SYMLINK := scripts tools
|
||||
|
||||
update_copy = $(VERBOSE)tar c -C $(CODEZERO_DIR) $(MIRROR_COPY) | tar x -C $(CODEZERO_DST_DIR)
|
||||
|
||||
ifneq ($(VERBOSE),)
|
||||
CODEZERO_STDOUT := > /dev/null
|
||||
endif
|
||||
|
||||
#
|
||||
# Environment variables passed to the Codezero build system
|
||||
#
|
||||
BUILD_ENV = PATH=$(dir $(CROSS_DEV_PREFIX)):$$PATH
|
||||
|
||||
#
|
||||
# Local copy of the CML file used for supplying the configuration
|
||||
# to the Codezero build system.
|
||||
#
|
||||
LOCAL_CONFIG_CML := $(shell pwd)/config.cml
|
||||
|
||||
$(TARGET): $(CODEZERO_BUILD_DIR)
|
||||
$(MSG_BUILD)kernel
|
||||
$(update_copy)
|
||||
$(VERBOSE)cd $(CODEZERO_DST_DIR); $(BUILD_ENV) ./build.py $(CODEZERO_STDOUT)
|
||||
|
||||
#
|
||||
# Mirror the parts of the Codezero source tree that are relevant for building
|
||||
# the kernel
|
||||
#
|
||||
$(CODEZERO_DST_DIR): $(CODEZERO_DIR)
|
||||
$(VERBOSE)test -d $@ || mkdir -p $@
|
||||
$(VERBOSE)for d in $(MIRROR_SYMLINK); do ln -sf $(realpath $^)/$$d $@/$$d; done
|
||||
|
||||
$(CODEZERO_BUILD_DIR): $(CODEZERO_DST_DIR) $(CODEZERO_CML)
|
||||
$(update_copy)
|
||||
$(VERBOSE)cp $(CODEZERO_CML) $(LOCAL_CONFIG_CML)
|
||||
@#
|
||||
@# Create copy of the CML config in the local build directory to update
|
||||
@# the tool chain parameters according to the CROSS_DEV_PREFIX configured
|
||||
@# for Genode.
|
||||
@#
|
||||
$(VERBOSE)sed -i "/TOOLCHAIN_USERSPACE/s/\".*\"/\"$(notdir $(CROSS_DEV_PREFIX))\"/" $(LOCAL_CONFIG_CML)
|
||||
$(VERBOSE)sed -i "/TOOLCHAIN_KERNEL/s/\".*\"/\"$(notdir $(CROSS_DEV_PREFIX))\"/" $(LOCAL_CONFIG_CML)
|
||||
$(VERBOSE)cd $(CODEZERO_DST_DIR); $(BUILD_ENV) ./build.py -C -b -f $(LOCAL_CONFIG_CML) $(CODEZERO_STDOUT)
|
||||
|
||||
clean cleanall: clean_codezero
|
||||
|
||||
#
|
||||
# Make sure to execute the 'clean_codezero' rule prior the generic clean
|
||||
# rule in 'prg.mk' because the generic rule will attempt to remove $(TARGET)
|
||||
# file, which is a directory in our case.
|
||||
#
|
||||
clean_prg_objects: clean_codezero
|
||||
|
||||
clean_codezero:
|
||||
$(VERBOSE)rm -f $(LOCAL_CONFIG_CML)
|
||||
$(VERBOSE)rm -rf $(CODEZERO_DST_DIR)
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* \brief Dummies for Codezeros libmem (used by libl4)
|
||||
* \author Sebastian Sumpf
|
||||
* \date 2011-05-10
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2011-2013 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.
|
||||
*/
|
||||
|
||||
void *mem_cache_zalloc(void *cache){ return 0; }
|
||||
void *mem_cache_alloc(void *cache){ return 0; }
|
||||
void *mem_cache_init(void *start, int cache_size, int struct_size,
|
||||
unsigned int alignment) { return 0; }
|
||||
int mem_cache_free(void *cache, void *addr) { return 0; }
|
||||
|
||||
void *kmalloc(int size) { return 0; }
|
||||
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* \brief Linker script for Genode programs
|
||||
* \author Christian Helmuth
|
||||
* \date 2006-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006-2013 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.
|
||||
*/
|
||||
|
||||
/* values taken from Codezero's mm0 linker script */
|
||||
/*physical_base = 0x00208000;*/
|
||||
/*virtual_base = 0xe0000000;*/
|
||||
/*offset = virtual_base - physical_base;*/
|
||||
|
||||
/*
|
||||
* Addresses correspond to the linker script generated by
|
||||
* the Codezero build system.
|
||||
*/
|
||||
vma_start = 0x100000;
|
||||
lma_start = 0x41000;
|
||||
offset = vma_start - lma_start;
|
||||
|
||||
|
||||
ENTRY(_start)
|
||||
|
||||
PHDRS
|
||||
{
|
||||
ro PT_LOAD;
|
||||
rw PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = vma_start;
|
||||
|
||||
.text : AT (ADDR(.text) - offset) {
|
||||
/* begin of program image (link address) */
|
||||
_prog_img_beg = .;
|
||||
|
||||
*(.text.crt0)
|
||||
*(.init)
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.fini)
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
||||
|
||||
. = ALIGN(0x08);
|
||||
|
||||
_ctors_start = .;
|
||||
KEEP (*(.ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.init_array)) /* list of constructors specific for ARM eabi */
|
||||
_ctors_end = .;
|
||||
_dtors_start = .;
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
_dtors_end = .;
|
||||
} : ro = 0x0
|
||||
|
||||
/* Linux: exception section for uaccess mechanism */
|
||||
__ex_table : { *(__ex_table) }
|
||||
|
||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
|
||||
_prog_img_data = .;
|
||||
|
||||
.data : AT (ADDR(.data) - offset) {
|
||||
/*
|
||||
* Leave space for parent capability parameters at start of data
|
||||
* section. The protection domain creator is reponsible for storing
|
||||
* sane values here.
|
||||
*/
|
||||
_parent_cap = .;
|
||||
LONG(0xffffffff);
|
||||
LONG(0xffffffff);
|
||||
_vma_start = .;
|
||||
LONG(vma_start);
|
||||
_lma_start = .;
|
||||
LONG(lma_start);
|
||||
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
} : rw
|
||||
|
||||
/* exception frames for C++ */
|
||||
.eh_frame : {
|
||||
__eh_frame_start__ = .;
|
||||
KEEP (*(.eh_frame))
|
||||
LONG(0)
|
||||
} : rw
|
||||
|
||||
.init_array : {
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
}
|
||||
|
||||
.gcc_except_table : { KEEP(*(.gcc_except_table)) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
|
||||
/* .ARM.exidx is sorted, so has to go in its own output section */
|
||||
__exidx_start = .;
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
}
|
||||
__exidx_end = .;
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} : rw
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
.bss : AT (ADDR(.bss) - offset) {
|
||||
*(.bss .bss.* .gnu.linkonce.b.* COMMON)
|
||||
}
|
||||
|
||||
/* end of program image -- must be after last section */
|
||||
_prog_img_end = .;
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.note)
|
||||
*(.note.ABI-tag)
|
||||
*(.comment)
|
||||
}
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os, re, getopt, sys
|
||||
from stat import ST_SIZE
|
||||
from subprocess import PIPE, Popen
|
||||
|
||||
verbose = 0
|
||||
|
||||
|
||||
# return address of 4K page following the spefified address
|
||||
def round_page(addr):
|
||||
page_size = 0x1000
|
||||
return (addr + page_size) & ~(page_size - 1)
|
||||
|
||||
|
||||
def first_free_addr_after_program(elf, cross_prefix = ""):
|
||||
try:
|
||||
objdump = cross_prefix + "objdump"
|
||||
objdump_output = Popen([objdump, "-p", elf],
|
||||
stdout=PIPE).communicate()[0]
|
||||
except OSError:
|
||||
print "Error: execution of " + objdump + " failed, invalid cross-tool prefix?"
|
||||
exit(3)
|
||||
|
||||
#
|
||||
# The output of 'objdump -p' contains the list of program segments. Each
|
||||
# segment has two lines of text, the first containing the 'vaddr' value and
|
||||
# the latter containing the 'memsz' value. For each line, we match for both
|
||||
# 'vaddr' and 'memsz' fields. When observing a line with a 'memsz' field,
|
||||
# we know that the previous line contained the corresponding 'vaddr' and
|
||||
# that the end address of the segment is the sum of the current 'vaddr'
|
||||
# and 'memsz' values.
|
||||
#
|
||||
max_end_addr = 0
|
||||
for line in objdump_output.splitlines():
|
||||
match_vaddr = re.compile(".*vaddr (0x[0-9a-f]*).*").match(line)
|
||||
match_memsz = re.compile(".*memsz (0x[0-9a-f]*).*").match(line)
|
||||
if (match_vaddr):
|
||||
vaddr = int(match_vaddr.group(1), 0)
|
||||
if (match_memsz):
|
||||
memsz = int(match_memsz.group(1), 0)
|
||||
max_end_addr = max(max_end_addr, vaddr + memsz)
|
||||
|
||||
# align the first free address at the next page boundary
|
||||
return round_page(max_end_addr)
|
||||
|
||||
|
||||
def generate_modules_asm(modules):
|
||||
"""
|
||||
Generate assembly code aggregating boot-module data from specified files.
|
||||
The generated assembly code looks as follows:
|
||||
|
||||
/*
|
||||
* The ELF image consists only of a data section. At file offset 0, there
|
||||
* is a magic cookie that core validates when accessing the ROM fs. It is
|
||||
* followed by the end address of the meta data.
|
||||
*/
|
||||
.section .data
|
||||
.string "GROM" /* magic cookie used by core to identify a ROM fs image*/
|
||||
.long header_end /* end of ROM fs meta data */
|
||||
|
||||
/*
|
||||
* Each module is represented by a struct of 3 long values. The first
|
||||
* value is pointer to the module name. A null-pointer marks the end of
|
||||
* the module list.
|
||||
*/
|
||||
.long mod1_name /* pointer to the null-terminated module name */
|
||||
.long mod1_start /* pointer to the module data */
|
||||
.long mod1_end - mod1_start /* size of the module data */
|
||||
|
||||
.long 0
|
||||
|
||||
/*
|
||||
* For each module, there exists a null-terminated string labeled with
|
||||
* 'mod<index>_name' referenced by the module list above.
|
||||
*/
|
||||
mod1_name:
|
||||
.string "name of data module"
|
||||
.byte 0
|
||||
|
||||
header_end:
|
||||
|
||||
/*
|
||||
* The data of each module must be aligned at a page boundary to enable
|
||||
* the mapping of individual modules to different address spaces.
|
||||
*/
|
||||
.align 4096
|
||||
mod1_start: .incbin "data"
|
||||
mod1_end:
|
||||
"""
|
||||
|
||||
asm_src = ""
|
||||
|
||||
# header
|
||||
asm_src += ".section .data\nmodule_list:\n"
|
||||
asm_src += ".ascii \"GROM\"\n"
|
||||
asm_src += ".long header_end\n"
|
||||
|
||||
# module list
|
||||
i = 1
|
||||
for module in modules:
|
||||
asm_src += ".long mod" + str(i) + "_name\n"
|
||||
asm_src += ".long mod" + str(i) + "_start\n"
|
||||
asm_src += ".long mod" + str(i) + "_end - mod" + str(i) + "_start\n"
|
||||
i = i + 1
|
||||
asm_src += ".long 0\n"
|
||||
|
||||
# module names
|
||||
i = 1
|
||||
for module in modules:
|
||||
asm_src += "mod" + str(i) + "_name: .string \"" + os.path.split(module)[1] + "\"; .byte 0\n"
|
||||
i = i + 1
|
||||
|
||||
asm_src += "header_end:\n"
|
||||
|
||||
# module data
|
||||
i = 1
|
||||
for module in modules:
|
||||
asm_src += ".p2align 12,0\n"
|
||||
asm_src += "mod" + str(i) + "_start: .incbin \"" + module + "\"; "
|
||||
asm_src += "mod" + str(i) + "_end:\n"
|
||||
i = i + 1
|
||||
|
||||
return asm_src
|
||||
|
||||
instructions = """
|
||||
usage: gen_romfs [-v] [-p <cross-prefix>] -c <core-elf> -o <output> [modules ...]
|
||||
|
||||
Generates Genode ROM file system as ELF file loadable into a Codezero container
|
||||
|
||||
-c|--core ELF binary of Genode's core
|
||||
-o|--output name of ELF image to generate
|
||||
-p|--prefix cross toolchain prefix
|
||||
-v|--verbose print details about generated ROM file systemn
|
||||
"""
|
||||
|
||||
def usage():
|
||||
print instructions
|
||||
|
||||
def user_error(message):
|
||||
print "Error: " + message
|
||||
usage
|
||||
sys.exit(2)
|
||||
|
||||
# default values for command-line arguments
|
||||
cross_prefix = ""
|
||||
core_elf = ""
|
||||
dst_elf = ""
|
||||
|
||||
# parse command line arguments
|
||||
try:
|
||||
opts, modules = getopt.getopt(sys.argv[1:],
|
||||
"c:o:p:v",
|
||||
["core=", "output=", "prefix=", "verbose"])
|
||||
except getopt.GetoptError:
|
||||
usage()
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt in ("-c", "--core"):
|
||||
core_elf = arg
|
||||
elif opt in ("-o", "--output"):
|
||||
dst_elf = arg
|
||||
elif opt in ("-p", "--prefix"):
|
||||
cross_prefix = arg
|
||||
elif opt in ("-v", "--verbose"):
|
||||
verbose = 1
|
||||
else:
|
||||
user_error("invalid argument \"" + arg + "\"")
|
||||
|
||||
# validate arguments
|
||||
if (core_elf == ""): user_error("no core binary specified")
|
||||
if (len(modules) == 0): user_error("no modules specified")
|
||||
if (dst_elf == ""): user_error("no output file spefied")
|
||||
|
||||
# determine destination address of the modules ELF image
|
||||
modules_start_addr = first_free_addr_after_program(core_elf, cross_prefix)
|
||||
|
||||
if (verbose):
|
||||
print "module address: " + hex(modules_start_addr)
|
||||
|
||||
# generate assembly code aggregating the module data
|
||||
asm_src = generate_modules_asm(modules)
|
||||
|
||||
if (verbose):
|
||||
print "generated assember code:"
|
||||
for line in asm_src.splitlines():
|
||||
print " " + line
|
||||
|
||||
# invoke assembler and linker through the gcc front end
|
||||
gcc_cmd = [cross_prefix + "gcc",
|
||||
"-nostdlib",
|
||||
"-x", "assembler",
|
||||
"-Wl,--entry=0",
|
||||
"-Wl,--section-start=.data=" + hex(modules_start_addr),
|
||||
"-o", dst_elf,
|
||||
"-"]
|
||||
|
||||
if (verbose):
|
||||
print "gcc command line:"
|
||||
print " " + ' '.join(gcc_cmd)
|
||||
|
||||
Popen(gcc_cmd, stdin=PIPE).communicate(asm_src)[0]
|
||||
@@ -26,6 +26,6 @@ SRC_CC += thread/context_allocator.cc
|
||||
INC_DIR += $(REP_DIR)/src/base/lock
|
||||
INC_DIR += $(BASE_DIR)/src/base/thread
|
||||
|
||||
vpath cap_copy.cc $(BASE_DIR)/src/platform
|
||||
vpath cap_copy.cc $(BASE_DIR)/src/lib/startup
|
||||
vpath %.cc $(REP_DIR)/src/base
|
||||
vpath %.cc $(BASE_DIR)/src/base
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# Specifics for Freescale i.MX21 platform
|
||||
#
|
||||
|
||||
RAM_BASE = 0xc0000000
|
||||
|
||||
#
|
||||
# Configure target CPU for gcc
|
||||
#
|
||||
CC_OPT += -march=armv5
|
||||
|
||||
#
|
||||
# Defines for L4/sys headers
|
||||
#
|
||||
CC_OPT += -DCPUTYPE_imx
|
||||
L4SYS_ARM_CPU = arm_imx
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# Specifics for ARM integrator platform
|
||||
#
|
||||
|
||||
#
|
||||
# Configure target CPU for gcc
|
||||
#
|
||||
CC_OPT += -march=armv5
|
||||
|
||||
#
|
||||
# Defines for L4/sys headers
|
||||
#
|
||||
CC_OPT += -DCPUTYPE_int
|
||||
L4SYS_ARM_CPU = arm_int
|
||||
@@ -1,14 +0,0 @@
|
||||
#
|
||||
# Specifics for MagicEyes Digital’s Multimedia Signal Processor
|
||||
#
|
||||
|
||||
#
|
||||
# Configure target CPU for gcc
|
||||
#
|
||||
CC_OPT += -march=armv4t
|
||||
|
||||
#
|
||||
# Defines for L4/sys headers
|
||||
#
|
||||
CC_OPT += -DCPUTYPE_mmsp2
|
||||
L4SYS_ARM_CPU = arm_mmsp2
|
||||
@@ -19,7 +19,7 @@ LD_TEXT_ADDR ?= 0x01000000
|
||||
#
|
||||
# Also include less-specific configuration last
|
||||
#
|
||||
include $(call select_from_repositories,mk/spec-x86_32.mk)
|
||||
include $(call select_from_repositories,mk/spec-fiasco.mk)
|
||||
include $(call select_from_repositories,mk/spec/x86_32.mk)
|
||||
include $(call select_from_repositories,mk/spec/fiasco.mk)
|
||||
|
||||
INC_DIR += $(L4_INC_DIR)
|
||||
@@ -15,9 +15,9 @@
|
||||
#ifndef _CORE__INCLUDE__PLATFORM_H_
|
||||
#define _CORE__INCLUDE__PLATFORM_H_
|
||||
|
||||
#include <base/sync_allocator.h>
|
||||
#include <base/allocator_avl.h>
|
||||
|
||||
#include "synced_range_allocator.h"
|
||||
#include "platform_generic.h"
|
||||
#include "platform_thread.h"
|
||||
#include "platform_pd.h"
|
||||
@@ -33,7 +33,7 @@ namespace Genode {
|
||||
/*
|
||||
* Shortcut for the type of allocator instances for physical resources
|
||||
*/
|
||||
typedef Synchronized_range_allocator<Allocator_avl> Phys_allocator;
|
||||
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
|
||||
|
||||
char _core_label[1]; /* to satisfy _core_pd */
|
||||
Platform_pd *_core_pd; /* core protection domain object */
|
||||
|
||||
@@ -78,7 +78,7 @@ void Ipc_pager::acknowledge_wakeup()
|
||||
** Pager Entrypoint **
|
||||
**********************/
|
||||
|
||||
Untyped_capability Pager_entrypoint::_manage(Pager_object *obj)
|
||||
Untyped_capability Pager_entrypoint::_pager_object_cap(unsigned long badge)
|
||||
{
|
||||
return Untyped_capability(_tid.l4id, obj->badge());
|
||||
return Untyped_capability(_tid.l4id, badge);
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ static const bool verbose_region_alloc = false;
|
||||
** Core address space management **
|
||||
***********************************/
|
||||
|
||||
static Synchronized_range_allocator<Allocator_avl> &_core_address_ranges()
|
||||
static Synced_range_allocator<Allocator_avl> &_core_address_ranges()
|
||||
{
|
||||
static Synchronized_range_allocator<Allocator_avl> _core_address_ranges(0);
|
||||
static Synced_range_allocator<Allocator_avl> _core_address_ranges(nullptr);
|
||||
return _core_address_ranges;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ void Platform::_setup_irq_alloc() {
|
||||
_irq_alloc.add_range(0, 0x10); }
|
||||
|
||||
|
||||
void Platform::_setup_basics()
|
||||
static Fiasco::l4_kernel_info_t *get_kip()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
@@ -370,14 +370,22 @@ void Platform::_setup_basics()
|
||||
printf(" root "); printf(" esp: %08lx eip: %08lx\n", kip->root_esp, kip->root_eip);
|
||||
}
|
||||
|
||||
return kip;
|
||||
}
|
||||
|
||||
void Platform::_setup_basics()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
l4_kernel_info_t * kip = get_kip();
|
||||
|
||||
/* add KIP as ROM module */
|
||||
_kip_rom = Rom_module((addr_t)kip, L4_PAGESIZE, "l4v2_kip");
|
||||
_rom_fs.insert(&_kip_rom);
|
||||
|
||||
/* update multi-boot info pointer from KIP */
|
||||
void *mb_info_ptr = (void *)kip->user_ptr;
|
||||
_mb_info = Multiboot_info(mb_info_ptr);
|
||||
if (verbose) printf("MBI @ %p\n", mb_info_ptr);
|
||||
addr_t mb_info_addr = kip->user_ptr;
|
||||
if (verbose) printf("MBI @ 0x%lx\n", mb_info_addr);
|
||||
|
||||
/* parse memory descriptors - look for virtual memory configuration */
|
||||
/* XXX we support only one VM region (here and also inside RM) */
|
||||
@@ -412,8 +420,8 @@ void Platform::_setup_basics()
|
||||
/* remove KIP and MBI area from region and IO_MEM allocator */
|
||||
remove_region(Region((addr_t)kip, (addr_t)kip + L4_PAGESIZE), _region_alloc);
|
||||
remove_region(Region((addr_t)kip, (addr_t)kip + L4_PAGESIZE), _io_mem_alloc);
|
||||
remove_region(Region((addr_t)mb_info_ptr, (addr_t)mb_info_ptr + _mb_info.size()), _region_alloc);
|
||||
remove_region(Region((addr_t)mb_info_ptr, (addr_t)mb_info_ptr + _mb_info.size()), _io_mem_alloc);
|
||||
remove_region(Region(mb_info_addr, mb_info_addr + _mb_info.size()), _region_alloc);
|
||||
remove_region(Region(mb_info_addr, mb_info_addr + _mb_info.size()), _io_mem_alloc);
|
||||
|
||||
/* remove core program image memory from region and IO_MEM allocator */
|
||||
addr_t img_start = (addr_t) &_prog_img_beg;
|
||||
@@ -457,9 +465,10 @@ void Platform::_setup_rom()
|
||||
|
||||
|
||||
Platform::Platform() :
|
||||
_ram_alloc(0), _io_mem_alloc(core_mem_alloc()),
|
||||
_ram_alloc(nullptr), _io_mem_alloc(core_mem_alloc()),
|
||||
_io_port_alloc(core_mem_alloc()), _irq_alloc(core_mem_alloc()),
|
||||
_region_alloc(core_mem_alloc())
|
||||
_region_alloc(core_mem_alloc()),
|
||||
_mb_info(get_kip()->user_ptr, true)
|
||||
{
|
||||
/*
|
||||
* We must be single-threaded at this stage and so this is safe.
|
||||
@@ -475,13 +484,13 @@ Platform::Platform() :
|
||||
_setup_rom();
|
||||
|
||||
if (verbose) {
|
||||
printf(":ram_alloc: "); _ram_alloc.raw()->dump_addr_tree();
|
||||
printf(":region_alloc: "); _region_alloc.raw()->dump_addr_tree();
|
||||
printf(":io_mem: "); _io_mem_alloc.raw()->dump_addr_tree();
|
||||
printf(":io_port: "); _io_port_alloc.raw()->dump_addr_tree();
|
||||
printf(":irq: "); _irq_alloc.raw()->dump_addr_tree();
|
||||
printf(":ram_alloc: "); _ram_alloc()->dump_addr_tree();
|
||||
printf(":region_alloc: "); _region_alloc()->dump_addr_tree();
|
||||
printf(":io_mem: "); _io_mem_alloc()->dump_addr_tree();
|
||||
printf(":io_port: "); _io_port_alloc()->dump_addr_tree();
|
||||
printf(":irq: "); _irq_alloc()->dump_addr_tree();
|
||||
printf(":rom_fs: "); _rom_fs.print_fs();
|
||||
printf(":core ranges: "); _core_address_ranges().raw()->dump_addr_tree();
|
||||
printf(":core ranges: "); _core_address_ranges()()->dump_addr_tree();
|
||||
}
|
||||
|
||||
Fiasco::l4_threadid_t myself = Fiasco::l4_myself();
|
||||
|
||||
8
repos/base-fiasco/src/core/spec/x86/target.mk
Normal file
8
repos/base-fiasco/src/core/spec/x86/target.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
include $(PRG_DIR)/../../target.inc
|
||||
|
||||
REQUIRES += x86
|
||||
SRC_CC += platform_x86.cc
|
||||
|
||||
vpath io_port_session_component.cc $(GEN_CORE_DIR)/spec/x86
|
||||
vpath platform_services.cc $(GEN_CORE_DIR)/spec/x86
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
include $(PRG_DIR)/../target.inc
|
||||
|
||||
REQUIRES += x86
|
||||
SRC_CC += platform_x86.cc
|
||||
|
||||
vpath io_port_session_component.cc $(GEN_CORE_DIR)/x86
|
||||
vpath platform_services.cc $(GEN_CORE_DIR)/x86
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
REQUIRES = x86 32bit
|
||||
KERNEL_CONFIG = $(REP_DIR)/config/kernel-config.x86
|
||||
|
||||
-include $(PRG_DIR)/../target.inc
|
||||
-include $(PRG_DIR)/../../target.inc
|
||||
@@ -3,4 +3,4 @@
|
||||
#
|
||||
L4_CONFIG = $(call select_from_repositories,config/arndale.user)
|
||||
|
||||
include $(REP_DIR)/lib/mk/arm/platform.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm/platform.inc
|
||||
@@ -3,4 +3,4 @@
|
||||
#
|
||||
L4_CONFIG = $(call select_from_repositories,config/imx53.user)
|
||||
|
||||
include $(REP_DIR)/lib/mk/arm/platform.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm/platform.inc
|
||||
@@ -3,4 +3,4 @@
|
||||
#
|
||||
L4_CONFIG = $(call select_from_repositories,config/odroid_x2.user)
|
||||
|
||||
include $(REP_DIR)/lib/mk/arm/platform.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm/platform.inc
|
||||
@@ -3,4 +3,4 @@
|
||||
#
|
||||
L4_CONFIG = $(call select_from_repositories,config/panda.user)
|
||||
|
||||
include $(REP_DIR)/lib/mk/arm/platform.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm/platform.inc
|
||||
@@ -3,4 +3,4 @@
|
||||
#
|
||||
L4_CONFIG = $(call select_from_repositories,config/pbxa9.user)
|
||||
|
||||
include $(REP_DIR)/lib/mk/arm/platform.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm/platform.inc
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user