forked from genodelabs/genode
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Makefile, added README.md, changed thread IDs to hardware IDs
- Loading branch information
1 parent
772c3a9
commit b5b1a38
Showing
5 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# options: x86 arm | ||
TOOLCHAIN_TARGET ?= arm | ||
|
||
# options: see tool/create_builddir | ||
GENODE_TARGET ?= foc_pbxa9 | ||
|
||
BUILD_DIR ?= build | ||
TOOLCHAIN_BUILD_DIR ?= $(BUILD_DIR)/toolchain-$(TOOLCHAIN_TARGET) | ||
GENODE_BUILD_DIR ?= $(BUILD_DIR)/genode-$(GENODE_TARGET) | ||
BUILD_CONF = $(GENODE_BUILD_DIR)/etc/build.conf | ||
|
||
all: toolchain ports platform | ||
|
||
# ================================================================ | ||
# Genode toolchain. Only needs to be done once per target (x86/arm). | ||
toolchain: | ||
mkdir -p $(TOOLCHAIN_BUILD_DIR) | ||
cd $(TOOLCHAIN_BUILD_DIR);\ | ||
../../tool/tool_chain $(TOOLCHAIN_TARGET) | ||
# | ||
# ================================================================ | ||
|
||
|
||
# ================================================================ | ||
# Download Genode external sources. Only needs to be done once per system. | ||
ports: foc libports | ||
|
||
foc: | ||
$(MAKE) -C repos/base-foc prepare | ||
|
||
libports: | ||
$(MAKE) -C repos/libports prepare | ||
# | ||
# ================================================================ | ||
|
||
|
||
# ================================================================ | ||
# Genode build process. Rebuild subtargets as needed. | ||
platform: genode_build_dir tasksmanager | ||
|
||
genode_build_dir: | ||
tool/create_builddir $(GENODE_TARGET) BUILD_DIR=$(GENODE_BUILD_DIR) | ||
printf 'REPOSITORIES += $$(GENODE_DIR)/repos/libports\n' >> $(BUILD_CONF) | ||
printf 'REPOSITORIES += $$(GENODE_DIR)/repos/taskmanager\n' >> $(BUILD_CONF) | ||
|
||
task-manager: | ||
$(MAKE) -j10 -C $(GENODE_BUILD_DIR) task-manager | ||
|
||
# Delete build directory for all target systems. In some cases, subfolders in the contrib directory might be corrupted. Remove manually and re-prepare if necessary. | ||
clean: | ||
rm -rf $(BUILD_DIR) | ||
# | ||
# ================================================================ | ||
|
||
|
||
# ================================================================ | ||
# Run Genode with an active dom0 server. | ||
run: | ||
$(MAKE) -j10 -C $(GENODE_BUILD_DIR) run/taskmanager | ||
# | ||
# ================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# genode-taskmanager | ||
The taskmanager is a userspace application for monitoring purpose. It shows all threads currently running on the machine, with their IDs, execution time, ram quota, ram used and overall system load. | ||
|
||
### Building | ||
The custom Makefile builds the entire Fiasco.OC and Genode system including its toolchain and external dependencies into a `build/` and `contrib/` directory respectively. To manually execute steps within the build process see the Makefile or the Genode documentation: | ||
http://genode.org/documentation/developer-resources/getting_started | ||
|
||
The toolchain installs executables to `/usr/local/genode-gcc` as part of the Genode `tool_chain` script. Everything else stays within the repository. | ||
|
||
After a first clone of this branch run `make` once. This will do the following: | ||
|
||
* build and install Genode toolchain for `arm` or `x86` (target `toolchain`) | ||
* download required external libraries into the `contrib` folder (target `ports`) | ||
* create the target-specific build directory (target `genode_build_dir`) | ||
* build taskmanager (target `taskmanager`) | ||
|
||
After this, only build the targets you need. Inter-target dependencies are not set properly. When changing target platform, use the make target `platform` to only rebuild `genode_build_dir` and `taskmanager`. | ||
|
||
To run the Genode taskmanager type `make run` | ||
|
||
The Makefile will need additional adjustments for other kernels than Fiasco.OC. | ||
|
||
### Required packages | ||
The following packages are required for building the Genode toolchain: | ||
|
||
`sudo apt-get install libncurses5-dev texinfo autogen autoconf2.64 g++ libexpat1-dev flex bison gperf` | ||
|
||
For building Genode: | ||
|
||
`sudo apt-get install make pkg-config gawk subversion expect git` | ||
|
||
For running Genode in QEMU: | ||
|
||
`sudo apt-get install libxml2-utils syslinux` | ||
|
||
For some additional ports you may need: | ||
|
||
`sudo apt-get install xsltproc yasm iasl lynx` | ||
|
||
### Folder structure | ||
Custom repos: | ||
|
||
| Folder | Description | | ||
| ----------------------------------- | ------------------------------------------------ | | ||
| `repos/taskmanager/` | central network module: server and task manager | | ||
| `repos/taskmanager/run/` | run file configuration for dom0 | | ||
| `repos/taskmanager/src/taskmanager/re/` | taskmanager | | ||
| `repos/taskmanager/src/idle/` | idle process to show system load | | ||
|
||
The provided Makefile creates the following directories: | ||
|
||
| Folder | Description | | ||
| --------------------------- | ------------------------- | | ||
| `build/` | all build files | | ||
| `build/toolchain-TARGET/` | Genode toolchain | | ||
| `build/genode-TARGET/` | Genode build dir | | ||
| `contrib/` | external Genode libraries | | ||
|
||
### Fine-grained CPU time | ||
The Fiasco.OC kernel by default only returns timing information at a resolution of 1ms. Granularity can be increased by changing line 51 of `build/genode-TARGET/kernel/fiasco.oc/globalconfig.out` to | ||
`CONFIG_FINE_GRAINED_CPUTIME=y` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters