mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
Compare commits
270 Commits
20.11
...
sculpt-21.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f9cb72cfa | ||
|
|
27527bf165 | ||
|
|
f839b3ecba | ||
|
|
bfea27a258 | ||
|
|
4f91d71cf9 | ||
|
|
32169cd137 | ||
|
|
eb89b13327 | ||
|
|
b51c1a0fe3 | ||
|
|
f90cd542cb | ||
|
|
dce272ba8f | ||
|
|
141af733aa | ||
|
|
945b4760ef | ||
|
|
53041f4cd8 | ||
|
|
521f61b9e0 | ||
|
|
ca50a41d28 | ||
|
|
b29f1497bf | ||
|
|
ca5522d4d9 | ||
|
|
36ef41626a | ||
|
|
e9ac14ed49 | ||
|
|
8f1db47c26 | ||
|
|
d2fc834bfa | ||
|
|
3d432331b9 | ||
|
|
446df00d0d | ||
|
|
2f0898d2a9 | ||
|
|
9a0217f21a | ||
|
|
0cfafa1c8f | ||
|
|
2c85e48a0d | ||
|
|
15780a657c | ||
|
|
5c5b56d1e0 | ||
|
|
00900d82b5 | ||
|
|
18182b11da | ||
|
|
8eb514d6b5 | ||
|
|
8a8de970a5 | ||
|
|
cae3e447d6 | ||
|
|
f98d10a3f3 | ||
|
|
521663c6de | ||
|
|
9b5bedefc7 | ||
|
|
8ecc258d3f | ||
|
|
7bbd050f25 | ||
|
|
7e7c10e66c | ||
|
|
d5d3b3c3a4 | ||
|
|
2baa283d87 | ||
|
|
4a12b5c653 | ||
|
|
ba6c4a664f | ||
|
|
9093c293cb | ||
|
|
935bb36fe4 | ||
|
|
755aed7cb2 | ||
|
|
6223ae4413 | ||
|
|
bebba3876e | ||
|
|
aa0a98bd43 | ||
|
|
42f3d2eccd | ||
|
|
c03534e355 | ||
|
|
1e0d843464 | ||
|
|
8c7d34ff21 | ||
|
|
d6a312f438 | ||
|
|
6544cca320 | ||
|
|
3d0ed5992d | ||
|
|
366fda0e47 | ||
|
|
7ce1f8e92d | ||
|
|
6e9843bd05 | ||
|
|
2ff252360d | ||
|
|
9de61e7014 | ||
|
|
6712eac7e6 | ||
|
|
25a212aa24 | ||
|
|
89ffc48576 | ||
|
|
9a5bc9caf0 | ||
|
|
c0a7565c21 | ||
|
|
a02ec07e49 | ||
|
|
1f29055927 | ||
|
|
7af276ac81 | ||
|
|
de62582905 | ||
|
|
ba567f4ba8 | ||
|
|
ee0ed273e6 | ||
|
|
e1bb0e8e15 | ||
|
|
2e4ccc1459 | ||
|
|
80522fadf6 | ||
|
|
2ce4a3b400 | ||
|
|
c68443e2eb | ||
|
|
9685a8b60d | ||
|
|
23e3079f46 | ||
|
|
10b56afff0 | ||
|
|
d4b58b689c | ||
|
|
1826ff8a59 | ||
|
|
86ad4ed17f | ||
|
|
1d1b5b88c5 | ||
|
|
4f1a3a8000 | ||
|
|
0afd3db894 | ||
|
|
cbe81d35b9 | ||
|
|
1d551bd967 | ||
|
|
812c3599de | ||
|
|
20caac5f3b | ||
|
|
a47b374905 | ||
|
|
7a3dc68f34 | ||
|
|
dd92ab126b | ||
|
|
f68e655312 | ||
|
|
64165d829e | ||
|
|
c2feba065f | ||
|
|
219809ffed | ||
|
|
6e8728f2d3 | ||
|
|
90d9470dfd | ||
|
|
2879aa003b | ||
|
|
83c2309710 | ||
|
|
59459e60e7 | ||
|
|
8d13121e84 | ||
|
|
3ff0efd627 | ||
|
|
10605a6903 | ||
|
|
6937eb7d94 | ||
|
|
a462a8e741 | ||
|
|
3485282909 | ||
|
|
b6d20b4742 | ||
|
|
7318ca6084 | ||
|
|
ca777fe93f | ||
|
|
ccd9ba4161 | ||
|
|
954f03257d | ||
|
|
190b4784c5 | ||
|
|
f23e302475 | ||
|
|
f5cd12dcf9 | ||
|
|
ce31c90bc3 | ||
|
|
f9c258a372 | ||
|
|
048a4625c5 | ||
|
|
db3f86d603 | ||
|
|
fa68325a57 | ||
|
|
1b77cb3832 | ||
|
|
19d9409a34 | ||
|
|
9918a8f88d | ||
|
|
a6f0b05834 | ||
|
|
b51ae104c2 | ||
|
|
23620942bf | ||
|
|
a99f6a81b6 | ||
|
|
fd0e6685fc | ||
|
|
18e282ab8a | ||
|
|
1e84b46c3f | ||
|
|
19d0142e10 | ||
|
|
983a18d06e | ||
|
|
f654e6f02d | ||
|
|
cb2e27f8e4 | ||
|
|
c58acd0b2b | ||
|
|
26506673c4 | ||
|
|
df38140ed6 | ||
|
|
9633a0a524 | ||
|
|
7d568247e3 | ||
|
|
b5fb37ddee | ||
|
|
d29b843a0f | ||
|
|
8958c769ab | ||
|
|
210f5073e3 | ||
|
|
ef88d05f2b | ||
|
|
d6a5a66623 | ||
|
|
d186e4361e | ||
|
|
2acfacb639 | ||
|
|
696d8f030f | ||
|
|
e3233a4824 | ||
|
|
5c5d16f524 | ||
|
|
c16611dff2 | ||
|
|
33406940f3 | ||
|
|
e1698cf200 | ||
|
|
2670ae399b | ||
|
|
91a7fb1da7 | ||
|
|
a9c4ebc9e9 | ||
|
|
e3783b00bb | ||
|
|
493924a35e | ||
|
|
cbae9bc1c8 | ||
|
|
8cc2662aac | ||
|
|
af9ab9190b | ||
|
|
14db22c77c | ||
|
|
691be92046 | ||
|
|
9f3c5d92b3 | ||
|
|
36b55e065a | ||
|
|
6789ce8b83 | ||
|
|
a981fb864c | ||
|
|
c4cf9b6e6d | ||
|
|
4bc9b9a2ef | ||
|
|
ad4211ae2c | ||
|
|
ff28ed0f8c | ||
|
|
693a4d78dd | ||
|
|
8f6b934caa | ||
|
|
384cf14bee | ||
|
|
90b20b4daf | ||
|
|
80318b9ae0 | ||
|
|
fce5c249c2 | ||
|
|
71abfb3b4f | ||
|
|
395a9b5bf5 | ||
|
|
53081ac6b3 | ||
|
|
c6d5b98227 | ||
|
|
c402cc1045 | ||
|
|
1edac9730c | ||
|
|
d475015ada | ||
|
|
ffb931f8b1 | ||
|
|
b4d294f62e | ||
|
|
052f678225 | ||
|
|
3fdf323e6e | ||
|
|
05c36d67ce | ||
|
|
ffc2a2f306 | ||
|
|
fc089a1673 | ||
|
|
428de89f9a | ||
|
|
30429a5228 | ||
|
|
e6a9e06f62 | ||
|
|
8b172bf22e | ||
|
|
80e8cf99e2 | ||
|
|
9d239957bc | ||
|
|
5fa91c573b | ||
|
|
9bfd812a88 | ||
|
|
1ccf8a280c | ||
|
|
f034f560be | ||
|
|
f45aa85e9f | ||
|
|
84443d6548 | ||
|
|
a6a923c31b | ||
|
|
f687d4824b | ||
|
|
0a478dac7f | ||
|
|
5905e0a4a0 | ||
|
|
d0ac8a6036 | ||
|
|
bdd923406f | ||
|
|
5a123e37c9 | ||
|
|
6cfaac182a | ||
|
|
3e73d8d7b6 | ||
|
|
a4d5687510 | ||
|
|
2b0170fb6a | ||
|
|
2d21d04c76 | ||
|
|
f6d195a9de | ||
|
|
1d2649b49a | ||
|
|
cf72d1aac3 | ||
|
|
9222463565 | ||
|
|
8ff75346dd | ||
|
|
cae5d380c4 | ||
|
|
14d8627186 | ||
|
|
f358fcbda6 | ||
|
|
b185f3fac1 | ||
|
|
5f7fe7498f | ||
|
|
c89864c830 | ||
|
|
59fafac4d6 | ||
|
|
ebf7f8f599 | ||
|
|
f57519397b | ||
|
|
5ca3847c89 | ||
|
|
eee8f64fd4 | ||
|
|
0a5741f076 | ||
|
|
1147f35972 | ||
|
|
d698e0876d | ||
|
|
98798f18b5 | ||
|
|
8bed4c1d54 | ||
|
|
72801975cd | ||
|
|
7266f29491 | ||
|
|
2c82636a98 | ||
|
|
d47f87a768 | ||
|
|
887fcecf63 | ||
|
|
0428e5e8b9 | ||
|
|
0359ee6a76 | ||
|
|
1bef11accf | ||
|
|
c5de2acf57 | ||
|
|
9189342b77 | ||
|
|
abd688097a | ||
|
|
6930372d55 | ||
|
|
a124f5b88d | ||
|
|
0beda6bca4 | ||
|
|
a0fb944721 | ||
|
|
36eeab6df2 | ||
|
|
537472e9af | ||
|
|
496dc5508f | ||
|
|
2a659cb750 | ||
|
|
b097e598f1 | ||
|
|
2c639169fd | ||
|
|
bad8caee3f | ||
|
|
306466fc60 | ||
|
|
063e4bd072 | ||
|
|
e14b58a82c | ||
|
|
8d8edaea5d | ||
|
|
b0327d0544 | ||
|
|
a7b878cbb5 | ||
|
|
7ac6f93838 | ||
|
|
70ff3d9c90 | ||
|
|
0209a2465d | ||
|
|
b6408cec1c |
26
README
26
README
@@ -65,34 +65,24 @@ The source tree is composed of the following subdirectories:
|
||||
|
||||
:'doc':
|
||||
|
||||
This directory contains general documentation. Please consider the following
|
||||
document for a quick guide to get started with the framework:
|
||||
|
||||
! doc/getting_started.txt
|
||||
|
||||
If you are curious about the ready-to-use components that come with the
|
||||
framework, please review the components overview:
|
||||
|
||||
! doc/components.txt
|
||||
This directory contains general documentation along with a comprehensive
|
||||
collection of release notes.
|
||||
|
||||
:'repos':
|
||||
|
||||
This directory contains the so-called source-code repositories of Genode.
|
||||
Please refer to the README file in the 'repos' directory to learn more
|
||||
about the roles of the individual repositories.
|
||||
This directory contains the source code, organized in so-called source-code
|
||||
repositories. Please refer to the README file in the 'repos' directory to
|
||||
learn more about the roles of the individual repositories.
|
||||
|
||||
:'tool':
|
||||
|
||||
Source-code management tools and scripts. Please refer to the README file
|
||||
contained in the directory.
|
||||
|
||||
:'depot' and 'public':
|
||||
:'depot':
|
||||
|
||||
Local depot and public archive of Genode packages. Please refer to
|
||||
|
||||
! doc/depot.txt
|
||||
|
||||
for more details.
|
||||
Directory used by Genode's package-management tools. It contains the public
|
||||
keys and download locations of software providers.
|
||||
|
||||
|
||||
Additional community-maintained components
|
||||
|
||||
@@ -93,6 +93,24 @@ and the source code always looks good.
|
||||
_Hint:_ In VIM, use the 'set list' and 'set listchars' commands to make tabs
|
||||
and spaces visible.
|
||||
|
||||
* If class initializers span multiple lines, put the colon on a separate
|
||||
line and indent the initializers using one tab. For example:
|
||||
! Complicated_machinery(Material &material, Deadline deadline)
|
||||
! :
|
||||
! <tab>_material(material),
|
||||
! <tab>_deadline(deadline),
|
||||
! <tab>...
|
||||
! {
|
||||
! ...
|
||||
! }
|
||||
|
||||
* Preferably place statements that alter the control flow - such as
|
||||
'break', 'continue', or 'return' - at the beginning of a separate line,
|
||||
followed by vertical space (a blank line or the closing brace of the
|
||||
surrounding scope).
|
||||
! if (early_return_possible)
|
||||
! return;
|
||||
|
||||
|
||||
Switch statements
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
116
doc/news.txt
116
doc/news.txt
@@ -4,6 +4,118 @@
|
||||
===========
|
||||
|
||||
|
||||
Sculpt OS release 21.03 | 2021-03-24
|
||||
####################################
|
||||
|
||||
| Version 21.03 of the Sculpt operating system makes the system resilient
|
||||
| against classes of driver failures, adds configurable real-time priorities,
|
||||
| and introduces interfaces for screen capturing and user-event injection.
|
||||
|
||||
Sculpt OS 21.03 incorporates the many improvements of the latest two Genode
|
||||
releases. Thanks to Genode's concept of
|
||||
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - pluggable device drivers],
|
||||
the system has reached a new level of robustness against malfunctioning
|
||||
drivers. For example, if the Intel graphics driver trips over an unsupported
|
||||
external display, the driver gets automatically restarted while all graphical
|
||||
applications keep running. Or as another example, should the overly complex
|
||||
Wifi driver have a hick-up, it can be restarted with a simple mouse click
|
||||
without harming the networking stacks running on top.
|
||||
|
||||
Even though Genode supports static-priority scheduling since more than a
|
||||
decade, Sculpt did not make this feature available to end users so far. The
|
||||
new version changes that. For each component, the user can now take a
|
||||
deliberate decision about the hard scheduling priority, e.g., prioritizing
|
||||
latency-critical multi-media applications over computational workloads or
|
||||
virtual machines.
|
||||
|
||||
Speaking of workloads, to push the limits of what is possible with Sculpt OS,
|
||||
the new version introduces additional interfaces that can be assigned to
|
||||
components. First, it has become possible to redirect the interaction of a
|
||||
component with the kernel through another component, thereby enabling features
|
||||
like dynamic CPU-load balancing to be implemented as plain user-level
|
||||
services. Second, there are new interfaces for capturing the screen and for
|
||||
injecting input events. The latter interfaces pave the ground for virtual
|
||||
keyboards, screen-sharing application, or remote administration scenarios.
|
||||
|
||||
Under the hood, there are plenty of improvements that make the life of
|
||||
Sculpt users better. The keyboard layout can now be picked from a menu.
|
||||
The Chromium-based Falkon web browser runs circles around the previous
|
||||
version. Menu items and file lists appear nicely sorted. Terminal windows
|
||||
immediately respond to global font-size changes. On modern Intel machines,
|
||||
Sculpt leverages Intel Hardware P-states (HWP) for power and thermal
|
||||
management now. You can find an illustrated tour of these and more changes in
|
||||
a dedicated
|
||||
[https://genodians.org/nfeske/2021-03-24-sculpt-os - article at Genodians.org].
|
||||
|
||||
The updated [https://genode.org/documentation/articles/sculpt-21-03 - manual]
|
||||
goes into detail about the use of the new system.
|
||||
|
||||
The ready-to-use system image for version 21.03 is available at the
|
||||
[https://genode.org/download/sculpt - Sculpt download page].
|
||||
|
||||
|
||||
Genode OS Framework release 21.02 | 2021-02-25
|
||||
##############################################
|
||||
|
||||
| The highlights of version 21.02 are the addition of VirtualBox 6,
|
||||
| mobile-data connectivity via LTE, pluggable network drivers, initial
|
||||
| support for the Pine-A64-LTS board, and revived work on RISC-V.
|
||||
|
||||
Many topics of the current release draw a connection to our overarching goal
|
||||
to use Genode on the Pinephone by the end of the year. Besides the obvious
|
||||
steps of enabling the hardware - starting with the Pine-A64-LTS board - the
|
||||
release introduces mobile-data connectivity as a Genode feature, and changes
|
||||
the network-driver architecture in anticipation of dynamic power-management
|
||||
schemes.
|
||||
|
||||
For PC hardware, the flagship feature of version 21.02 is the addition of
|
||||
VirtualBox 6, giving us the prospect to eventually replace the aging port of
|
||||
VirtualBox 5. Speaking of VirtualBox, the release comes with profound
|
||||
improvements of the USB-device pass-through abilities, most importantly
|
||||
covering audio headsets.
|
||||
|
||||
Besides these prominent features, the new version comes with many further
|
||||
improvements. Just to name a few, virtual machines on ARM have become
|
||||
able to provide VirtIO-block devices to guests, named pipes can now
|
||||
be used to connect components, Genode's RISC-V support received an
|
||||
update to ISA spec 1.10, and OpenSSL has been bumped to version 1.1.1.
|
||||
For the full story, please refer to the
|
||||
[https:/documentation/release-notes/21.02 - release documentation of version 21.02...]
|
||||
|
||||
|
||||
Road Map for 2021 | 2021-01-15
|
||||
##############################
|
||||
|
||||
| In 2021, we plan to bring Genode to the Pinephone, advance the framework's
|
||||
| GPU support, and focus on development workflows.
|
||||
|
||||
During the annual road-map discussion on Genode's public
|
||||
[https://genode.org/community/mailing-lists - mailing list],
|
||||
the following hot topics for this year emerged.
|
||||
|
||||
First and most inspiring for many Genode developers, we aspire to have
|
||||
Genode running on the Pinephone with basic feature-phone functionality by the
|
||||
end of the year. Since this will involve substantial device-driver-related
|
||||
developments, the team will take this line of work as an opportunity to
|
||||
advance the tooling and workflows for carrying out such tasks. This, in turn,
|
||||
will hopefully ease the on-boarding of new driver developers in the future.
|
||||
|
||||
Closely related to the Pinephone scenario, the project will make optimizations
|
||||
a top priority this year. The opportunities are plenty, ranging from
|
||||
micro-optimizations, over API refinements, to architectural changes if
|
||||
needed.
|
||||
|
||||
Another recurring topic is the request for GPU support, which is required
|
||||
by many modern workloads such as video conferencing or streaming on mobile
|
||||
device. Therefore, we will revamp our past developments of GPU multiplexing
|
||||
on Intel hardware while also starting the investigation of GPUs on ARM-based
|
||||
devices.
|
||||
|
||||
More information about our review of the past year, this year's focus, and a
|
||||
rough schedule are presented at our official
|
||||
[https:/about/road-map - road-map page].
|
||||
|
||||
|
||||
Genode OS Framework release 20.11 | 2020-11-27
|
||||
##############################################
|
||||
|
||||
@@ -211,7 +323,7 @@ please consult the
|
||||
Road Map for 2020 | 2020-01-20
|
||||
##############################
|
||||
|
||||
| In 2019, we will be concerned about dwarfing the barrier of entry into
|
||||
| In 2020, we will be concerned about dwarfing the barrier of entry into
|
||||
| the Genode world.
|
||||
|
||||
Following the last year's leitmotif of "bridging worlds", we turn our
|
||||
@@ -2954,7 +3066,7 @@ applications, most prominently, it serves as the foundation of the KDE project.
|
||||
Since the release 9.05, the official distribution of Genode supports Qt4 as a
|
||||
regular feature. The document "Portierung von Qt auf Genode" _(german)_
|
||||
describes the challenging endeavor of porting this high-complexity C++
|
||||
framework to Genode. Major problems to overcome had been the missing C libary
|
||||
framework to Genode. Major problems to overcome had been the missing C library
|
||||
(at the time when the project started), the integration of the Qt4 project
|
||||
files with Genode's build system, the adaption of Qt4 to the basic primitives
|
||||
provided by Genode, and the integration of Qt4 with Genode's GUI. In addition
|
||||
|
||||
663
doc/release_notes/21-02.txt
Normal file
663
doc/release_notes/21-02.txt
Normal file
@@ -0,0 +1,663 @@
|
||||
|
||||
|
||||
===============================================
|
||||
Release notes for the Genode OS Framework 21.02
|
||||
===============================================
|
||||
|
||||
Genode Labs
|
||||
|
||||
|
||||
|
||||
Genode 21.02 stays close to the plan laid out on our
|
||||
[https://genode.org/about/road-map - road map], featuring a healthy dose
|
||||
of optimizations, extends the framework's ARM SoC options, and introduces
|
||||
three longed-for new features.
|
||||
|
||||
First, we extended our concept of pluggable device drivers to all network
|
||||
drivers, including Ethernet and Wifi.
|
||||
As reported in Section [Pluggable network device drivers], such drivers can
|
||||
now gracefully be started, restarted, removed, and updated at runtime without
|
||||
disrupting network-application stacks.
|
||||
|
||||
Second, the release features the infrastructure needed for mobile-data
|
||||
communication over LTE, which is a prerequisite for our ambition to use Genode
|
||||
on the Pinephone. Section [LTE modem stack] gives insights into the involved
|
||||
components and the architecture.
|
||||
|
||||
Third, we are happy to feature the initial version of VirtualBox 6 for
|
||||
Genode. Section [VirtualBox 6.1.14] gives an overview of the already
|
||||
supported feature set and the outlook to reach feature-parity to our version
|
||||
of VirtualBox 5 soon.
|
||||
Speaking of VirtualBox in general (both versions), we were able
|
||||
to significantly improve the USB-device pass-through abilities, specifically
|
||||
covering audio headsets.
|
||||
|
||||
Further noteworthy improvements of the current release range from added
|
||||
VirtIO-block device support for virtual machines on ARM
|
||||
(Section [VirtIO block devices for virtual machines on ARM]),
|
||||
revived developments on RISC-V (Section [RISC-V]),
|
||||
over VFS support for named pipes (Section [VFS support for named pipes]),
|
||||
to streamlined tooling (Section [Build system and tools]).
|
||||
|
||||
|
||||
Pluggable network device drivers
|
||||
################################
|
||||
|
||||
The results of our approach to
|
||||
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - pluggable framebuffer and input drivers]
|
||||
encouraged us to take on the third major driver category, namely networking
|
||||
drivers, which subsumes not only Ethernet drivers but also wireless networking
|
||||
drivers and mobile baseband drivers. The latter two are of course particularly
|
||||
interesting for mobile communication devices.
|
||||
|
||||
Similarly to the story linked above for the framebuffer and input drivers,
|
||||
Genode's network drivers used to play the roles of NIC servers, providing a
|
||||
network-interface service to network applications. As a consequence, the
|
||||
lifetime of a network application was always bound to the lifetime of the
|
||||
underlying NIC driver. This is unfortunate because those drivers can be
|
||||
obscenely complex, putting the liveliness of the dependent application stack
|
||||
at risk.
|
||||
|
||||
[image layered_nic_multi_app_risk]
|
||||
|
||||
However, in most scenarios, networking applications do not operate directly on
|
||||
a network interface because this would prevent the use of the network interface
|
||||
by more than one application at a time. Instead, there is usually a NIC
|
||||
multiplexing component in-between the driver and one or multiple applications.
|
||||
In most contemporary scenarios this is the NIC router that acts as NIC client
|
||||
towards the driver and as NIC server towards the applications.
|
||||
|
||||
Thus, we contemplated the idea of letting the NIC driver operate as NIC client
|
||||
of the NIC router instead. This would decouple the application from the
|
||||
driver's lifetime while the driver's special role would be modeled solely by a
|
||||
routing policy. However, even though the data channel of the NIC interface is
|
||||
bi-directional, we realized that the reversal of the role of the driver does
|
||||
not only entail the communication of network payload but also propagation of
|
||||
the link state and the MAC address. This prompted us to introduce a new Genode
|
||||
session type called "Uplink" that precisely models the NIC-driver-as-client
|
||||
scenario.
|
||||
|
||||
[image nic_router_services]
|
||||
|
||||
In a nutshell, an Uplink session is almost the same as a NIC session with only
|
||||
three minor differences. First, the MAC address is given by the client (the
|
||||
driver) as an argument at session-creation time. Second, the roles of the TX
|
||||
and RX packet streams are interchanged compared to a NIC session. I.e., the
|
||||
_client_ transmits via TX and receives through RX while at the server side it's
|
||||
vice-versa. And third - as a mere interface optimization - the link state of an
|
||||
uplink session is always "up". The session is requested by the client (the
|
||||
driver) only in the event of a "link-up" edge. Analogously, whenever the link
|
||||
goes "down", the client closes the session again.
|
||||
|
||||
With this new session interface in place, the NIC router becomes the only
|
||||
long-running component in the scenario. It provides both a NIC and an uplink
|
||||
session interface. The NIC session interface is used by network applications.
|
||||
The uplink session interface is used by drivers. Inside the router, uplink
|
||||
sessions are treated the same as NIC sessions. Therefore, we decided that the
|
||||
well known '<policy>' tags in the configuration are now simply applied to both
|
||||
session types. This means, that each '<uplink>' tag that connected a driver in a
|
||||
router configuration can now be replaced by a '<policy>' tag with a label
|
||||
attribute that matches the driver's session request.
|
||||
|
||||
[image nic_uplink_multi_app]
|
||||
|
||||
We divided the process for this architectural change into the following
|
||||
autonomous steps:
|
||||
|
||||
# Introduce the uplink session and uplink-session support in the NIC router.
|
||||
# Let NIC drivers support both modes, "NIC session server" and "Uplink session
|
||||
client" depending on a new _transitional_ <config>-tag attribute 'mode'.
|
||||
This attribute is optional and has two possible values, 'uplink_client'
|
||||
and 'nic_server', of which it defaults to the latter.
|
||||
# Adapt all network scenarios in the basic Genode repositories to use NIC
|
||||
drivers only with '<config mode="uplink_client">'.
|
||||
# Remove support for the "NIC session server" mode from all NIC drivers and
|
||||
with it also the transitional 'mode' attribute.
|
||||
|
||||
All steps except the last one are completed by now. The transitional 'mode'
|
||||
attribute and the "NIC session server" mode will remain available in all NIC
|
||||
drivers until the next Genode release in order to give others the opportunity
|
||||
to gracefully adapt their NIC drivers and network scenarios to the change.
|
||||
|
||||
|
||||
Further information
|
||||
-------------------
|
||||
|
||||
The overarching topic of pluggable device drivers was covered by our recent
|
||||
presentation at [https://fosdem.org/2021/ - FOSDEM 2021]. You can find the
|
||||
video recording and the presentation slides at the following link.
|
||||
|
||||
:Pluggable device drivers for Genode:
|
||||
|
||||
_presented at FOSDEM 2021_
|
||||
|
||||
[https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/]
|
||||
|
||||
|
||||
LTE modem stack
|
||||
###############
|
||||
|
||||
With the current release, Genode adds LTE broadband modem support for packet data
|
||||
connections. This way, it becomes possible to browse the internet using the SIM
|
||||
card of your broadband service provider. For a description of the protocols and
|
||||
the general terminology when talking about LTE modems, our
|
||||
[https://genodians.org/ssumpf/2020-12-04-mbim - LTE modem support for Genode]
|
||||
Genodians article is a good starting point.
|
||||
|
||||
From the device side, LTE modems register themselves as USB devices at the USB
|
||||
host controller. The speciality is that a modem offers two interfaces. First, a USB
|
||||
network interface (like NCM or ECM) and second, a
|
||||
[https://www.usb.org/document-library/class-definitions-communication-devices-12 - Wireless Mobile Communication Device],
|
||||
which is a challenge/response control channel to the modem and used to configure
|
||||
the device. For the actual communication through the control channel, there exist two
|
||||
binary protocols: Namely, Mobile Broadband Interface Model (MBIM) and Qualcomm
|
||||
Mobile Station Interface (QMI). Whereas the former is a USB standard, QMI is a
|
||||
proprietary protocol by Qualcomm. Therefore, we picked a modem that supports the
|
||||
MBIM standard for our line of work.
|
||||
|
||||
|
||||
USB modem support
|
||||
=================
|
||||
|
||||
In order to enable modem communication, we added the Linux USB modem driver for
|
||||
MBIM to our _dde_linux_ device driver environment. This driver implements the
|
||||
NCM and WDM interfaces for the modem and provides a network uplink session for
|
||||
the NCM network interface and a terminal session for the WDM interface.
|
||||
|
||||
[image lte_mbim]
|
||||
|
||||
|
||||
MBIM protocol
|
||||
=============
|
||||
|
||||
MBIM is a binary protocol that is, for example, implemented by
|
||||
[https://www.freedesktop.org/wiki/Software/libmbim/ - libmbim]. Therefore, we
|
||||
ported _libmbim_ to Genode. Since it requires _glib_, we had to enable features
|
||||
and improve our _glib_ support on Genode. The _libmbim_ library offers MBIM command handling only.
|
||||
For actually triggering modem-communication, the _mbimcli_ tool is required. We
|
||||
ported _mbimcli_ and changed its front end to trigger a modem packet-connection
|
||||
sequence via _libmbim_ through the terminal session of the USB modem driver.
|
||||
During this sequence, the SIM card is unlocked through the PIN, the packet
|
||||
service is attached, and connection information (e.g., IP, gateway, DNS server)
|
||||
is retrieved. The connection data is then used by _mbimcli_ to configure the
|
||||
uplink of Genode's NIC router, which in turn makes the network connectivity available
|
||||
to network applications. The holistic view is shown in image [lte_mbim].
|
||||
|
||||
|
||||
Base framework and OS-level infrastructure
|
||||
##########################################
|
||||
|
||||
NIC router
|
||||
==========
|
||||
|
||||
The NIC router received two practical features, the consideration of
|
||||
multiple DNS server entries on DHCP and an ARP-less mode for domains.
|
||||
|
||||
The latter was motivated by the fresh support for LTE modems (see Section
|
||||
[LTE modem stack]). An LTE modem normally doesn't respond to ARP. So when
|
||||
using it as uplink for the NIC router, the corresponding domain can't request
|
||||
IP-to-MAC-address resolutions as usual. This is addressed through the new
|
||||
optional attribute 'use_arp' in '<domain>' tags of the NIC router configuration.
|
||||
By default, it is set to 'yes', which yields the same behavior as in the past.
|
||||
|
||||
However, when set to 'no' for a domain, this domain will prevent sending ARP
|
||||
requests in general. This leaves the question how to determine the destination
|
||||
MAC address for a packet that shall be sent at this domain when only the
|
||||
destination IP address is known. This is solved by the router by simply using
|
||||
the source MAC address also as destination MAC address, an approach that we
|
||||
could observe also in other IP stacks and that worked just fine in our tests.
|
||||
The ARP-less domain mode is demonstrated through the run script
|
||||
_repos/os/run/nic_router_disable_arp.run_.
|
||||
|
||||
The consideration of multiple DNS-server entries on DHCP comes in two parts.
|
||||
First, when acting as DHCP client at a domain, the router will now parse all
|
||||
option 6 entries in DHCP ACK replies from the server and memorize them as part
|
||||
of the resulting IP config of the domain. These entries will then also be
|
||||
reported if '<report config="yes"/>' is set in the router's config. A router
|
||||
report with multiple DNS server entries will look like this:
|
||||
|
||||
! <state>
|
||||
! <domain name="uplink_1" ipv4="10.0.0.3/24" gw="10.0.0.1">
|
||||
! <dns ip="10.0.0.2"/>
|
||||
! <dns ip="1.1.1.1"/>
|
||||
! <dns ip="8.8.8.8"/>
|
||||
! ...
|
||||
! </domain>
|
||||
! <domain name="uplink_2" ipv4="168.192.0.200/24" gw="168.192.0.1">
|
||||
! <dns ip="168.192.0.10"/>
|
||||
! <dns ip="168.192.0.8"/>
|
||||
! ...
|
||||
! </domain>
|
||||
! ...
|
||||
! </state>
|
||||
|
||||
On the other hand, when acting as DHCP server at a domain, one has two
|
||||
options. Option 1 is to configure the DHCP server to fetch DNS server entries
|
||||
automatically from another domain:
|
||||
|
||||
! <domain name="downlink" interface="10.0.1.1/24">
|
||||
! <dhcp-server dns_server_from="uplink_1" .../>
|
||||
! </domain>
|
||||
|
||||
In this case, the router will now reflect not only one but all DNS server
|
||||
entries from the source domain ("uplink") through the DHCP replies sent at the
|
||||
destination domain ("downlink") without changing the entry order. This approach
|
||||
is demonstrated through the new _repos/os/run/nic_router_dhcp_unmanaged.run_
|
||||
run script.
|
||||
|
||||
Option 2 is to configure the DNS server entries manually at the DHCP
|
||||
server:
|
||||
|
||||
! <domain name="downlink" interface="10.0.1.1/24">
|
||||
! <dhcp-server ...>
|
||||
! <dns-server ip="10.0.0.2"/>
|
||||
! <dns-server ip="1.1.1.1"/>
|
||||
! <dns-server ip="8.8.8.8"/>
|
||||
! </dhcp-server>
|
||||
! </domain>
|
||||
|
||||
The order of the '<dns-server>' tags determines the order of
|
||||
option 6 entries in the replies of the DHCP server. Besides its use for static
|
||||
DNS server configurations, this option can also be used for more sophisticated
|
||||
forwarding of DNS server entries through a separate management component. The
|
||||
management component could listen to the reported IP config of the source
|
||||
domains, apply custom policies like address filters to the result, and
|
||||
re-configure the DHCP servers of the destination domains accordingly. This
|
||||
approach is demonstrated in the new _repos/os/run/nic_router_dhcp_managed.run_
|
||||
run script.
|
||||
|
||||
Please note that the former 'dns_server' attribute of the '<dhcp-server>' tag
|
||||
is no longer considered by the router as the new '<dns-server>' tag replaces it.
|
||||
Thus, you might want to adapt your NIC router scenarios accordingly.
|
||||
|
||||
|
||||
VFS support for named pipes
|
||||
===========================
|
||||
|
||||
The VFS-pipe plugin received new support for named pipes. The main motivation was to
|
||||
easily stream data from pure Genode components to libc components via
|
||||
file-system sessions that can be attached to stdin, stdout, and stderr. This
|
||||
feature further makes it possible to chain the data flow between several components together,
|
||||
similarly to how it is done on Unix. Additionally, the thread synchronization
|
||||
has been improved so that large data chunks can be transferred without
|
||||
blocking.
|
||||
|
||||
A named pipe can be created by adding a '<fifo>' sub node to the '<pipe>' node
|
||||
of the VFS:
|
||||
|
||||
! <vfs>
|
||||
! <pipe>
|
||||
! <fifo name="upstream"/>
|
||||
! </pipe>
|
||||
! ...
|
||||
! </vfs>
|
||||
|
||||
Each pipe is exposed as a set of pseudo files.
|
||||
|
||||
! /upstream
|
||||
! /.upstream/in/in
|
||||
! /.upstream/out/out
|
||||
|
||||
The _/upstream_ pseudo file can be opened either as read-only or write-only
|
||||
file. It allows for the access of both ends of the pipe. In contrast, each of
|
||||
the pseudo files _/.upstream/in/in_ and _/.upstream/out/out_ represents only
|
||||
one end of the pipe, which can be subjected to an individual directory-based
|
||||
access-control policy.
|
||||
|
||||
Thanks to Sid Hussmann for contributing this valuable feature!
|
||||
|
||||
|
||||
Terminal
|
||||
========
|
||||
|
||||
While
|
||||
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - revising the GUI stack]
|
||||
in Genode 20.08, we largely abolished the use of the framebuffer and input
|
||||
session interfaces. The graphical terminal, however, still relied on those
|
||||
interfaces instead of the GUI session. In practice, there was always a gui_fb
|
||||
component needed as an intermediate between the terminal and the GUI server.
|
||||
To complete the GUI-stack transition, we changed the terminal to use the GUI
|
||||
session directly and adjusted all current scenarios that use the terminal.
|
||||
|
||||
One useful feature of the gui_fb component was the definition of an initial
|
||||
window size. This enabled packages such as Sculpt's system shell to present
|
||||
terminal windows with a reasonable default size smaller than the entire
|
||||
screen.
|
||||
To accommodate this special case, the initial terminal size can now be
|
||||
explicitly configured in the terminal configuration.
|
||||
|
||||
! <config>
|
||||
! <initial width="800" height="600"/>
|
||||
! ...
|
||||
! </config>
|
||||
|
||||
While we were at it, we also enhanced the terminal with the ability to
|
||||
dynamically respond to font changes. So the adjustment of the global font
|
||||
settings in Sculpt OS takes immediate effect on all terminal windows.
|
||||
|
||||
|
||||
OpenSSL 1.1.1i, curl 7.70.0
|
||||
===========================
|
||||
|
||||
OpenSSL experienced some quite important security updates during the last
|
||||
months. This prompted us to update our port to version 1.1.1i. During
|
||||
the porting work, we kept an eye on performance and enabled CPU-specific
|
||||
optimizations where feasible. Optimizations are enabled by default on
|
||||
x86 and ARMv8. For ARMv7, we enable NEON-based functions only when the
|
||||
build SPECS include "neon" to support common SoCs that lack these
|
||||
capabilities in the default configuration. Please note, the updated
|
||||
port does only provide one combined depot archive "openssl" that
|
||||
replaces the former "libcrypto" and "libssl" archives. The libraries
|
||||
are still distinct for compatibility with existing applications and
|
||||
build systems. As a side effect, we also updated the curl library to
|
||||
version 7.70, which is compatible with recent OpenSSL versions.
|
||||
|
||||
Thanks to Pirmin Duss for his valuable contribution to this update.
|
||||
|
||||
|
||||
Virtualization
|
||||
##############
|
||||
|
||||
VirtualBox 6.1.14
|
||||
=================
|
||||
|
||||
Genode supports virtualization with VirtualBox
|
||||
[https://genode.org/documentation/release-notes/14.02#VirtualBox_on_top_of_the_NOVA_microhypervisor - since 2014].
|
||||
Back then, we enabled VirtualBox version 4 to support use cases with unmodified
|
||||
Linux and Windows guests like Sculpt's predecessor
|
||||
[https://genode.org/documentation/release-notes/15.11#Genode_as_desktop_OS - "Turmvilla"].
|
||||
In 2016, we updated VirtualBox to version 5 to enable recent guest OS
|
||||
versions notably Ubuntu 16.04 and Windows 10. VirtualBox 5 is an
|
||||
integral part of Sculpt OS since its first release.
|
||||
|
||||
As VirtualBox 5 is no longer maintained upstream and also shows its age
|
||||
when running recent versions of Windows 10, we accepted the challenge
|
||||
to once again enable a new version of this VMM. This time we did not
|
||||
go for a NOVA-specific port but exclusively use the kernel-agnostic
|
||||
virtualization interfaces introduced in
|
||||
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - Genode 19.05].
|
||||
This way, VirtualBox 6 is prepared to run on NOVA, seL4, and Fiasco.OC alike with
|
||||
minimal extra efforts.
|
||||
|
||||
The first development snapshot we publish with this release is ready to
|
||||
run Linux and Windows guests with limited support for multiple cores,
|
||||
integrates network and USB-passthrough as well as preliminary support
|
||||
for Guest Additions like mouse integration and display. We are
|
||||
committed to finalize the feature set and optimize the performance of
|
||||
VirtualBox 6 until the upcoming Sculpt release but do not plan to replace
|
||||
version 5 completely yet. In fact, the update paves the way to explore
|
||||
more experimental grounds like enablement of GPU-based
|
||||
acceleration of guest OSes.
|
||||
|
||||
As a starting point for exploring VirtualBox 6 on Genode, we recommend the run script
|
||||
_ports/run/virtualbox6.run_.
|
||||
|
||||
|
||||
VirtualBox 5
|
||||
============
|
||||
|
||||
With this release, we extended our VirtualBox port and made USB
|
||||
pass-through more robust.
|
||||
|
||||
So far, we most prominently use VirtualBox on Intel systems that feature
|
||||
VT-x. This release enables support for also running 64bit guests on AMD
|
||||
systems with SVM.
|
||||
|
||||
When it comes to USB pass-through support, we rely on the xHCI device-model
|
||||
ported from Qemu. With this release, we updated the 3rd-party sources to
|
||||
version 5.2.0 and the type of the exposed device has changed to QEMU xHCI. Due to
|
||||
this change, older guest OSes - namely Windows 7 - that relied on the NEC
|
||||
xHCI device will no longer work.
|
||||
|
||||
Thanks to the update, it becomes possible to use USB devices requiring isochronous
|
||||
transfers, in particular audio devices, with Windows 10 guests. For now
|
||||
we focused on USB-Audio-Class v1 devices using adaptive
|
||||
synchronisation, which enables a variety of popular USB headsets for
|
||||
the passthrough use case.
|
||||
|
||||
A glimpse into our USB machinery unveils that fine-tuned buffering and USB
|
||||
transfer configuration is the key to robust USB passthrough. On one hand, the
|
||||
handling of isochronous OUT transfers in our host connection batches multiple
|
||||
packets and queues transfers, which helps to smoothen out playback in case other
|
||||
Genode components utilize the CPU concurrently. On the other hand, the number of
|
||||
IN requests queued is increased but the number of packets per request set to 1.
|
||||
We obtained the best results by following this configuration observed in Linux
|
||||
and Windows guests alike.
|
||||
|
||||
|
||||
VirtIO block devices for virtual machines on ARM
|
||||
================================================
|
||||
|
||||
With release
|
||||
[https://genode.org/documentation/release-notes/20.02#Custom_virtual_machine_monitor_on_ARM - 20.02],
|
||||
the first VirtIO device models entered Genode's virtual
|
||||
machine monitor for ARM. They enabled a virtual machine to access network and
|
||||
terminal services. This time, the VMM got extended with a block device model,
|
||||
which again is compliant to the VirtIO 1.1 specification. Moreover, the generic
|
||||
model implementation, which is common to all VirtIO devices, got polished fairly.
|
||||
|
||||
The new block device model is not configurable yet. By now, the VMM is
|
||||
hard-coded to provide exactly one block device. Consequently, one route to a
|
||||
Block service needs to be provided to the VMM component.
|
||||
|
||||
The execution of the test run-script in _repos/os/run/vmm_arm.run_ shows
|
||||
the new VirtIO block device in action.
|
||||
|
||||
|
||||
Device drivers
|
||||
##############
|
||||
|
||||
Power-gating of PCI devices on x86
|
||||
==================================
|
||||
|
||||
PCI devices have several PCI capabilities that describe the feature set
|
||||
the device supports, as defined by the PCI specification. The platform driver - which
|
||||
is the gatekeeper of devices on Genode - got extended to power on and power off
|
||||
devices whenever the PCI power capability is supported. When powering on, a device reset
|
||||
is issued if it is supported by the PCI device. During release of a driver from a
|
||||
device, all DMA memory associated to the device is
|
||||
flushed from the IO-MMU TLB to avoid any further access.
|
||||
|
||||
Additionally, the platform driver has become able to respond to configuration
|
||||
changes. Special care must be taken if the configuration of a running device
|
||||
driver changes. If the configuration re-evaluation concludes that a driver is no longer
|
||||
permitted to use an already assigned PCI device, the Platform session
|
||||
will be closed forcefully, making the device inaccessible to the driver.
|
||||
|
||||
The extended features of the platform driver supplement our previous work of
|
||||
restarting respectively replacing a running graphics driver in Sculpt OS. The driver
|
||||
manager, as used by Sculpt, uses Genode's heartbeat monitoring to check for the
|
||||
liveliness of the Intel framebuffer driver and restarts it automatically if the
|
||||
driver becomes unresponsive. Restarting
|
||||
involves closing the Platform session, thereby powering off the Intel device,
|
||||
and reopening the Platform session, thereby powering and resetting the
|
||||
Intel device into a functional state.
|
||||
This self-healing mechanism can be seen in action in the recording of our
|
||||
[https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/ - FOSDEM talk]
|
||||
about pluggable device drivers.
|
||||
|
||||
|
||||
USB drivers
|
||||
===========
|
||||
|
||||
Additional HID devices
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
It's a sad truth that some popular USB keyboards and mice do not fully
|
||||
comply with the USB HID standard. The Linux kernel comes with dozens
|
||||
of special functions to fix up quirks and enable these devices
|
||||
for Linux systems also. With the current release, we adopt quirk functions
|
||||
for Apple HID devices and mice based on the Holtek chipset (e.g., the
|
||||
Sharkoon Drakonia) that are applied automatically if one of these
|
||||
devices is plugged.
|
||||
|
||||
|
||||
USB robustness
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
We improved the robustness of the USB HID driver with regard to device
|
||||
reconnection, as well as the robustness of the DWC OTG host driver for
|
||||
the Raspberry Pi when used with HID devices.
|
||||
|
||||
|
||||
Isochronous transfers
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
While looking more closely into supporting isochronous transfers
|
||||
driven by the USB pass-through use-case, we encountered and addressed shortcomings
|
||||
in the current implementation in the USB host-controller driver
|
||||
when dealing with IN transfers containing multiple isochronous frames.
|
||||
However, this is only a first step as we identified significant potential for
|
||||
optimization and robustness improvements.
|
||||
|
||||
|
||||
Platforms
|
||||
#########
|
||||
|
||||
Pine-A64-LTS single board computer
|
||||
==================================
|
||||
|
||||
Our [https://genode.org/about/road-map - road map] envisions
|
||||
the use of Genode on the Pinephone by the end of the year. As a first stepping
|
||||
stone, the current release adds basic board support for the
|
||||
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
|
||||
single-board computer. We take this line of work as a welcome opportunity to
|
||||
thoroughly document the porting process. You can find the work explained in
|
||||
great detail in the following article series.
|
||||
|
||||
# [https://genodians.org/nfeske/2020-12-10-pine-fun-warmup - Warming up for some Pine fun]
|
||||
# [https://genodians.org/nfeske/2020-12-17-pine-fun-serial - Bare-metal serial output]
|
||||
# [https://genodians.org/nfeske/2021-01-28-pine-fun-kernel-skeleton - Kernel skeleton]
|
||||
# [https://genodians.org/nfeske/2021-02-11-pine-fun-debugging - How did we come here?]
|
||||
# [https://genodians.org/nfeske/2021-02-18-pine-fun-user-land - Excursion to the user land]
|
||||
|
||||
The latest state of this line of work is available at a dedicated repository:
|
||||
|
||||
:Genode board support for Allwinner SoCs:
|
||||
|
||||
[https://github.com/nfeske/genode-allwinner]
|
||||
|
||||
|
||||
RISC-V
|
||||
======
|
||||
|
||||
RISC-V development has been on the hold at Genode Labs for a while. But with the
|
||||
current release this has changed. One of the main goals we had for a long time
|
||||
is the use of Qemu instead of the Spike emulator for our test infrastructure, since
|
||||
every other platform runs on Qemu, Spike causes additional overhead at Genode
|
||||
Labs.
|
||||
By updating the privileged ISA specification support from 1.9.1 to 1.10,
|
||||
we became able to use recent Qemu versions (e.g., 4.2.1).
|
||||
Thanks to this change, we could remove the _spike_ board and add a new
|
||||
_riscv_qemu_ board to our _base_hw_ kernel implementation.
|
||||
|
||||
As another nice side effect, Qemu ships its own OpenSBI machine binary, which
|
||||
implements the machine mode and SBI calls. It can be enabled through the "-bios"
|
||||
command line option. With a machine mode for ISA 1.10 in place, we were able to
|
||||
remove the old [https://github.com/ssumpf/bbl-lite - BBL] machine mode
|
||||
implementation from Genode.
|
||||
For more information on this topic please refer to the corresponding
|
||||
[https://genodians.org/ssumpf/2021-02-24-riscv - Genodians article].
|
||||
|
||||
In order to improve development speed, we were able to reduce the link time for
|
||||
_core_ and its debugging variant from about 50 to 5 seconds. Additionally, we
|
||||
fixed long standing link errors that were caused by mixing up soft float and
|
||||
hard float objects as well as misconfigured linker scripts.
|
||||
|
||||
|
||||
Removal of Muen separation kernel support
|
||||
=========================================
|
||||
|
||||
Since
|
||||
[https://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - version 15.08],
|
||||
Genode supported the use of the [https://muen.sk - Muen] separation kernel as
|
||||
underlying platform. The driving force behind the original development was the
|
||||
joyful collaboration with the Muen developers Adrian-Ken Rueegsegger and Reto
|
||||
Buerki and the prospect for products that combine the rigidity of a separation
|
||||
kernel with the dynamic workloads enabled by Genode.
|
||||
|
||||
However, over the past 5 years, this potential synergy remained untapped.
|
||||
In hindsight, the stacking of one microkernel-based system onto another
|
||||
microkernel-based system is a tough sell. Hosting dynamic workloads in a Linux
|
||||
VM atop Muen is certainly more relatable to Muen users. Vice versa, for Genode
|
||||
users, Genode on bare hardware is less complex and more flexible than using
|
||||
the framework atop a separation kernel.
|
||||
|
||||
Without adoption of the joint platform, neither of both teams can justify the
|
||||
ongoing effort needed for the continued maintenance of Genode on Muen. Hence,
|
||||
we [https://github.com/genodelabs/genode/issues/3995 - concluded] to remove
|
||||
Muen as an officially supported platform.
|
||||
|
||||
|
||||
Build system and tools
|
||||
######################
|
||||
|
||||
Streamlined distinction of boards by build and run tools
|
||||
========================================================
|
||||
|
||||
In
|
||||
[https://genode.org/documentation/release-notes/20.05#Board_support_outside_the_Genode_main_repository - Genode 20.05],
|
||||
we introduced the principle ability to decouple board-support packages from
|
||||
the project's main repository. We thereby want to enable developers outside
|
||||
the Genode core team to port Genode to diverse hardware platforms.
|
||||
With the current release, we further refined the structure of the code base and
|
||||
the tooling to largely eliminate remaining points of friction when hosting
|
||||
board support in external repositories.
|
||||
|
||||
We ultimately removed the use of board-specific SPEC values throughout the
|
||||
build system and run scripts. SPEC values are now solely used to refer to
|
||||
aspects of an instruction-set architecture, e.g., x86, 64bit, or arm_v8a.
|
||||
In run scripts, the new convenience function 'have_board' has become the
|
||||
preferred way to distinguish the behavior of run scripts depending on the
|
||||
targeted board now. It replaces all former uses of 'have_spec <board>'.
|
||||
Moreover, the long deprecated option of the _create_builddir_ tool to create
|
||||
board-specific build directories has been removed.
|
||||
|
||||
To simplify the hosting of board support in separate source-code repositories,
|
||||
board-specific properties have moved from run-tool scripts to the new notion
|
||||
of *board property directories*. Such directories named
|
||||
_<repo>/board/<board>/_ contain files with board-specific information.
|
||||
In particular, the 'image_link_address' file contains the physical
|
||||
link address of the system image taking the board's physical memory
|
||||
constraints into account, and the 'arch' file contains the CPU
|
||||
architecture of the SoC. The run tool picks up this information
|
||||
from the board-property files.
|
||||
|
||||
Furthermore, the *packaging* of the board-specific base-hw kernel has
|
||||
become more formalized by leveraging the board-property directories.
|
||||
This makes the packaging vastly simpler. Regardless of where the board-support
|
||||
is hosted, the _content.mk_ file for a kernel source archive becomes as simple
|
||||
as:
|
||||
|
||||
! include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc
|
||||
|
||||
The board name is automatically inferred from the path of the src recipe. The
|
||||
architecture is determined from _board/<name>/arch_ files. The attempt to
|
||||
build a base-hw-<board> binary archive for the wrong architecture is now
|
||||
gracefully handled by skipping all targets (using the REQUIRES mechanism).
|
||||
|
||||
Besides the improved convenience, the resulting depot archives
|
||||
have become much closer tailored to the actual board by omitting files for
|
||||
architectures that are not used by the board. E.g., the src/base-hw-pc
|
||||
archive does not contain any ARM-related content.
|
||||
|
||||
|
||||
Compiler cache
|
||||
==============
|
||||
|
||||
The [https://ccache.dev - ccache] tool is a fantastic way to accelerate the
|
||||
developer workflow when repeatedly building software. Since ccache is -
|
||||
strictly speaking - orthogonal to the build system, configuring the Genode
|
||||
build system for the use of ccache was left to each developer.
|
||||
|
||||
Setting up ccache is not straight-forward though. One must manually create
|
||||
hooks (symlinks shadowing the compiler executables), tweak the PATH
|
||||
environment variable, and customize the CROSS_DEV_PREFIX in
|
||||
_etc/tools.conf_. In short, only seasoned developers jump through those hoops.
|
||||
Many others may miss out on the joys of ccache.
|
||||
|
||||
With the current release, the build-system front end makes ccache easily
|
||||
available by enabling a simple option in the _etc/build.conf_ file:
|
||||
|
||||
! CCACHE := yes
|
||||
|
||||
266
doc/road_map.txt
266
doc/road_map.txt
@@ -14,121 +14,92 @@ 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 2019
|
||||
Review of 2020
|
||||
##############
|
||||
|
||||
For the road map 2019, we picked "bridging worlds" as our guiding theme:
|
||||
(1) Lowering the friction when combining existing software with Genode,
|
||||
(2) Fostering interoperability with widely used protocols and APIs, and
|
||||
(3) Making Genode easier to approach and generally more practical.
|
||||
The overarching theme of our road map for 2020 was "Dwarfing the barrier of
|
||||
entry", which expressed the ambition to reach a wider audience. On that
|
||||
account, we identified four promising directions: First, making Sculpt OS
|
||||
palatable for a wider circle. Second, fostering the public perception of the
|
||||
high quality of Genode to reinforce the confidence of people who are sceptical
|
||||
towards novel operating-system technology. Third, lowering the barrier of
|
||||
entry by providing frictionless tooling. And fourth, publicly presenting use
|
||||
cases that prove the fitness and flexibility of Genode. These directions
|
||||
certainly did a good job of motivating the working topics of last year's four
|
||||
releases
|
||||
[https://genode.org/documentation/release-notes/20.02 - 20.02],
|
||||
[https://genode.org/documentation/release-notes/20.05 - 20.05],
|
||||
[https://genode.org/documentation/release-notes/20.08 - 20.08], and
|
||||
[https://genode.org/documentation/release-notes/20.11 - 20.11].
|
||||
|
||||
With respect to (1), we identified Genode's custom tooling (build
|
||||
system, run scripts, ports mechanism, depot tools) as a point of
|
||||
friction. They are arguably powerful and flexible but require a lot of
|
||||
up-front learning. This is certainly a burden unacceptable for a casual
|
||||
developer without a black belt in Make and Expect/Tcl. The new
|
||||
[https://genode.org/documentation/release-notes/19.11#New_tooling_for_bridging_existing_build_systems_with_Genode - Goa]
|
||||
tool rearranges the existing tools in a way that puts the concerns of casual
|
||||
developers into focus, allowing for the use of commodity build systems,
|
||||
eliminating Tcl syntax from the equation, running sub-second test cycles, and
|
||||
streamlining the packaging of software.
|
||||
The UI improvements of Sculpt OS in version 20.02 largely eliminated the need
|
||||
to use the command line as presented
|
||||
[https://www.youtube.com/watch?v=vmgWgzeKAjU - here].
|
||||
The second direction - software quality - motivated the steady improvements of
|
||||
our POSIX runtime, ultimately enabling highly sophisticated workloads like the
|
||||
Chromium web engine on Genode. Regarding our stated commitment to 64-bit ARM
|
||||
hardware, in particular supporting the NXP i.MX8 SoC, we covered 64-bit
|
||||
multi-core virtualization, HDMI, touch input, OLED, networking, LTE, USB,
|
||||
clock and power management, VirtIO, up to running Sculpt OS on this platform.
|
||||
|
||||
On account of (2), we
|
||||
[https://genode.org/documentation/release-notes/19.05#Broadened_CPU_architecture_support_and_updated_tool_chain - switched to C++17]
|
||||
by default, fostered the use of
|
||||
[https://genodians.org/ssumpf/2019-02-27-java-19-02 - Java],
|
||||
updated Qt5, and put
|
||||
[https://genode.org/documentation/release-notes/19.11#C_runtime_with_improved_POSIX_compatibility - POSIX]
|
||||
compatibility into the spotlight. We were eventually able to dissolve the need
|
||||
for our custom Unix runtime (Noux) because all features of Noux are covered by
|
||||
our regular libc now.
|
||||
|
||||
Our biggest step towards (3) is the [https://genodians.org] website we
|
||||
started in winter 2019, which gives individual members of our community
|
||||
an easy way to present thoughts, projects, and experiences.
|
||||
Complementing Genode's formal documentation, it also conserves practical
|
||||
tips and tricks that were previously not covered in written form.
|
||||
|
||||
When speaking of "bridging worlds", we should not forget to mention the
|
||||
tremendous effort to bring Sculpt-OS-like workloads to the 64-bit ARM world.
|
||||
Thanks to the added support for
|
||||
[https://genode.org/documentation/release-notes/19.08#64-bit_ARM_and_NXP_i.MX8 - multi-core AARCH64],
|
||||
hardware-based
|
||||
[https://genode.org/documentation/release-notes/19.11#Virtualization_of_64-bit_ARM_platforms - virtualization],
|
||||
and network/USB/graphics drivers for the i.MX8 SoC, the flexibility of Sculpt
|
||||
OS will eventually become available on PC hardware and ARM-based devices
|
||||
alike.
|
||||
|
||||
Over the course of 2019, we admittedly skipped a few topics originally
|
||||
mentioned on our road map. In particular, the user-visible side of
|
||||
Sculpt OS received less attention than originally envisioned. We also
|
||||
deferred several ideas we had in mind about reworking our GUI stack.
|
||||
Instead, we expanded our work in the areas of storage (block-level APIs,
|
||||
test infrastructure,
|
||||
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - block encryption])
|
||||
and
|
||||
[https://genode.org/documentation/release-notes/19.08#Flexible_keyboard_layouts - input processing].
|
||||
This shift of focus is mostly attributed to the priorities of Genode Labs'
|
||||
customers who fund our work.
|
||||
Granted, Genode's audience hasn't increased by a large margin as a direct
|
||||
result of these efforts. But as illustrated by the fruitful road-map
|
||||
discussion for 2021 on the
|
||||
[https://genode.org/community/mailing-lists - mailing list],
|
||||
our community is more engaged and enthusiastic than ever before.
|
||||
|
||||
|
||||
2020 - Dwarfing the barrier of entry
|
||||
####################################
|
||||
2021 - Optimization and Platform diversity
|
||||
##########################################
|
||||
|
||||
Genode as a technology is there. For more than one decade, we walked unfathomed
|
||||
territory, fought with countless deep rabbit holes, took risky decisions,
|
||||
tracked back, explored design spaces, developed taste and distaste, pruned
|
||||
technical debt, and eventually found formulas of success. Today, there are no
|
||||
(fundamental) unsolved questions. All the puzzle pieces are in place. There
|
||||
could be no better proof than our daily use of Sculpt OS. The time is right
|
||||
to make Genode palatable for a wider circle. We identified four actionable
|
||||
topics to achieve that.
|
||||
For the initial conquering of 64-bit ARM territory, restraining our focus to
|
||||
one particular SoC - namely NXP i.MX8 - was a healthy approach. Now it is the
|
||||
right time to optimize and to branch out the development to further
|
||||
platforms. The following key aspects of our road map for 2021 reflect that.
|
||||
|
||||
:User friendliness of Sculpt OS:
|
||||
:Pinephone:
|
||||
By the end of the year, we want be able to use Genode on the
|
||||
[https://pine64.com/product-category/pinephone/ - Pinephone]
|
||||
as a feature phone, covering basic web-browsing needs, placing calls, and
|
||||
SMS.
|
||||
|
||||
Until now, Sculpt OS is not exactly friendly towards users who are
|
||||
unfamiliar with the Unix command-line tools. Since Sculpt is not Unix
|
||||
based, this is a bit paradoxical. 2020 will give Sculpt OS a friendlier
|
||||
and discoverable user experience. In this context, we will inevitably
|
||||
put our attention to Genode's GUI stack.
|
||||
:Linux-device-driver environment re-imagined:
|
||||
We are convinced that we have to dramatically reduce the engineering
|
||||
effort needed to port device drivers from the Linux kernel to Genode. With
|
||||
many years of driver-porting experience under our belts, we plan to condense
|
||||
the lessons learned in the form of new tooling and documentation. This, in
|
||||
turn, will hopefully pave the ground for more and more developers
|
||||
contributing to Genode's device-driver coverage in the future.
|
||||
|
||||
:Perception of high quality:
|
||||
:Developer experience:
|
||||
Speaking of new developers, we see Genode's existing tool set as a barrier
|
||||
because it requires a rather steep learning curve. Hence, this year, we will
|
||||
have a fresh take on tooling and workflows. The starting point will be the
|
||||
experimental [https://github.com/nfeske/goa - Goa] tool, which in principle
|
||||
allows developers to use familiar build systems for Genode development. We
|
||||
plan to extend Goa to cover more build systems, and shape the tool towards
|
||||
system-integration tasks and quick compile-test cycles targeting embedded
|
||||
devices.
|
||||
|
||||
Compared to commodity operating systems who stood the test of time,
|
||||
Genode is a young and largely unproven technology. It understandably calls
|
||||
for skepticism. All the more we must leave no doubts about our high
|
||||
quality standards. There must be no room for uncertainty. Hence, during
|
||||
2020, we will intensify the consolidation and optimization of the framework
|
||||
and its API, and talk about it.
|
||||
:Optimization:
|
||||
Motivated by usage scenarios like the Pinephone, we are eager to tap into
|
||||
plenty of opportunities for optimization. Based on data gathered by improved
|
||||
system tracing, we consider interface refinements to improve the batching of
|
||||
I/O (file-system access, networking), micro-optimizations of hot code paths
|
||||
(like TLS lookup, parsers, and allocators), as well as structural changes
|
||||
(like the consolidation of low-level services).
|
||||
|
||||
:Enjoyable tooling:
|
||||
|
||||
Genode's success at large will depend on developers. As of today, software
|
||||
development for Genode requires a huge up-front learning curve. This is
|
||||
fine for people who are already convinced of Genode. But it unacceptable
|
||||
for casual developers who want to get their toes wet. We should aim for
|
||||
tooling that allows new developers to keep up their flow and beloved
|
||||
tools. The recently introduced [https://genodians.org/nfeske/2019-11-25-goa - Goa]
|
||||
tooling is our first take in this respect. It is certainly too early to call
|
||||
Goa a success. In order to find out if we are on the right track, we want to
|
||||
expose Goa to as many problems as possible, primarily by the means of
|
||||
porting software. Also, things like IDE usage or adapters for a variety of
|
||||
build systems will certainly move into focus in 2020.
|
||||
|
||||
:Convincing use cases:
|
||||
|
||||
Use cases can give exemplary proof of the fitness of Genode. We already
|
||||
took a few baby steps to extend the range of documented use cases beyond
|
||||
Sculpt OS last year. The boot2java scenenario comes in mind. 2020 will
|
||||
hopefully see several more illustrations of Genode's versatility.
|
||||
:GPU support:
|
||||
Distantly related to optimization, GPU support is an increasingly requested
|
||||
feature. We already
|
||||
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - wetted our toes]
|
||||
in the past. But GPU support has not yet become routinely supported in
|
||||
system scenarios like Sculpt OS. In 2021, we want to change that, making GPU
|
||||
support a feature that can be relied on. We will primarily address Intel
|
||||
graphics first but also explore GPUs on ARM-based devices.
|
||||
|
||||
|
||||
Apart from this overall theme, we plan to continue our commitment to the
|
||||
NXP i.MX SoC family, revisit Genode's low-latency audio support, and
|
||||
extend the cultivation of Ada/SPARK within (and on top of) Genode.
|
||||
|
||||
|
||||
Milestones for 2020
|
||||
Milestones for 2021
|
||||
###################
|
||||
|
||||
In the following, we present a rough schedule of the planned work. As usual,
|
||||
@@ -136,64 +107,65 @@ it is not set in stone. If you are interested in a particular line of work,
|
||||
please get in touch.
|
||||
|
||||
|
||||
February - Release 20.02
|
||||
February - Release 21.02
|
||||
========================
|
||||
|
||||
* Consolidation: removal of the Noux runtime
|
||||
* Library version of the init component
|
||||
* Updated audio drivers
|
||||
* Sculpt
|
||||
* 64-bit ARM (i.MX8)
|
||||
* Revised administrative user interface
|
||||
* System image without Unix tools
|
||||
* Pluggable device drivers (NIC, WLAN, framebuffer, input)
|
||||
* VirtualBox 6
|
||||
* Sculpt: basic UI for the consistent block encrypter (CBE)
|
||||
* 64-bit ARM
|
||||
* VirtIO block-device support for virtual machines
|
||||
* Base platform support for the Pine A64 board (kernel base framework)
|
||||
|
||||
|
||||
May - Release 20.05
|
||||
May - Release 21.05
|
||||
===================
|
||||
|
||||
* Updated "Genode Foundations" book
|
||||
* Consolidation
|
||||
* Block-level components (update to Genode's modern block APIs)
|
||||
* ARM device drivers (introducing the notion of a platform driver)
|
||||
* Improved STL support (e.g., threading and mutexes)
|
||||
* Continuous POSIX-compliance testing
|
||||
* Systematic network-stack stress and performance tests
|
||||
* Desktop: panel and virtual desktops
|
||||
* Use case: Genode-based network router
|
||||
* Goa: broadened support for 3rd-party build systems
|
||||
* Native tool chain, including Git
|
||||
* Sculpt
|
||||
* Interactive device management
|
||||
* Keyboard-controlled administration
|
||||
* Support for BSPs maintained outside of Genode's mainline repository
|
||||
* Annual documentation update, including the "Genode Foundations" book
|
||||
* GPU support
|
||||
* MESA update
|
||||
* Experiments on ARM (e.g., Vivante on i.MX8, or Mali-400 on A64)
|
||||
* Sculpt OS on Pine A64 (USB, input, framebuffer, SD-card, networking)
|
||||
* 64-bit ARM
|
||||
* Platform-driver consolidation between ARM and x86
|
||||
* PCI-express support for MNT Reform (i.MX8)
|
||||
* Tool-chain update (e.g., switching to hard-float on ARM)
|
||||
* Modernized client-side NIC and uplink APIs
|
||||
* Goa
|
||||
* Broadened architecture support and testing workflow
|
||||
* API projects
|
||||
* Inter-project dependencies
|
||||
|
||||
|
||||
August - Release 20.08
|
||||
August - Release 21.08
|
||||
======================
|
||||
|
||||
* Revisited GUI-related framework interfaces
|
||||
* Extended tooling for performance monitoring
|
||||
* Goa: Qt development workflow
|
||||
* Desktop
|
||||
* Native mail client
|
||||
* Native web browser
|
||||
* Sculpt
|
||||
* Configurable CPU resources
|
||||
* On-screen documentation
|
||||
* Block encryption via our
|
||||
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - consistent block encrypter]
|
||||
implemented in Ada/SPARK
|
||||
* USB audio
|
||||
* Initial version of a kernel implemented in Ada/SPARK
|
||||
* Linux DDE re-imagined
|
||||
* Improved tooling
|
||||
* Exploring Goa-based development workflow
|
||||
* GPU support
|
||||
* GPU multiplexer for Intel Gen9 graphics
|
||||
* Harmonization of GPU driver with Intel framebuffer driver
|
||||
* Initial version of a custom kernel (Spunky) implemented in Ada/SPARK
|
||||
* System-level tracing infrastructure for guiding and validating optimizations
|
||||
* Pinephone
|
||||
* Touchscreen and display
|
||||
* Mobile web browser
|
||||
* Goa
|
||||
* CMake-based Qt5 applications
|
||||
* QML-based applications
|
||||
|
||||
|
||||
November - Release 20.11
|
||||
November - Release 21.11
|
||||
========================
|
||||
|
||||
* Consolidation of capability-space management across kernels
|
||||
* CPU-load balancing
|
||||
* Hardware-accelerated graphics on i.MX8 (experimental)
|
||||
* Reworked audio stack (interfaces, mixing)
|
||||
* Sculpt: component lifetime management, shutdown protocol
|
||||
* VFS plugins for lwext4 and FUSE-based file systems
|
||||
* Pinephone
|
||||
* Mobile data connectivity (LTE)
|
||||
* Phone calls (audio)
|
||||
* SMS
|
||||
* seL4
|
||||
* Update to current kernel version, MCS scheduling
|
||||
* Combining CAmkES with Genode
|
||||
* SMMU (I/O-MMU for ARM) support for our custom (base-hw) kernel
|
||||
* Multi-monitor support
|
||||
|
||||
|
||||
10
repos/README
10
repos/README
@@ -31,33 +31,25 @@ but build upon of each other:
|
||||
|
||||
:'nova':
|
||||
NOVA hypervisor developed at University of Technology Dresden
|
||||
See [https://genode.org/documentation/platforms/nova]
|
||||
|
||||
:'foc':
|
||||
Fiasco.OC is a modernized version of the Fiasco microkernel with a
|
||||
completely revised kernel interface fostering capability-based
|
||||
security. It is not compatible with L4/Fiasco.
|
||||
See [https://genode.org/documentation/platforms/foc]
|
||||
|
||||
:'hw':
|
||||
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 except in the special case of the Muen separation
|
||||
kernel.
|
||||
See [https://genode.org/documentation/platforms/hw] and
|
||||
[https://genode.org/documentation/platforms/muen]
|
||||
included in core.
|
||||
|
||||
:'okl4':
|
||||
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
|
||||
See [https://genode.org/documentation/platforms/okl4]
|
||||
|
||||
:'pistachio':
|
||||
L4ka::Pistachio kernel developed at University of Karlsruhe.
|
||||
See [https://genode.org/documentation/platforms/pistachio]
|
||||
|
||||
:'fiasco':
|
||||
L4/Fiasco kernel developed at University of Technology Dresden.
|
||||
See [https://genode.org/documentation/platforms/fiasco]
|
||||
|
||||
:'sel4':
|
||||
seL4 microkernel developed at NICTA/General Dynamics
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
This repository contains the L4/Fiasco-specific implementation of Genode.
|
||||
|
||||
For instructions to build and start the Fiasco version of Genode, please
|
||||
consult the documentation located at 'base-fiasco/doc/fiasco.txt'.
|
||||
|
||||
@@ -1 +1 @@
|
||||
SPECS += fiasco x86_32
|
||||
SPECS += fiasco
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-11-26 054bb0a83a4a6b5bec210f87a20359f6dceba4ad
|
||||
2021-03-11 d5d038d82badefdb0ec442be4dc7b23064ad2831
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
/* core includes */
|
||||
#include <core_log.h>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/kdebug.h>
|
||||
}
|
||||
void Genode::Core_log::out(char const c) { Fiasco::outchar(c); }
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
void Core_log::out(char const c) { Fiasco::outchar(c); }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
LIBS := core-fiasco
|
||||
CORE_OBJ := core-fiasco.o
|
||||
CORE_LIB := core-fiasco.a
|
||||
|
||||
include $(BASE_DIR)/src/core/target.inc
|
||||
|
||||
@@ -27,154 +27,153 @@
|
||||
/* core includes */
|
||||
#include <util.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Mapping
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _dst_addr;
|
||||
Fiasco::l4_fpage_t _fpage;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||
Cache_attribute cacheability, bool,
|
||||
unsigned l2size, bool rw, bool)
|
||||
:
|
||||
_dst_addr(dst_addr),
|
||||
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
|
||||
{
|
||||
if (cacheability == WRITE_COMBINED)
|
||||
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct invalid flexpage
|
||||
*/
|
||||
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
|
||||
|
||||
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
|
||||
Fiasco::l4_fpage_t fpage() const { return _fpage; }
|
||||
|
||||
/**
|
||||
* Prepare map operation
|
||||
*
|
||||
* On Fiasco, we need to map a page locally to be able to map it to
|
||||
* another address space.
|
||||
*/
|
||||
void prepare_map_operation()
|
||||
{
|
||||
addr_t core_local_addr = _fpage.fp.page << 12;
|
||||
size_t mapping_size = 1 << _fpage.fp.size;
|
||||
|
||||
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
|
||||
if (_fpage.fp.write)
|
||||
touch_read_write((unsigned char volatile *)(core_local_addr + i));
|
||||
else
|
||||
touch_read((unsigned char const volatile *)(core_local_addr + i));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Special paging server class
|
||||
*/
|
||||
class Ipc_pager
|
||||
{
|
||||
private:
|
||||
|
||||
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
|
||||
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
|
||||
Mapping _reply_mapping { }; /* page-fault answer */
|
||||
|
||||
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
|
||||
*
|
||||
* Send short flex page and wait for next short-message (register)
|
||||
* IPC -- pagefault
|
||||
*/
|
||||
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 & ~3; }
|
||||
|
||||
/**
|
||||
* 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.raw = pager_object.local_name(); }
|
||||
|
||||
/**
|
||||
* Answer call without sending a flex-page 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()
|
||||
{
|
||||
enum { CORE_TASK_ID = 4 };
|
||||
return _last.id.task == CORE_TASK_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return badge for faulting thread
|
||||
*
|
||||
* As Fiasco has no server-defined badges for page-fault messages, we
|
||||
* interpret the sender ID as badge.
|
||||
*/
|
||||
unsigned long badge() const {
|
||||
return convert_native_thread_id_to_badge(_last); }
|
||||
|
||||
bool write_fault() const { return (_pf_addr & 2); }
|
||||
|
||||
bool exec_fault() const { return false; }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* Reflection of exceptions is not supported on this platform.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
};
|
||||
class Mapping;
|
||||
class Ipc_pager;
|
||||
}
|
||||
|
||||
|
||||
class Genode::Mapping
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _dst_addr;
|
||||
Fiasco::l4_fpage_t _fpage;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||
Cache_attribute cacheability, bool,
|
||||
unsigned l2size, bool rw, bool)
|
||||
:
|
||||
_dst_addr(dst_addr),
|
||||
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
|
||||
{
|
||||
if (cacheability == WRITE_COMBINED)
|
||||
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct invalid flexpage
|
||||
*/
|
||||
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
|
||||
|
||||
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
|
||||
Fiasco::l4_fpage_t fpage() const { return _fpage; }
|
||||
|
||||
/**
|
||||
* Prepare map operation
|
||||
*
|
||||
* On Fiasco, we need to map a page locally to be able to map it to
|
||||
* another address space.
|
||||
*/
|
||||
void prepare_map_operation()
|
||||
{
|
||||
addr_t core_local_addr = _fpage.fp.page << 12;
|
||||
size_t mapping_size = 1 << _fpage.fp.size;
|
||||
|
||||
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
|
||||
if (_fpage.fp.write)
|
||||
touch_read_write((unsigned char volatile *)(core_local_addr + i));
|
||||
else
|
||||
touch_read((unsigned char const volatile *)(core_local_addr + i));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Genode::Ipc_pager
|
||||
{
|
||||
private:
|
||||
|
||||
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
|
||||
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
|
||||
Mapping _reply_mapping { }; /* page-fault answer */
|
||||
|
||||
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
|
||||
*
|
||||
* Send short flex page and wait for next short-message (register)
|
||||
* IPC -- pagefault
|
||||
*/
|
||||
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 & ~3; }
|
||||
|
||||
/**
|
||||
* 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.raw = pager_object.local_name(); }
|
||||
|
||||
/**
|
||||
* Answer call without sending a flex-page 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()
|
||||
{
|
||||
enum { CORE_TASK_ID = 4 };
|
||||
return _last.id.task == CORE_TASK_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return badge for faulting thread
|
||||
*
|
||||
* As Fiasco has no server-defined badges for page-fault messages, we
|
||||
* interpret the sender ID as badge.
|
||||
*/
|
||||
unsigned long badge() const {
|
||||
return convert_native_thread_id_to_badge(_last); }
|
||||
|
||||
bool write_fault() const { return (_pf_addr & 2); }
|
||||
|
||||
bool exec_fault() const { return false; }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* Reflection of exceptions is not supported on this platform.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__IPC_PAGER_H_ */
|
||||
|
||||
@@ -18,12 +18,8 @@
|
||||
#include <platform.h>
|
||||
#include <util.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sys/kdebug.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
#ifndef _CORE__INCLUDE__PLATFORM_H_
|
||||
#define _CORE__INCLUDE__PLATFORM_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/allocator_avl.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/capability_space.h>
|
||||
|
||||
/* core includes */
|
||||
#include <synced_range_allocator.h>
|
||||
#include <platform_generic.h>
|
||||
#include <platform_thread.h>
|
||||
@@ -25,150 +29,149 @@
|
||||
#include <boot_modules.h>
|
||||
#include <assertion.h>
|
||||
|
||||
namespace Genode { class Platform; }
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform : public Platform_generic
|
||||
{
|
||||
private:
|
||||
class Genode::Platform : public Platform_generic
|
||||
{
|
||||
private:
|
||||
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Platform(Platform const &);
|
||||
Platform &operator = (Platform const &);
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Platform(Platform const &);
|
||||
Platform &operator = (Platform const &);
|
||||
|
||||
/*
|
||||
* Shortcut for the type of allocator instances for physical resources
|
||||
*/
|
||||
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
|
||||
/*
|
||||
* Shortcut for the type of allocator instances for physical resources
|
||||
*/
|
||||
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
|
||||
|
||||
char _core_label[1]; /* to satisfy _core_pd */
|
||||
Platform_pd *_core_pd = nullptr; /* core protection domain object */
|
||||
Phys_allocator _ram_alloc; /* RAM allocator */
|
||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
||||
Phys_allocator _irq_alloc; /* IRQ allocator */
|
||||
Phys_allocator _region_alloc; /* virtual memory allocator for core */
|
||||
Rom_fs _rom_fs { }; /* ROM file system */
|
||||
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
|
||||
char _core_label[1]; /* to satisfy _core_pd */
|
||||
Platform_pd *_core_pd = nullptr; /* core protection domain object */
|
||||
Phys_allocator _ram_alloc; /* RAM allocator */
|
||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
||||
Phys_allocator _irq_alloc; /* IRQ allocator */
|
||||
Phys_allocator _region_alloc; /* virtual memory allocator for core */
|
||||
Rom_fs _rom_fs { }; /* ROM file system */
|
||||
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
|
||||
|
||||
addr_t _vm_start = 0; /* begin of virtual memory */
|
||||
size_t _vm_size = 0; /* size of virtual memory */
|
||||
addr_t _vm_start = 0; /* begin of virtual memory */
|
||||
size_t _vm_size = 0; /* size of virtual memory */
|
||||
|
||||
/*
|
||||
* We do not export any boot module loaded before FIRST_ROM.
|
||||
*/
|
||||
enum { FIRST_ROM = 3 };
|
||||
/*
|
||||
* We do not export any boot module loaded before FIRST_ROM.
|
||||
*/
|
||||
enum { FIRST_ROM = 3 };
|
||||
|
||||
/**
|
||||
* Setup base resources
|
||||
*
|
||||
* - Map and provide KIP as ROM module
|
||||
* - Initializes region allocator
|
||||
*/
|
||||
void _setup_basics();
|
||||
/**
|
||||
* Setup base resources
|
||||
*
|
||||
* - Map and provide KIP as ROM module
|
||||
* - Initializes region allocator
|
||||
*/
|
||||
void _setup_basics();
|
||||
|
||||
/**
|
||||
* Setup RAM, IO_MEM, and region allocators
|
||||
*/
|
||||
void _setup_mem_alloc();
|
||||
/**
|
||||
* Setup RAM, IO_MEM, and region allocators
|
||||
*/
|
||||
void _setup_mem_alloc();
|
||||
|
||||
/**
|
||||
* Setup I/O port space allocator
|
||||
*/
|
||||
void _setup_io_port_alloc();
|
||||
/**
|
||||
* Setup I/O port space allocator
|
||||
*/
|
||||
void _setup_io_port_alloc();
|
||||
|
||||
/**
|
||||
* Setup IRQ allocator
|
||||
*/
|
||||
void _setup_irq_alloc();
|
||||
/**
|
||||
* Setup IRQ allocator
|
||||
*/
|
||||
void _setup_irq_alloc();
|
||||
|
||||
/**
|
||||
* Parse multi-boot information and update ROM database
|
||||
*/
|
||||
void _init_rom_modules();
|
||||
/**
|
||||
* Parse multi-boot information and update ROM database
|
||||
*/
|
||||
void _init_rom_modules();
|
||||
|
||||
/**
|
||||
* Setup pager for core-internal threads
|
||||
*/
|
||||
void _setup_core_pager();
|
||||
/**
|
||||
* Setup pager for core-internal threads
|
||||
*/
|
||||
void _setup_core_pager();
|
||||
|
||||
addr_t _rom_module_phys(addr_t virt) { return virt; }
|
||||
addr_t _rom_module_phys(addr_t virt) { return virt; }
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Pager object representing the pager of core namely sigma0
|
||||
*/
|
||||
struct Sigma0 : public Pager_object
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Sigma0();
|
||||
|
||||
int pager(Ipc_pager &) override { /* never called */ return -1; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Return singleton instance of Sigma0 pager object
|
||||
*/
|
||||
static Sigma0 &sigma0();
|
||||
|
||||
/**
|
||||
* Core pager thread that handles core-internal page-faults
|
||||
*/
|
||||
struct Core_pager : public Platform_thread, public Pager_object
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Core_pager(Platform_pd &core_pd);
|
||||
|
||||
int pager(Ipc_pager &) override { /* never called */ return -1; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Return singleton instance of core pager object
|
||||
*/
|
||||
Core_pager &core_pager();
|
||||
public:
|
||||
|
||||
/**
|
||||
* Pager object representing the pager of core namely sigma0
|
||||
*/
|
||||
struct Sigma0 : public Pager_object
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform();
|
||||
Sigma0();
|
||||
|
||||
int pager(Ipc_pager &) override { /* never called */ return -1; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Return singleton instance of Sigma0 pager object
|
||||
*/
|
||||
static Sigma0 &sigma0();
|
||||
|
||||
/**
|
||||
* Core pager thread that handles core-internal page-faults
|
||||
*/
|
||||
struct Core_pager : public Platform_thread, public Pager_object
|
||||
{
|
||||
/**
|
||||
* Accessor for core pd object
|
||||
* Constructor
|
||||
*/
|
||||
Platform_pd &core_pd()
|
||||
{
|
||||
if (_core_pd)
|
||||
return *_core_pd;
|
||||
Core_pager(Platform_pd &core_pd);
|
||||
|
||||
ASSERT_NEVER_CALLED;
|
||||
}
|
||||
int pager(Ipc_pager &) override { /* never called */ return -1; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Return singleton instance of core pager object
|
||||
*/
|
||||
Core_pager &core_pager();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform();
|
||||
|
||||
/**
|
||||
* Accessor for core pd object
|
||||
*/
|
||||
Platform_pd &core_pd()
|
||||
{
|
||||
if (_core_pd)
|
||||
return *_core_pd;
|
||||
|
||||
ASSERT_NEVER_CALLED;
|
||||
}
|
||||
|
||||
|
||||
/********************************
|
||||
** Generic platform interface **
|
||||
********************************/
|
||||
/********************************
|
||||
** Generic platform interface **
|
||||
********************************/
|
||||
|
||||
Range_allocator &core_mem_alloc() override { return _ram_alloc; }
|
||||
Range_allocator &ram_alloc() override { return _ram_alloc; }
|
||||
Range_allocator &io_mem_alloc() override { return _io_mem_alloc; }
|
||||
Range_allocator &io_port_alloc() override { return _io_port_alloc; }
|
||||
Range_allocator &irq_alloc() override { return _irq_alloc; }
|
||||
Range_allocator ®ion_alloc() override { return _region_alloc; }
|
||||
addr_t vm_start() const override { return _vm_start; }
|
||||
size_t vm_size() const override { return _vm_size; }
|
||||
Rom_fs &rom_fs() override { return _rom_fs; }
|
||||
Range_allocator &core_mem_alloc() override { return _ram_alloc; }
|
||||
Range_allocator &ram_alloc() override { return _ram_alloc; }
|
||||
Range_allocator &io_mem_alloc() override { return _io_mem_alloc; }
|
||||
Range_allocator &io_port_alloc() override { return _io_port_alloc; }
|
||||
Range_allocator &irq_alloc() override { return _irq_alloc; }
|
||||
Range_allocator ®ion_alloc() override { return _region_alloc; }
|
||||
addr_t vm_start() const override { return _vm_start; }
|
||||
size_t vm_size() const override { return _vm_size; }
|
||||
Rom_fs &rom_fs() override { return _rom_fs; }
|
||||
|
||||
size_t max_caps() const override { return Capability_space::max_caps(); }
|
||||
size_t max_caps() const override { return Capability_space::max_caps(); }
|
||||
|
||||
void wait_for_exit() override;
|
||||
};
|
||||
}
|
||||
void wait_for_exit() override;
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__PLATFORM_H_ */
|
||||
|
||||
@@ -17,188 +17,193 @@
|
||||
#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>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_thread;
|
||||
class Platform_pd : public Address_space
|
||||
{
|
||||
private:
|
||||
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Platform_pd(Platform_pd const &);
|
||||
Platform_pd &operator = (Platform_pd const &);
|
||||
|
||||
enum {
|
||||
VERSION_BITS = 10,
|
||||
PD_FIRST = 0x10,
|
||||
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
|
||||
PD_VERSION_MAX = (1 << 10) - 1,
|
||||
PD_INVALID = -1,
|
||||
THREAD_MAX = (1 << 7),
|
||||
};
|
||||
|
||||
unsigned _pd_id = 0;
|
||||
unsigned _version = 0;
|
||||
|
||||
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
|
||||
|
||||
|
||||
/**********************************************
|
||||
** Threads of this protection domain object **
|
||||
**********************************************/
|
||||
|
||||
Platform_thread *_threads[THREAD_MAX];
|
||||
|
||||
/**
|
||||
* Initialize thread allocator
|
||||
*/
|
||||
void _init_threads();
|
||||
|
||||
/**
|
||||
* Thread iteration for one task
|
||||
*/
|
||||
Platform_thread *_next_thread();
|
||||
|
||||
/**
|
||||
* Thread allocation
|
||||
*
|
||||
* Again a special case for Core thread0.
|
||||
*/
|
||||
int _alloc_thread(int thread_id, Platform_thread &thread);
|
||||
|
||||
/**
|
||||
* Thread deallocation
|
||||
*
|
||||
* No special case for Core thread0 here - we just never call it.
|
||||
*/
|
||||
void _free_thread(int thread_id);
|
||||
|
||||
|
||||
/******************
|
||||
** PD allocator **
|
||||
******************/
|
||||
|
||||
struct Pd_alloc
|
||||
{
|
||||
unsigned reserved : 1;
|
||||
unsigned free : 1;
|
||||
unsigned version : VERSION_BITS;
|
||||
|
||||
Pd_alloc(bool r, bool f, unsigned v)
|
||||
: reserved(r), free(f), version(v) { }
|
||||
|
||||
Pd_alloc() : reserved(0), free(0), version(0) { }
|
||||
};
|
||||
|
||||
static Pd_alloc *_pds()
|
||||
{
|
||||
static Pd_alloc static_pds[PD_MAX];
|
||||
return static_pds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection-domain creation
|
||||
*
|
||||
* The syscall parameter propagates if any L4 kernel function
|
||||
* should be used. We need the special case for the Core startup.
|
||||
*/
|
||||
void _create_pd(bool syscall);
|
||||
|
||||
/**
|
||||
* Protection domain destruction
|
||||
*
|
||||
* No special case for Core here - we just never call it.
|
||||
*/
|
||||
void _destroy_pd();
|
||||
|
||||
/**
|
||||
* Protection domain allocation
|
||||
*
|
||||
* Find free L4 task and use it. We need the special case for Core
|
||||
* startup.
|
||||
*/
|
||||
int _alloc_pd(signed pd_id);
|
||||
|
||||
/**
|
||||
* Protection domain deallocation
|
||||
*
|
||||
* No special case for Core here - we just never call it.
|
||||
*/
|
||||
void _free_pd();
|
||||
|
||||
|
||||
/***************
|
||||
** Debugging **
|
||||
***************/
|
||||
|
||||
void _debug_log_pds(void);
|
||||
void _debug_log_threads(void);
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_pd(Allocator &md_alloc, char const *name);
|
||||
|
||||
/**
|
||||
* Constructor used for core's PD
|
||||
*/
|
||||
Platform_pd(char const *name, signed pd_id);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Platform_pd();
|
||||
|
||||
/**
|
||||
* Register quota donation at allocator guard
|
||||
*/
|
||||
void upgrade_ram_quota(size_t) { }
|
||||
|
||||
/**
|
||||
* Initialize L4 task facility
|
||||
*/
|
||||
static void init();
|
||||
|
||||
/**
|
||||
* Bind thread to protection domain
|
||||
*
|
||||
* \return true on success
|
||||
*/
|
||||
bool 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
|
||||
*/
|
||||
void assign_parent(Native_capability) { }
|
||||
|
||||
int pd_id() const { return _pd_id; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
void flush(addr_t, size_t, Core_local_addr) override;
|
||||
};
|
||||
class Platform_pd;
|
||||
}
|
||||
|
||||
|
||||
class Genode::Platform_pd : public Address_space
|
||||
{
|
||||
private:
|
||||
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Platform_pd(Platform_pd const &);
|
||||
Platform_pd &operator = (Platform_pd const &);
|
||||
|
||||
enum {
|
||||
VERSION_BITS = 10,
|
||||
PD_FIRST = 0x10,
|
||||
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
|
||||
PD_VERSION_MAX = (1 << 10) - 1,
|
||||
PD_INVALID = -1,
|
||||
THREAD_MAX = (1 << 7),
|
||||
};
|
||||
|
||||
unsigned _pd_id = 0;
|
||||
unsigned _version = 0;
|
||||
|
||||
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
|
||||
|
||||
|
||||
/**********************************************
|
||||
** Threads of this protection domain object **
|
||||
**********************************************/
|
||||
|
||||
Platform_thread *_threads[THREAD_MAX];
|
||||
|
||||
/**
|
||||
* Initialize thread allocator
|
||||
*/
|
||||
void _init_threads();
|
||||
|
||||
/**
|
||||
* Thread iteration for one task
|
||||
*/
|
||||
Platform_thread *_next_thread();
|
||||
|
||||
/**
|
||||
* Thread allocation
|
||||
*
|
||||
* Again a special case for Core thread0.
|
||||
*/
|
||||
int _alloc_thread(int thread_id, Platform_thread &thread);
|
||||
|
||||
/**
|
||||
* Thread deallocation
|
||||
*
|
||||
* No special case for Core thread0 here - we just never call it.
|
||||
*/
|
||||
void _free_thread(int thread_id);
|
||||
|
||||
|
||||
/******************
|
||||
** PD allocator **
|
||||
******************/
|
||||
|
||||
struct Pd_alloc
|
||||
{
|
||||
unsigned reserved : 1;
|
||||
unsigned free : 1;
|
||||
unsigned version : VERSION_BITS;
|
||||
|
||||
Pd_alloc(bool r, bool f, unsigned v)
|
||||
: reserved(r), free(f), version(v) { }
|
||||
|
||||
Pd_alloc() : reserved(0), free(0), version(0) { }
|
||||
};
|
||||
|
||||
static Pd_alloc *_pds()
|
||||
{
|
||||
static Pd_alloc static_pds[PD_MAX];
|
||||
return static_pds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection-domain creation
|
||||
*
|
||||
* The syscall parameter propagates if any L4 kernel function
|
||||
* should be used. We need the special case for the Core startup.
|
||||
*/
|
||||
void _create_pd(bool syscall);
|
||||
|
||||
/**
|
||||
* Protection domain destruction
|
||||
*
|
||||
* No special case for Core here - we just never call it.
|
||||
*/
|
||||
void _destroy_pd();
|
||||
|
||||
/**
|
||||
* Protection domain allocation
|
||||
*
|
||||
* Find free L4 task and use it. We need the special case for Core
|
||||
* startup.
|
||||
*/
|
||||
int _alloc_pd(signed pd_id);
|
||||
|
||||
/**
|
||||
* Protection domain deallocation
|
||||
*
|
||||
* No special case for Core here - we just never call it.
|
||||
*/
|
||||
void _free_pd();
|
||||
|
||||
|
||||
/***************
|
||||
** Debugging **
|
||||
***************/
|
||||
|
||||
void _debug_log_pds(void);
|
||||
void _debug_log_threads(void);
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_pd(Allocator &md_alloc, char const *name);
|
||||
|
||||
/**
|
||||
* Constructor used for core's PD
|
||||
*/
|
||||
Platform_pd(char const *name, signed pd_id);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Platform_pd();
|
||||
|
||||
/**
|
||||
* Register quota donation at allocator guard
|
||||
*/
|
||||
void upgrade_ram_quota(size_t) { }
|
||||
|
||||
/**
|
||||
* Initialize L4 task facility
|
||||
*/
|
||||
static void init();
|
||||
|
||||
/**
|
||||
* Bind thread to protection domain
|
||||
*
|
||||
* \return true on success
|
||||
*/
|
||||
bool 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
|
||||
*/
|
||||
void assign_parent(Native_capability) { }
|
||||
|
||||
int pd_id() const { return _pd_id; }
|
||||
|
||||
|
||||
/*****************************
|
||||
** Address-space interface **
|
||||
*****************************/
|
||||
|
||||
void flush(addr_t, size_t, Core_local_addr) override;
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */
|
||||
|
||||
@@ -24,167 +24,169 @@
|
||||
#include <platform_pd.h>
|
||||
#include <assertion.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Platform_pd;
|
||||
class Platform_thread : Interface
|
||||
{
|
||||
private:
|
||||
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Platform_thread(Platform_thread const &);
|
||||
Platform_thread &operator = (Platform_thread const &);
|
||||
|
||||
int _thread_id = THREAD_INVALID; /* plain thread number */
|
||||
|
||||
Fiasco::l4_threadid_t _l4_thread_id;
|
||||
|
||||
typedef String<32> Name;
|
||||
Name const _name; /* thread name that will be
|
||||
registered at the kernel
|
||||
debugger */
|
||||
Platform_pd *_platform_pd = nullptr; /* protection domain thread
|
||||
is bound to */
|
||||
Pager_object *_pager = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
enum {
|
||||
THREAD_INVALID = -1, /* invalid thread number */
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_thread(size_t, const char *name, unsigned priority,
|
||||
Affinity::Location, addr_t utcb);
|
||||
|
||||
/**
|
||||
* Constructor used for core-internal threads
|
||||
*/
|
||||
Platform_thread(const char *name);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Platform_thread();
|
||||
|
||||
/**
|
||||
* Start thread
|
||||
*
|
||||
* \param ip instruction pointer to start at
|
||||
* \param sp stack pointer to use
|
||||
*
|
||||
* \retval 0 successful
|
||||
* \retval -1 thread could not be started
|
||||
*/
|
||||
int start(void *ip, void *sp);
|
||||
|
||||
/**
|
||||
* Pause this thread
|
||||
*/
|
||||
void pause();
|
||||
|
||||
/**
|
||||
* Enable/disable single stepping
|
||||
*/
|
||||
void single_step(bool) { }
|
||||
|
||||
/**
|
||||
* Resume this thread
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* This thread is about to be bound
|
||||
*
|
||||
* \param thread_id local thread ID
|
||||
* \param l4_thread_id final L4 thread ID
|
||||
* \param pd platform pd, thread is bound to
|
||||
*/
|
||||
void bind(int thread_id, Fiasco::l4_threadid_t l4_thread_id,
|
||||
Platform_pd &pd);
|
||||
|
||||
/**
|
||||
* Unbind this thread
|
||||
*/
|
||||
void unbind();
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Set the executing CPU for this thread
|
||||
*
|
||||
* SMP is not supported on L4/Fiasco.
|
||||
*/
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Request the affinity of this thread
|
||||
*/
|
||||
Affinity::Location affinity() const { return Affinity::Location(); }
|
||||
|
||||
/************************
|
||||
** Accessor functions **
|
||||
************************/
|
||||
|
||||
/**
|
||||
* Return/set pager
|
||||
*/
|
||||
Pager_object &pager() const
|
||||
{
|
||||
if (_pager)
|
||||
return *_pager;
|
||||
|
||||
ASSERT_NEVER_CALLED;
|
||||
}
|
||||
|
||||
void pager(Pager_object &pager) { _pager = &pager; }
|
||||
|
||||
/**
|
||||
* Return identification of thread when faulting
|
||||
*/
|
||||
unsigned long pager_object_badge() const {
|
||||
return convert_native_thread_id_to_badge(_l4_thread_id); }
|
||||
|
||||
/**
|
||||
* Set CPU quota of the thread to 'quota'
|
||||
*/
|
||||
void quota(size_t) { /* not supported*/ }
|
||||
|
||||
/**
|
||||
* Return execution time consumed by the thread
|
||||
*/
|
||||
Trace::Execution_time execution_time() const { return { 0, 0 }; }
|
||||
|
||||
|
||||
/*******************************
|
||||
** Fiasco-specific Accessors **
|
||||
*******************************/
|
||||
|
||||
int thread_id() const { return _thread_id; }
|
||||
Fiasco::l4_threadid_t native_thread_id() const { return _l4_thread_id; }
|
||||
Name name() const { return _name; }
|
||||
};
|
||||
class Platform_thread;
|
||||
}
|
||||
|
||||
|
||||
class Genode::Platform_thread : Interface
|
||||
{
|
||||
private:
|
||||
|
||||
/*
|
||||
* Noncopyable
|
||||
*/
|
||||
Platform_thread(Platform_thread const &);
|
||||
Platform_thread &operator = (Platform_thread const &);
|
||||
|
||||
int _thread_id = THREAD_INVALID; /* plain thread number */
|
||||
|
||||
Fiasco::l4_threadid_t _l4_thread_id;
|
||||
|
||||
typedef String<32> Name;
|
||||
Name const _name; /* thread name that will be
|
||||
registered at the kernel
|
||||
debugger */
|
||||
Platform_pd *_platform_pd = nullptr; /* protection domain thread
|
||||
is bound to */
|
||||
Pager_object *_pager = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
enum {
|
||||
THREAD_INVALID = -1, /* invalid thread number */
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Platform_thread(size_t, const char *name, unsigned priority,
|
||||
Affinity::Location, addr_t utcb);
|
||||
|
||||
/**
|
||||
* Constructor used for core-internal threads
|
||||
*/
|
||||
Platform_thread(const char *name);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~Platform_thread();
|
||||
|
||||
/**
|
||||
* Start thread
|
||||
*
|
||||
* \param ip instruction pointer to start at
|
||||
* \param sp stack pointer to use
|
||||
*
|
||||
* \retval 0 successful
|
||||
* \retval -1 thread could not be started
|
||||
*/
|
||||
int start(void *ip, void *sp);
|
||||
|
||||
/**
|
||||
* Pause this thread
|
||||
*/
|
||||
void pause();
|
||||
|
||||
/**
|
||||
* Enable/disable single stepping
|
||||
*/
|
||||
void single_step(bool) { }
|
||||
|
||||
/**
|
||||
* Resume this thread
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* This thread is about to be bound
|
||||
*
|
||||
* \param thread_id local thread ID
|
||||
* \param l4_thread_id final L4 thread ID
|
||||
* \param pd platform pd, thread is bound to
|
||||
*/
|
||||
void bind(int thread_id, Fiasco::l4_threadid_t l4_thread_id,
|
||||
Platform_pd &pd);
|
||||
|
||||
/**
|
||||
* Unbind this thread
|
||||
*/
|
||||
void unbind();
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Set the executing CPU for this thread
|
||||
*
|
||||
* SMP is not supported on L4/Fiasco.
|
||||
*/
|
||||
void affinity(Affinity::Location) { }
|
||||
|
||||
/**
|
||||
* Request the affinity of this thread
|
||||
*/
|
||||
Affinity::Location affinity() const { return Affinity::Location(); }
|
||||
|
||||
|
||||
/************************
|
||||
** Accessor functions **
|
||||
************************/
|
||||
|
||||
/**
|
||||
* Return/set pager
|
||||
*/
|
||||
Pager_object &pager() const
|
||||
{
|
||||
if (_pager)
|
||||
return *_pager;
|
||||
|
||||
ASSERT_NEVER_CALLED;
|
||||
}
|
||||
|
||||
void pager(Pager_object &pager) { _pager = &pager; }
|
||||
|
||||
/**
|
||||
* Return identification of thread when faulting
|
||||
*/
|
||||
unsigned long pager_object_badge() const {
|
||||
return convert_native_thread_id_to_badge(_l4_thread_id); }
|
||||
|
||||
/**
|
||||
* Set CPU quota of the thread to 'quota'
|
||||
*/
|
||||
void quota(size_t) { /* not supported*/ }
|
||||
|
||||
/**
|
||||
* Return execution time consumed by the thread
|
||||
*/
|
||||
Trace::Execution_time execution_time() const { return { 0, 0 }; }
|
||||
|
||||
|
||||
/*******************************
|
||||
** Fiasco-specific Accessors **
|
||||
*******************************/
|
||||
|
||||
int thread_id() const { return _thread_id; }
|
||||
Fiasco::l4_threadid_t native_thread_id() const { return _l4_thread_id; }
|
||||
Name name() const { return _name; }
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */
|
||||
|
||||
@@ -14,11 +14,13 @@
|
||||
#ifndef _CORE__INCLUDE__RPC_CAP_FACTORY_H_
|
||||
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/allocator.h>
|
||||
#include <base/capability.h>
|
||||
|
||||
namespace Genode { class Rpc_cap_factory; }
|
||||
|
||||
|
||||
class Genode::Rpc_cap_factory
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -25,13 +25,8 @@
|
||||
#include <base/internal/fiasco_thread_helper.h>
|
||||
#include <base/internal/page_size.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/kdebug.h>
|
||||
#include <l4/sys/ktrace.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
|
||||
@@ -16,11 +16,8 @@
|
||||
#include <util.h>
|
||||
#include <io_mem_session_component.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
@@ -19,15 +19,12 @@
|
||||
#include <irq_root.h>
|
||||
#include <util.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
bool Irq_object::_associate()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
@@ -74,7 +71,9 @@ void Irq_object::_wait_for_irq()
|
||||
L4_IPC_SHORT_MSG, &dw0, &dw1,
|
||||
L4_IPC_NEVER, &result);
|
||||
|
||||
if (L4_IPC_IS_ERROR(result)) error("Ipc error ", L4_IPC_ERROR(result));
|
||||
if (L4_IPC_IS_ERROR(result))
|
||||
error("Ipc error ", L4_IPC_ERROR(result));
|
||||
|
||||
} while (L4_IPC_IS_ERROR(result));
|
||||
}
|
||||
|
||||
@@ -106,7 +105,7 @@ void Irq_object::entry()
|
||||
if (!_sig_cap.valid())
|
||||
continue;
|
||||
|
||||
Genode::Signal_transmitter(_sig_cap).submit(1);
|
||||
Signal_transmitter(_sig_cap).submit(1);
|
||||
|
||||
_sync_ack.block();
|
||||
}
|
||||
@@ -142,7 +141,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
|
||||
|
||||
Irq_session_component::~Irq_session_component()
|
||||
{
|
||||
error("Not yet implemented.");
|
||||
error(__func__, " - not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -152,13 +151,13 @@ void Irq_session_component::ack_irq()
|
||||
}
|
||||
|
||||
|
||||
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
|
||||
void Irq_session_component::sigh(Signal_context_capability cap)
|
||||
{
|
||||
_irq_object.sigh(cap);
|
||||
}
|
||||
|
||||
|
||||
Genode::Irq_session::Info Irq_session_component::info()
|
||||
Irq_session::Info Irq_session_component::info()
|
||||
{
|
||||
/* no MSI support */
|
||||
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
|
||||
|
||||
@@ -22,10 +22,8 @@
|
||||
#include <base/internal/native_thread.h>
|
||||
#include <base/internal/capability_space_tpl.h>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
@@ -37,7 +35,7 @@ using namespace Fiasco;
|
||||
|
||||
void Ipc_pager::wait_for_fault()
|
||||
{
|
||||
l4_msgdope_t result;
|
||||
l4_msgdope_t result;
|
||||
|
||||
do {
|
||||
l4_ipc_wait(&_last,
|
||||
@@ -53,7 +51,7 @@ void Ipc_pager::wait_for_fault()
|
||||
|
||||
void Ipc_pager::reply_and_wait_for_fault()
|
||||
{
|
||||
l4_msgdope_t result;
|
||||
l4_msgdope_t result;
|
||||
|
||||
l4_ipc_reply_and_wait(_last,
|
||||
L4_IPC_SHORT_FPAGE, _reply_mapping.dst_addr(),
|
||||
|
||||
@@ -17,12 +17,8 @@
|
||||
/* base-internal includes */
|
||||
#include <base/internal/capability_space_tpl.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sys/kdebug.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
@@ -31,17 +31,11 @@
|
||||
#include <platform_pd.h>
|
||||
#include <util.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/kernel.h>
|
||||
#include <l4/sys/kip.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
|
||||
|
||||
/***********************************
|
||||
@@ -54,6 +48,7 @@ static Synced_range_allocator<Allocator_avl> &_core_address_ranges()
|
||||
return _core_address_ranges;
|
||||
}
|
||||
|
||||
|
||||
enum { PAGER_STACK_ELEMENTS = 1024 };
|
||||
static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS];
|
||||
static unsigned _core_pager_arg;
|
||||
@@ -66,8 +61,6 @@ static void _core_pager_loop()
|
||||
{
|
||||
unsigned pd_id = _core_pager_arg;
|
||||
|
||||
using namespace Fiasco;
|
||||
|
||||
l4_threadid_t t;
|
||||
l4_umword_t dw0, dw1;
|
||||
l4_msgdope_t r;
|
||||
@@ -136,7 +129,7 @@ Platform::Sigma0::Sigma0()
|
||||
0, Affinity::Location(), Session_label(),
|
||||
Cpu_session::Name("sigma0"))
|
||||
{
|
||||
cap(Capability_space::import(Fiasco::sigma0_threadid, Rpc_obj_key()));
|
||||
cap(Capability_space::import(sigma0_threadid, Rpc_obj_key()));
|
||||
}
|
||||
|
||||
|
||||
@@ -166,8 +159,6 @@ Platform::Core_pager::Core_pager(Platform_pd &core_pd)
|
||||
void *sp = (void *)&_core_pager_stack[PAGER_STACK_ELEMENTS - 1];
|
||||
start((void *)_core_pager_loop, sp);
|
||||
|
||||
using namespace Fiasco;
|
||||
|
||||
/* pager0 receives pagefaults from me - for NULL pointer detection */
|
||||
l4_umword_t d;
|
||||
l4_threadid_t preempter = L4_INVALID_ID;
|
||||
@@ -236,8 +227,6 @@ static inline void remove_region(Region r, Range_allocator &alloc)
|
||||
*/
|
||||
static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
/* XXX sigma0 always maps pages RW */
|
||||
l4_umword_t req_fpage = l4_fpage(0, log2size, 0, 0).fpage;
|
||||
void* rcv_window = L4_IPC_MAPMSG(0, L4_WHOLE_ADDRESS_SPACE);
|
||||
@@ -246,7 +235,7 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
|
||||
l4_msgdope_t result;
|
||||
l4_msgtag_t tag;
|
||||
|
||||
int err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
|
||||
int err = l4_ipc_call_tag(sigma0_threadid,
|
||||
L4_IPC_SHORT_MSG, SIGMA0_REQ_FPAGE_ANY, req_fpage,
|
||||
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
|
||||
rcv_window, &base, (l4_umword_t *)&rcv_fpage,
|
||||
@@ -288,8 +277,8 @@ void Platform::_setup_mem_alloc()
|
||||
if (!err) {
|
||||
/* XXX do not allocate page0 */
|
||||
if (addr == 0) {
|
||||
Fiasco::l4_fpage_unmap(Fiasco::l4_fpage(0, log2_size, 0, 0),
|
||||
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
|
||||
l4_fpage_unmap(l4_fpage(0, log2_size, 0, 0),
|
||||
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -307,14 +296,14 @@ void Platform::_setup_mem_alloc()
|
||||
}
|
||||
|
||||
|
||||
void Platform::_setup_irq_alloc() {
|
||||
_irq_alloc.add_range(0, 0x10); }
|
||||
|
||||
|
||||
static Fiasco::l4_kernel_info_t *get_kip()
|
||||
void Platform::_setup_irq_alloc()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
_irq_alloc.add_range(0, 0x10);
|
||||
}
|
||||
|
||||
|
||||
static l4_kernel_info_t *get_kip()
|
||||
{
|
||||
static l4_kernel_info_t *kip = nullptr;
|
||||
|
||||
if (kip) return kip;
|
||||
@@ -329,7 +318,7 @@ static Fiasco::l4_kernel_info_t *get_kip()
|
||||
l4_msgdope_t r;
|
||||
l4_msgtag_t tag;
|
||||
|
||||
err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
|
||||
err = l4_ipc_call_tag(sigma0_threadid,
|
||||
L4_IPC_SHORT_MSG, SIGMA0_REQ_KIP, 0,
|
||||
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
|
||||
fpage, &dw0, &dw1,
|
||||
@@ -357,10 +346,9 @@ static Fiasco::l4_kernel_info_t *get_kip()
|
||||
return kip;
|
||||
}
|
||||
|
||||
|
||||
void Platform::_setup_basics()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
l4_kernel_info_t * kip = get_kip();
|
||||
|
||||
/* add KIP as ROM module */
|
||||
@@ -380,6 +368,7 @@ void Platform::_setup_basics()
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (_vm_size == 0)
|
||||
panic("Virtual memory configuration not found");
|
||||
|
||||
@@ -411,7 +400,8 @@ void Platform::_setup_basics()
|
||||
}
|
||||
|
||||
|
||||
Platform::Platform() :
|
||||
Platform::Platform()
|
||||
:
|
||||
_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()),
|
||||
@@ -432,7 +422,7 @@ Platform::Platform() :
|
||||
|
||||
log(_rom_fs);
|
||||
|
||||
Fiasco::l4_threadid_t myself = Fiasco::l4_myself();
|
||||
l4_threadid_t myself = l4_myself();
|
||||
|
||||
Platform_pd::init();
|
||||
|
||||
@@ -451,8 +441,8 @@ Platform::Platform() :
|
||||
_core_pd->bind_thread(core_thread);
|
||||
|
||||
/* we never call _core_thread.start(), so set name directly */
|
||||
Fiasco::fiasco_register_thread_name(core_thread.native_thread_id(),
|
||||
core_thread.name().string());
|
||||
fiasco_register_thread_name(core_thread.native_thread_id(),
|
||||
core_thread.name().string());
|
||||
|
||||
/* core log as ROM module */
|
||||
{
|
||||
|
||||
@@ -25,19 +25,13 @@
|
||||
#include <util.h>
|
||||
#include <platform_pd.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/syscalls.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Fiasco;
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
/**************************
|
||||
** Static class members **
|
||||
**************************/
|
||||
|
||||
static bool _init = false;
|
||||
|
||||
|
||||
@@ -64,10 +58,10 @@ void Platform_pd::init()
|
||||
|
||||
void Platform_pd::_create_pd(bool syscall)
|
||||
{
|
||||
l4_threadid_t l4t = l4_myself();
|
||||
l4t.id.task = _pd_id;
|
||||
l4t.id.lthread = 0;
|
||||
l4t.id.version_low = _version;
|
||||
l4_threadid_t l4t = l4_myself();
|
||||
l4t.id.task = _pd_id;
|
||||
l4t.id.lthread = 0;
|
||||
l4t.id.version_low = _version;
|
||||
|
||||
l4_taskid_t nt;
|
||||
if (syscall)
|
||||
|
||||
@@ -25,13 +25,8 @@
|
||||
/* base-internal includes */
|
||||
#include <base/internal/capability_space_tpl.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/kdebug.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
|
||||
@@ -14,13 +14,18 @@
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* core includes */
|
||||
#include <ram_dataspace_factory.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component &) { }
|
||||
|
||||
|
||||
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component &) { }
|
||||
|
||||
|
||||
void Ram_dataspace_factory::_clear_ds(Dataspace_component &ds)
|
||||
{
|
||||
memset((void *)ds.phys_addr(), 0, ds.size());
|
||||
|
||||
@@ -11,18 +11,20 @@
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/fiasco_thread_helper.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "util.h"
|
||||
/* core includes */
|
||||
#include <platform.h>
|
||||
#include <util.h>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
|
||||
|
||||
void Platform::_setup_io_port_alloc()
|
||||
{
|
||||
l4_fpage_t fp;
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
#ifndef _INCLUDE__FIASCO__THREAD_HELPER_H_
|
||||
#define _INCLUDE__FIASCO__THREAD_HELPER_H_
|
||||
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
|
||||
/**
|
||||
* Sigma0 thread ID
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
#define _INCLUDE__BASE__INTERNAL__LOCK_HELPER_H_
|
||||
|
||||
/* L4/Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
}
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
/* Genode includes */
|
||||
#include <base/stdint.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -28,6 +26,7 @@ namespace Genode {
|
||||
struct Native_thread;
|
||||
}
|
||||
|
||||
|
||||
struct Genode::Native_thread
|
||||
{
|
||||
Fiasco::l4_threadid_t l4id;
|
||||
|
||||
@@ -14,10 +14,8 @@
|
||||
#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_
|
||||
#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/kdebug.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
|
||||
@@ -14,10 +14,8 @@
|
||||
#ifndef _INCLUDE__BASE__INTERNAL__RPC_DESTINATION_H_
|
||||
#define _INCLUDE__BASE__INTERNAL__RPC_DESTINATION_H_
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
|
||||
29
repos/base-fiasco/src/include/fiasco/syscall.h
Normal file
29
repos/base-fiasco/src/include/fiasco/syscall.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* \brief Collection of L4/Fiasco kernel bindings
|
||||
* \author Norman Feske
|
||||
* \date 2020-12-06
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2020 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__FIASCO__SYSCALL_H_
|
||||
#define _INCLUDE__FIASCO__SYSCALL_H_
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/kdebug.h>
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/kernel.h>
|
||||
#include <l4/sys/kip.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/ktrace.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__FIASCO__SYSCALL_H_ */
|
||||
@@ -11,6 +11,7 @@
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/log.h>
|
||||
|
||||
/* base-internal includes */
|
||||
|
||||
@@ -20,13 +20,11 @@
|
||||
#include <base/internal/ipc_server.h>
|
||||
#include <base/internal/capability_space_tpl.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
}
|
||||
/* L4/Fiasco includes */
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Fiasco;
|
||||
|
||||
|
||||
class Msg_header
|
||||
@@ -34,9 +32,9 @@ class Msg_header
|
||||
private:
|
||||
|
||||
/* kernel-defined message header */
|
||||
Fiasco::l4_fpage_t rcv_fpage; /* unused */
|
||||
Fiasco::l4_msgdope_t size_dope;
|
||||
Fiasco::l4_msgdope_t send_dope;
|
||||
l4_fpage_t rcv_fpage; /* unused */
|
||||
l4_msgdope_t size_dope;
|
||||
l4_msgdope_t send_dope;
|
||||
|
||||
public:
|
||||
|
||||
@@ -47,15 +45,15 @@ class Msg_header
|
||||
* arguments. The kernel does not fetch these data words from memory
|
||||
* but transfers them via the short-IPC registers.
|
||||
*/
|
||||
Fiasco::l4_umword_t protocol_word;
|
||||
Fiasco::l4_umword_t num_caps;
|
||||
l4_umword_t protocol_word;
|
||||
l4_umword_t num_caps;
|
||||
|
||||
private:
|
||||
|
||||
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
|
||||
|
||||
Fiasco::l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
|
||||
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
|
||||
l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
|
||||
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
|
||||
|
||||
size_t _num_msg_words(size_t num_data_words) const
|
||||
{
|
||||
@@ -65,7 +63,7 @@ class Msg_header
|
||||
* Account for the transfer of the protocol word, capability count,
|
||||
* and capability arguments in front of the payload.
|
||||
*/
|
||||
return 2 + caps_size/sizeof(Fiasco::l4_umword_t) + num_data_words;
|
||||
return 2 + caps_size/sizeof(l4_umword_t) + num_data_words;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -77,8 +75,6 @@ class Msg_header
|
||||
*/
|
||||
void prepare_snd_msg(unsigned long protocol, Msgbuf_base const &snd_msg)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
protocol_word = protocol;
|
||||
num_caps = min((unsigned)MAX_CAPS_PER_MSG, snd_msg.used_caps());
|
||||
|
||||
@@ -109,8 +105,6 @@ class Msg_header
|
||||
*/
|
||||
void prepare_rcv_msg(Msgbuf_base const &rcv_msg)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
size_t const rcv_max_words = rcv_msg.capacity()/sizeof(l4_umword_t);
|
||||
|
||||
size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words), 0);
|
||||
@@ -124,7 +118,7 @@ class Msg_header
|
||||
for (unsigned i = 0; i < min((unsigned)MAX_CAPS_PER_MSG, num_caps); i++) {
|
||||
|
||||
Rpc_obj_key const rpc_obj_key(_cap_local_name[i]);
|
||||
bool const cap_valid = !Fiasco::l4_is_invalid_id(_cap_tid[i]);
|
||||
bool const cap_valid = !l4_is_invalid_id(_cap_tid[i]);
|
||||
|
||||
Native_capability cap;
|
||||
if (cap_valid) {
|
||||
@@ -147,8 +141,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
Msgbuf_base &snd_msg, Msgbuf_base &rcv_msg,
|
||||
size_t)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
Capability_space::Ipc_cap_data const dst_data =
|
||||
Capability_space::ipc_cap_data(dst);
|
||||
|
||||
@@ -190,8 +182,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
void Genode::ipc_reply(Native_capability caller, Rpc_exception_code exc,
|
||||
Msgbuf_base &snd_msg)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
Msg_header &snd_header = snd_msg.header<Msg_header>();
|
||||
snd_header.prepare_snd_msg(exc.value, snd_msg);
|
||||
|
||||
@@ -209,8 +199,6 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
|
||||
Msgbuf_base &reply_msg,
|
||||
Msgbuf_base &request_msg)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
l4_msgdope_t ipc_result;
|
||||
|
||||
bool need_to_wait = true;
|
||||
@@ -276,7 +264,7 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
|
||||
|
||||
Ipc_server::Ipc_server()
|
||||
:
|
||||
Native_capability(Capability_space::import(Fiasco::l4_myself(), Rpc_obj_key()))
|
||||
Native_capability(Capability_space::import(l4_myself(), Rpc_obj_key()))
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
#include <cpu/memory_barrier.h>
|
||||
|
||||
/* L4/Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
}
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
Lock::Lock(Lock::State initial)
|
||||
: _state(UNLOCKED), _owner(nullptr)
|
||||
:
|
||||
_state(UNLOCKED), _owner(nullptr)
|
||||
{
|
||||
if (initial == LOCKED)
|
||||
lock();
|
||||
@@ -45,7 +44,7 @@ void Lock::lock(Applicant &myself)
|
||||
* XXX: How to notice cancel-blocking signals issued when being outside the
|
||||
* 'l4_ipc_sleep' system call?
|
||||
*/
|
||||
while (!Genode::cmpxchg(&_state, UNLOCKED, LOCKED))
|
||||
while (!cmpxchg(&_state, UNLOCKED, LOCKED))
|
||||
Fiasco::l4_ipc_sleep(Fiasco::l4_ipc_timeout(0, 0, 500, 0));
|
||||
|
||||
_owner = myself;
|
||||
@@ -55,6 +54,6 @@ void Lock::lock(Applicant &myself)
|
||||
void Lock::unlock()
|
||||
{
|
||||
_owner = Applicant(nullptr);
|
||||
Genode::memory_barrier();
|
||||
memory_barrier();
|
||||
_state = UNLOCKED;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
#include <base/sleep.h>
|
||||
|
||||
/* L4/Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
}
|
||||
#include <fiasco/syscall.h>
|
||||
|
||||
|
||||
void Genode::sleep_forever()
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
This repository contains the port of Genode to the Fiasco.OC microkernel.
|
||||
For further information, please refer to the following documents:
|
||||
|
||||
:[http://genode.org/community/wiki/GenodeOnFiascoOC - Genode on Fiasco.OC Wiki page]:
|
||||
This Wiki page contains the information on how to build and use
|
||||
Genode with Fiasco.OC.
|
||||
|
||||
:[http://os.inf.tu-dresden.de/fiasco]:
|
||||
Official website for the Fiasco.OC microkernel.
|
||||
:[https://os.inf.tu-dresden.de/fiasco]:
|
||||
Official website for the Fiasco.OC microkernel
|
||||
|
||||
1
repos/base-foc/etc/board.conf
Normal file
1
repos/base-foc/etc/board.conf
Normal file
@@ -0,0 +1 @@
|
||||
BOARD ?= unknown
|
||||
@@ -1,5 +1 @@
|
||||
SPECS += foc
|
||||
|
||||
ifneq ($(filter x86_%,$(SPECS)),)
|
||||
SPECS += pci acpi ps2 vesa framebuffer
|
||||
endif
|
||||
|
||||
@@ -25,17 +25,17 @@ namespace Genode { namespace Capability_space {
|
||||
* Allocate kernel capability selector without associating it with a
|
||||
* Genode capability
|
||||
*/
|
||||
Fiasco::l4_cap_idx_t alloc_kcap();
|
||||
Foc::l4_cap_idx_t alloc_kcap();
|
||||
|
||||
/**
|
||||
* Release kernel capability selector
|
||||
*/
|
||||
void free_kcap(Fiasco::l4_cap_idx_t);
|
||||
void free_kcap(Foc::l4_cap_idx_t);
|
||||
|
||||
/**
|
||||
* Request kernel capability selector associated with Genode capability
|
||||
*/
|
||||
Fiasco::l4_cap_idx_t kcap(Native_capability);
|
||||
Foc::l4_cap_idx_t kcap(Native_capability);
|
||||
|
||||
} }
|
||||
|
||||
|
||||
@@ -14,18 +14,16 @@
|
||||
#ifndef _INCLUDE__FOC__NATIVE_CAPABILITY_H_
|
||||
#define _INCLUDE__FOC__NATIVE_CAPABILITY_H_
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/consts.h>
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/task.h>
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Foc {
|
||||
|
||||
/*********************************************
|
||||
** Capability selectors controlled by core **
|
||||
*********************************************/
|
||||
|
||||
/* use the same task cap selector like L4Re for compatibility in L4Linux */
|
||||
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
|
||||
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
|
||||
|
||||
static constexpr l4_cap_idx_t DEBUG_CAP = L4_BASE_DEBUGGER_CAP;
|
||||
|
||||
|
||||
@@ -21,23 +21,20 @@
|
||||
/* Genode includes */
|
||||
#include <base/stdint.h>
|
||||
#include <foc/receive_window.h>
|
||||
|
||||
/* Fiasco.OC includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode { struct Native_thread; }
|
||||
|
||||
|
||||
struct Genode::Native_thread
|
||||
{
|
||||
Fiasco::l4_cap_idx_t kcap = 0;
|
||||
Foc::l4_cap_idx_t kcap = 0;
|
||||
|
||||
/* receive window for capability selectors received at the server side */
|
||||
Receive_window rcv_window { };
|
||||
|
||||
Native_thread() { }
|
||||
explicit Native_thread(Fiasco::l4_cap_idx_t kcap) : kcap(kcap) { }
|
||||
explicit Native_thread(Foc::l4_cap_idx_t kcap) : kcap(kcap) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__FOC__NATIVE_THREAD_H_ */
|
||||
|
||||
36
repos/base-foc/include/foc/syscall.h
Normal file
36
repos/base-foc/include/foc/syscall.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* \brief Collection of Fiasco.OC kernel bindings
|
||||
* \author Norman Feske
|
||||
* \date 2020-11-27
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2020 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__FOC__SYSCALL_H_
|
||||
#define _INCLUDE__FOC__SYSCALL_H_
|
||||
|
||||
namespace Foc {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/kip>
|
||||
#include <l4/sys/kdebug.h>
|
||||
#include <l4/sys/cache.h>
|
||||
#include <l4/sys/consts.h>
|
||||
#include <l4/sys/utcb.h>
|
||||
#include <l4/sys/task.h>
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sys/thread.h>
|
||||
#include <l4/sys/factory.h>
|
||||
#include <l4/sys/irq.h>
|
||||
#include <l4/sys/debugger.h>
|
||||
#include <l4/sys/icu.h>
|
||||
#include <l4/sys/ktrace.h>
|
||||
#include <l4/sys/scheduler.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__FOC__SYSCALL_H_ */
|
||||
@@ -18,25 +18,21 @@
|
||||
|
||||
#include <base/capability.h>
|
||||
#include <base/thread_state.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode { struct Foc_thread_state; }
|
||||
|
||||
|
||||
struct Genode::Foc_thread_state : Thread_state
|
||||
{
|
||||
Fiasco::l4_cap_idx_t kcap; /* thread's gate cap in its pd */
|
||||
int id; /* id of gate capability */
|
||||
addr_t utcb; /* thread's utcb in its pd */
|
||||
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
|
||||
int id; /* ID of gate capability */
|
||||
addr_t utcb; /* thread's UTCB in its PD */
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Foc_thread_state() : kcap(Fiasco::L4_INVALID_CAP), id(0), utcb(0) { }
|
||||
Foc_thread_state() : kcap(Foc::L4_INVALID_CAP), id(0), utcb(0) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__FOC__THREAD_STATE_H_ */
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
namespace Genode { struct Foc_native_cpu_client; }
|
||||
|
||||
|
||||
struct Genode::Foc_native_cpu_client : Rpc_client<Foc_native_cpu>
|
||||
struct Genode::Foc_native_cpu_client : Rpc_client<Cpu_session::Native_cpu>
|
||||
{
|
||||
explicit Foc_native_cpu_client(Capability<Native_cpu> cap)
|
||||
: Rpc_client<Foc_native_cpu>(static_cap_cast<Foc_native_cpu>(cap)) { }
|
||||
: Rpc_client<Cpu_session::Native_cpu>(cap) { }
|
||||
|
||||
Native_capability native_cap(Thread_capability cap) override {
|
||||
return call<Rpc_native_cap>(cap); }
|
||||
|
||||
@@ -19,10 +19,8 @@
|
||||
#include <cpu_session/cpu_session.h>
|
||||
#include <foc/thread_state.h>
|
||||
|
||||
namespace Genode { struct Foc_native_cpu; }
|
||||
|
||||
|
||||
struct Genode::Foc_native_cpu : Cpu_session::Native_cpu
|
||||
struct Genode::Cpu_session::Native_cpu : Interface
|
||||
{
|
||||
virtual Native_capability native_cap(Thread_capability) = 0;
|
||||
virtual Foc_thread_state thread_state(Thread_capability) = 0;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
L4_INCLUDE_DIR := $(LIB_CACHE_DIR)/syscall-foc/include
|
||||
include $(call select_from_repositories,etc/board.conf)
|
||||
|
||||
L4_INCLUDE_DIR := $(LIB_CACHE_DIR)/syscall-foc-$(BOARD)/build/include
|
||||
|
||||
ifeq ($(filter-out $(SPECS),x86_32),)
|
||||
INC_DIR += $(L4_INCLUDE_DIR)/x86/l4f $(L4_INCLUDE_DIR)/x86
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
BOARD ?= unknown
|
||||
FOC_BUILD_DIR = $(shell pwd)/$(BOARD)-build
|
||||
FOC = $(FOC_BUILD_DIR)/foc
|
||||
FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco
|
||||
FOC_BUILD_DIR = $(shell pwd)/build
|
||||
FOC = $(FOC_BUILD_DIR)/foc
|
||||
FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco
|
||||
|
||||
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco.oc] /"
|
||||
|
||||
@@ -30,7 +29,7 @@ $(FOC): $(FOC_BUILD_DIR)
|
||||
# library.
|
||||
#
|
||||
|
||||
LIBS += syscall-foc
|
||||
LIBS += syscall-foc-$(BOARD)
|
||||
|
||||
PKGS := l4re-core/crtn \
|
||||
l4re-core/uclibc-headers \
|
||||
@@ -42,7 +41,7 @@ PKGS := l4re-core/crtn \
|
||||
drivers-frst/include drivers-frst/of drivers-frst/uart \
|
||||
bootstrap
|
||||
|
||||
L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-foc/$(BOARD)-build
|
||||
L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-foc-$(BOARD)/build
|
||||
|
||||
#
|
||||
# Supress several warnings especially of the uclibc-minimal
|
||||
|
||||
3
repos/base-foc/lib/mk/kernel-foc.mk
Normal file
3
repos/base-foc/lib/mk/kernel-foc.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(REP_DIR)/etc/board.conf
|
||||
|
||||
LIBS += kernel-foc-$(BOARD)
|
||||
@@ -0,0 +1,4 @@
|
||||
override BOARD := imx6q_sabrelite
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
4
repos/base-foc/lib/mk/spec/arm/kernel-foc-imx7d_sabre.mk
Normal file
4
repos/base-foc/lib/mk/spec/arm/kernel-foc-imx7d_sabre.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := imx7d_sabre
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
4
repos/base-foc/lib/mk/spec/arm/kernel-foc-pbxa9.mk
Normal file
4
repos/base-foc/lib/mk/spec/arm/kernel-foc-pbxa9.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := pbxa9
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
4
repos/base-foc/lib/mk/spec/arm/kernel-foc-rpi.mk
Normal file
4
repos/base-foc/lib/mk/spec/arm/kernel-foc-rpi.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := rpi
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -0,0 +1,4 @@
|
||||
override BOARD := imx6q_sabrelite
|
||||
L4_ARCH := arm_armv7a
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
@@ -0,0 +1,4 @@
|
||||
override BOARD := imx7d_sabre
|
||||
L4_ARCH := arm_armv7a
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
4
repos/base-foc/lib/mk/spec/arm/syscall-foc-pbxa9.mk
Normal file
4
repos/base-foc/lib/mk/spec/arm/syscall-foc-pbxa9.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := pbxa9
|
||||
L4_ARCH := arm_armv7a
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
4
repos/base-foc/lib/mk/spec/arm/syscall-foc-rpi.mk
Normal file
4
repos/base-foc/lib/mk/spec/arm/syscall-foc-rpi.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := rpi
|
||||
L4_ARCH := arm_armv6
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
@@ -1,6 +1,7 @@
|
||||
L4_INC_TARGETS = arm/l4/sys \
|
||||
arm/l4f/l4/sys \
|
||||
arm/l4/vcpu
|
||||
L4_CONFIG := $(call select_from_repositories,config/$(BOARD).user)
|
||||
|
||||
CC_OPT += -Iinclude/arm
|
||||
|
||||
|
||||
4
repos/base-foc/lib/mk/spec/arm_64/kernel-foc-rpi3.mk
Normal file
4
repos/base-foc/lib/mk/spec/arm_64/kernel-foc-rpi3.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := rpi3
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,6 +1,6 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/rpi3.user)
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/rpi3-build/bin/arm64_armv8a
|
||||
override BOARD := rpi3
|
||||
L4_ARCH := arm64_armv8a
|
||||
L4_CONFIG := $(call select_from_repositories,config/$(BOARD).user)
|
||||
|
||||
L4_INC_TARGETS = arm64/l4/sys \
|
||||
arm64/l4f/l4/sys \
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/imx6q_sabrelite.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,5 +0,0 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/imx6q_sabrelite.user)
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/imx6q_sabrelite-build/bin/arm_armv7a
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/imx7.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,5 +0,0 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/imx7.user)
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/imx7d_sabre-build/bin/arm_armv7a
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/pbxa9.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,5 +0,0 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/pbxa9.user)
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/pbxa9-build/bin/arm_armv7a
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/rpi.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,5 +0,0 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/rpi.user)
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/rpi-build/bin/arm_armv6
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/rpi3.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,9 +1 @@
|
||||
#
|
||||
# \brief Portions of base library shared by core and non-core processes
|
||||
# \author Norman Feske
|
||||
# \date 2013-02-14
|
||||
#
|
||||
|
||||
vpath vm_session.cc $(REP_DIR)/src/lib/base/x86
|
||||
|
||||
include $(REP_DIR)/lib/mk/base-foc-common.inc
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
LIBS += timeout
|
||||
|
||||
vpath vm.cc $(REP_DIR)/src/lib/base/x86
|
||||
|
||||
include $(REP_DIR)/lib/mk/base-foc.inc
|
||||
|
||||
4
repos/base-foc/lib/mk/spec/x86_32/kernel-foc-pc.mk
Normal file
4
repos/base-foc/lib/mk/spec/x86_32/kernel-foc-pc.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := pc
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/x86_32.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/x86_32.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,11 +1,11 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/x86_32.user)
|
||||
override BOARD := pc
|
||||
L4_ARCH := x86_586
|
||||
L4_CONFIG := $(call select_from_repositories,config/x86_32.user)
|
||||
|
||||
L4_INC_TARGETS := x86/l4/sys x86/l4f/l4/sys x86/l4/vcpu
|
||||
|
||||
CC_OPT += -Iinclude/x86
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/pc-build/bin/x86_586
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/x86/syscall-foc.inc
|
||||
|
||||
vpath syscalls_direct.S $(L4_PKG_DIR)/l4sys/lib/src/ARCH-x86
|
||||
4
repos/base-foc/lib/mk/spec/x86_64/kernel-foc-pc.mk
Normal file
4
repos/base-foc/lib/mk/spec/x86_64/kernel-foc-pc.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
override BOARD := pc
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/x86_64.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,3 +0,0 @@
|
||||
KERNEL_CONFIG := $(REP_DIR)/config/x86_64.kernel
|
||||
|
||||
include $(REP_DIR)/lib/mk/kernel-foc.inc
|
||||
@@ -1,9 +1,9 @@
|
||||
L4_CONFIG := $(call select_from_repositories,config/x86_64.user)
|
||||
override BOARD := pc
|
||||
L4_ARCH := amd64_K8
|
||||
L4_CONFIG := $(call select_from_repositories,config/x86_64.user)
|
||||
|
||||
L4_INC_TARGETS := amd64/l4/sys amd64/l4f/l4/sys amd64/l4/vcpu
|
||||
|
||||
CC_OPT += -Iinclude/amd64
|
||||
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/pc-build/bin/amd64_K8
|
||||
|
||||
include $(REP_DIR)/lib/mk/spec/x86/syscall-foc.inc
|
||||
@@ -6,9 +6,9 @@
|
||||
# userland (L4re) that comes with Fiasco.OC.
|
||||
#
|
||||
|
||||
BOARD ?= unknown
|
||||
L4_SRC_DIR := $(call select_from_ports,foc)/src/kernel/foc
|
||||
L4_BUILD_DIR := $(shell pwd)/$(BOARD)-build
|
||||
L4_BUILD_DIR := $(shell pwd)/build
|
||||
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc-$(BOARD)/build/bin/$(L4_ARCH)
|
||||
|
||||
#
|
||||
# Create mirror for architecture-specific L4sys header files
|
||||
|
||||
4
repos/base-foc/lib/mk/syscall-foc.mk
Normal file
4
repos/base-foc/lib/mk/syscall-foc.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
include $(REP_DIR)/etc/board.conf
|
||||
|
||||
LIBS += syscall-foc-$(BOARD)
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-11-26 a5a99e7f402100f62864609115b680b83099dbbe
|
||||
2021-03-11 c1f7d1de07d3a55d5e43f6ab5fb67b502ab1d0bb
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-11-26 32bf527cace92c460fa986ccccbaf79caa2e77cd
|
||||
2021-03-11 9383498670ce6668c8b99da3e62008b21a5932aa
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-11-26 841b52ee26b3bdfec31947392906db31e9a9d1c5
|
||||
2021-03-11 50104241d20d23e928d3b27d0931d14112c68e82
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-11-26 f6c4252ce98073b3db64e89b9bab0093ee7cd7eb
|
||||
2021-03-11 43cc39f70c8bfe4df3427c94d096d7e218b7b24c
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-11-26 ec14f348095651f4cfe30a37a32d1162a73a3a06
|
||||
2021-03-11 742459157b61720e96c17bb6cfbf7ac085a4df2f
|
||||
|
||||
@@ -26,6 +26,14 @@ src/kernel/foc: src/kernel
|
||||
tar -C $(KERNEL_PORT_DIR)/src/kernel/foc --exclude=.git -cf - . |\
|
||||
tar -C $@ -xf -
|
||||
|
||||
content: etc/board.conf remove_other_board_libs
|
||||
|
||||
etc/board.conf:
|
||||
echo "BOARD = $(BOARD)" > etc/board.conf
|
||||
|
||||
remove_other_board_libs: lib/mk
|
||||
find lib/mk/spec -name kernel-foc-*.mk -o -name syscall-foc-*.mk |\
|
||||
grep -v "foc-$(BOARD).mk" | xargs rm -rf
|
||||
|
||||
content:
|
||||
for spec in x86_32 x86_64 arm arm_64; do \
|
||||
@@ -33,11 +41,3 @@ content:
|
||||
done;
|
||||
sed -i "s/ld-foc/ld/" src/lib/ld/foc/target.mk
|
||||
sed -i "s/foc_timer_drv/timer/" src/timer/foc/target.mk
|
||||
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" src/core/foc/target.mk
|
||||
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" src/kernel/foc/target.mk
|
||||
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" lib/mk/syscall-foc.inc
|
||||
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" lib/mk/kernel-foc.inc
|
||||
|
||||
content: enable_board_spec
|
||||
enable_board_spec: etc/specs.conf
|
||||
echo "SPECS += $(BOARD)" >> etc/specs.conf
|
||||
|
||||
@@ -14,7 +14,7 @@ install_config {
|
||||
<default-route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</default-route>
|
||||
<start name="test-cap_integrity">
|
||||
<start name="test-cap_integrity" caps="100" ld="no">
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
</start>
|
||||
</config>
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
/* core includes */
|
||||
#include <core_log.h>
|
||||
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/kdebug.h>
|
||||
/* Fiasco.OC includes */
|
||||
#include <foc/syscall.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
void Core_log::out(char const c)
|
||||
{
|
||||
Foc::outchar(c);
|
||||
}
|
||||
void Genode::Core_log::out(char const c) { Fiasco::outchar(c); }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
BOARD ?= unknown
|
||||
include $(REP_DIR)/etc/board.conf
|
||||
|
||||
TARGET := foc-$(BOARD)
|
||||
LIBS := core-foc
|
||||
CORE_OBJ := core-foc-$(BOARD).o
|
||||
CORE_LIB := core-foc-$(BOARD).a
|
||||
|
||||
include $(BASE_DIR)/src/core/target.inc
|
||||
|
||||
@@ -20,33 +20,32 @@
|
||||
#include <base/mutex.h>
|
||||
#include <synced_range_allocator.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Cap_id_allocator
|
||||
{
|
||||
private:
|
||||
|
||||
enum {
|
||||
CAP_ID_RANGE = ~0UL,
|
||||
CAP_ID_MASK = ~3UL,
|
||||
CAP_ID_NUM_MAX = CAP_ID_MASK >> 2,
|
||||
CAP_ID_OFFSET = 1 << 2
|
||||
};
|
||||
|
||||
Synced_range_allocator<Allocator_avl> _id_alloc;
|
||||
|
||||
Mutex _mutex { };
|
||||
|
||||
public:
|
||||
|
||||
class Out_of_ids : Exception {};
|
||||
namespace Genode { class Cap_id_allocator; }
|
||||
|
||||
|
||||
Cap_id_allocator(Allocator &);
|
||||
class Genode::Cap_id_allocator
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned long alloc();
|
||||
void free(unsigned long id);
|
||||
};
|
||||
}
|
||||
enum {
|
||||
CAP_ID_RANGE = ~0UL,
|
||||
CAP_ID_MASK = ~3UL,
|
||||
CAP_ID_NUM_MAX = CAP_ID_MASK >> 2,
|
||||
CAP_ID_OFFSET = 1 << 2
|
||||
};
|
||||
|
||||
Synced_range_allocator<Allocator_avl> _id_alloc;
|
||||
|
||||
Mutex _mutex { };
|
||||
|
||||
public:
|
||||
|
||||
class Out_of_ids : Exception {};
|
||||
|
||||
Cap_id_allocator(Allocator &);
|
||||
|
||||
unsigned long alloc();
|
||||
void free(unsigned long id);
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__CAP_ID_ALLOC_H_ */
|
||||
|
||||
@@ -45,7 +45,9 @@ class Genode::Core_cap_index : public Native_capability::Data
|
||||
Core_cap_index(Pd_session_component *session = 0,
|
||||
Platform_thread *pt = 0,
|
||||
Native_thread gate = Native_thread() )
|
||||
: _session(session), _pt(pt), _gate(gate) {}
|
||||
:
|
||||
_session(session), _pt(pt), _gate(gate)
|
||||
{ }
|
||||
|
||||
Pd_session_component const *session() const { return _session; }
|
||||
Platform_thread const *pt() const { return _pt; }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* \brief Fiasco.OC specific capability mapping.
|
||||
* \brief Fiasco.OC specific capability mapping
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2012-02-22
|
||||
*/
|
||||
@@ -18,43 +18,44 @@
|
||||
#include <cap_index.h>
|
||||
#include <util/noncopyable.h>
|
||||
|
||||
namespace Genode {
|
||||
namespace Genode { class Cap_mapping; }
|
||||
|
||||
/**
|
||||
* A Cap_mapping embodies a capability of core, and its mapped
|
||||
* copy in another protection domain.
|
||||
*/
|
||||
class Cap_mapping : Noncopyable
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* Helper function for construction purposes.
|
||||
*
|
||||
* Allocates a new capability id and Core_cap_index and inserts
|
||||
* it in the Cap_map.
|
||||
*
|
||||
* \return pointer to newly constructed Core_cap_index object
|
||||
*/
|
||||
inline Core_cap_index *_get_cap();
|
||||
/**
|
||||
* A Cap_mapping embodies a capability of core, and its mapped
|
||||
* copy in another protection domain.
|
||||
*/
|
||||
class Genode::Cap_mapping : Noncopyable
|
||||
{
|
||||
private:
|
||||
|
||||
public:
|
||||
/**
|
||||
* Helper function for construction purposes.
|
||||
*
|
||||
* Allocates a new capability id and Core_cap_index and inserts
|
||||
* it in the Cap_map.
|
||||
*
|
||||
* \return pointer to newly constructed Core_cap_index object
|
||||
*/
|
||||
inline Core_cap_index *_get_cap();
|
||||
|
||||
Native_capability local; /* reference to cap that is mapped */
|
||||
Fiasco::l4_cap_idx_t remote; /* index in cap-space of the other pd */
|
||||
public:
|
||||
|
||||
Cap_mapping(bool alloc=false,
|
||||
Fiasco::l4_cap_idx_t r = Fiasco::L4_INVALID_CAP);
|
||||
Cap_mapping(Native_capability cap,
|
||||
Fiasco::l4_cap_idx_t r = Fiasco::L4_INVALID_CAP);
|
||||
Native_capability local; /* reference to cap that is mapped */
|
||||
Foc::l4_cap_idx_t remote; /* index in cap-space of the other pd */
|
||||
|
||||
/**
|
||||
* Map the cap in local to corresponding task.
|
||||
*
|
||||
* \param task capability of task to map to
|
||||
*/
|
||||
void map(Fiasco::l4_cap_idx_t task);
|
||||
};
|
||||
}
|
||||
Cap_mapping(bool alloc=false,
|
||||
Foc::l4_cap_idx_t r = Foc::L4_INVALID_CAP);
|
||||
|
||||
Cap_mapping(Native_capability cap,
|
||||
Foc::l4_cap_idx_t r = Foc::L4_INVALID_CAP);
|
||||
|
||||
/**
|
||||
* Map the cap in local to corresponding task.
|
||||
*
|
||||
* \param task capability of task to map to
|
||||
*/
|
||||
void map(Foc::l4_cap_idx_t task);
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__CAP_MAPPING_H_ */
|
||||
|
||||
@@ -28,22 +28,22 @@
|
||||
/* base-internal includes */
|
||||
#include <base/internal/native_thread.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/types.h>
|
||||
}
|
||||
/* Fiasco.OC includes */
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
class Mapping;
|
||||
class Ipc_pager;
|
||||
}
|
||||
|
||||
|
||||
class Genode::Mapping
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _dst_addr;
|
||||
Fiasco::l4_fpage_t _fpage { };
|
||||
Foc::l4_fpage_t _fpage { };
|
||||
Cache_attribute _cacheability;
|
||||
bool _iomem;
|
||||
|
||||
@@ -55,26 +55,27 @@ class Genode::Mapping
|
||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||
Cache_attribute c, bool io_mem,
|
||||
unsigned log2size, bool write, bool executable)
|
||||
: _dst_addr(dst_addr), _cacheability(c), _iomem(io_mem)
|
||||
:
|
||||
_dst_addr(dst_addr), _cacheability(c), _iomem(io_mem)
|
||||
{
|
||||
typedef Fiasco::L4_fpage_rights Rights;
|
||||
Rights rights = (write && executable) ? Fiasco::L4_FPAGE_RWX :
|
||||
(write && !executable) ? Fiasco::L4_FPAGE_RW :
|
||||
(!write && !executable) ? Fiasco::L4_FPAGE_RO :
|
||||
Fiasco::L4_FPAGE_RX;
|
||||
typedef Foc::L4_fpage_rights Rights;
|
||||
Rights rights = ( write && executable) ? Foc::L4_FPAGE_RWX :
|
||||
( write && !executable) ? Foc::L4_FPAGE_RW :
|
||||
(!write && !executable) ? Foc::L4_FPAGE_RO :
|
||||
Foc::L4_FPAGE_RX;
|
||||
|
||||
_fpage = Fiasco::l4_fpage(src_addr, log2size, rights);
|
||||
_fpage = Foc::l4_fpage(src_addr, log2size, rights);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct invalid flexpage
|
||||
*/
|
||||
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage_invalid()),
|
||||
Mapping() : _dst_addr(0), _fpage(Foc::l4_fpage_invalid()),
|
||||
_cacheability(UNCACHED), _iomem(false) { }
|
||||
|
||||
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
|
||||
Foc::l4_umword_t dst_addr() const { return _dst_addr; }
|
||||
bool grant() const { return false; }
|
||||
Fiasco::l4_fpage_t fpage() const { return _fpage; }
|
||||
Foc::l4_fpage_t fpage() const { return _fpage; }
|
||||
Cache_attribute cacheability() const { return _cacheability; }
|
||||
bool iomem() const { return _iomem; }
|
||||
/**
|
||||
@@ -101,8 +102,8 @@ class Genode::Ipc_pager : public Native_capability
|
||||
addr_t _pf_ip { 0 }; /* ip of faulter */
|
||||
Mapping _reply_mapping { }; /* page-fault answer */
|
||||
unsigned long _badge; /* badge of faulting thread */
|
||||
Fiasco::l4_msgtag_t _tag { }; /* receive message tag */
|
||||
Fiasco::l4_exc_regs_t _regs { }; /* exception registers */
|
||||
Foc::l4_msgtag_t _tag { }; /* receive message tag */
|
||||
Foc::l4_exc_regs_t _regs { }; /* exception registers */
|
||||
Msg_type _type { PAGEFAULT };
|
||||
|
||||
void _parse_msg_type(void);
|
||||
|
||||
@@ -38,12 +38,12 @@ class Genode::Irq_object
|
||||
Irq_session::Polarity _polarity; /* interrupt polarity */
|
||||
|
||||
unsigned _irq;
|
||||
Genode::addr_t _msi_addr;
|
||||
Genode::addr_t _msi_data;
|
||||
addr_t _msi_addr;
|
||||
addr_t _msi_data;
|
||||
|
||||
Signal_context_capability _sig_cap { };
|
||||
|
||||
Fiasco::l4_cap_idx_t _capability() const { return _cap->kcap(); }
|
||||
Foc::l4_cap_idx_t _capability() const { return _cap->kcap(); }
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -19,13 +19,8 @@
|
||||
#include <platform.h>
|
||||
#include <util.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
namespace Fiasco {
|
||||
#include <l4/sys/ipc.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
#include <l4/sys/task.h>
|
||||
#include <l4/sys/cache.h>
|
||||
}
|
||||
/* Fiasco.OC includes */
|
||||
#include <foc/syscall.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
@@ -47,7 +42,7 @@ namespace Genode {
|
||||
size_t page_size_log2 = get_page_size_log2();
|
||||
for (unsigned i = 0; i < num_pages; i++, offset += page_size) {
|
||||
|
||||
using namespace Fiasco;
|
||||
using namespace Foc;
|
||||
|
||||
l4_fpage_t snd_fpage = l4_fpage(from_addr + offset,
|
||||
page_size_log2, L4_FPAGE_RW);
|
||||
@@ -84,7 +79,7 @@ namespace Genode {
|
||||
static inline bool map_local_io(addr_t from_addr, addr_t to_addr,
|
||||
size_t num_pages)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
using namespace Foc;
|
||||
|
||||
size_t size = num_pages << get_page_size_log2();
|
||||
|
||||
@@ -129,7 +124,7 @@ namespace Genode {
|
||||
|
||||
static inline void unmap_local(addr_t const local_base, size_t const num_pages)
|
||||
{
|
||||
using namespace Fiasco;
|
||||
using namespace Foc;
|
||||
|
||||
size_t const size = num_pages << get_page_size_log2();
|
||||
addr_t addr = local_base;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Genode {
|
||||
}
|
||||
|
||||
|
||||
class Genode::Native_cpu_component : public Rpc_object<Foc_native_cpu,
|
||||
class Genode::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
|
||||
Native_cpu_component>
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
namespace Genode { struct Pager_object_exception_state; }
|
||||
|
||||
|
||||
struct Genode::Pager_object_exception_state
|
||||
{
|
||||
Mutex mutex { };
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user