2012-07-19 20:09:59 +00:00
|
|
|
set build_components {
|
|
|
|
core init drivers/timer noux/minimal lib/libc_noux
|
2015-06-08 07:05:32 +00:00
|
|
|
drivers/framebuffer drivers/input
|
2012-07-19 20:09:59 +00:00
|
|
|
server/terminal server/ram_fs
|
|
|
|
test/libports/ncurses
|
|
|
|
}
|
2013-12-01 21:27:38 +00:00
|
|
|
set use_usb_input [expr ![have_spec ps2] && ![have_spec sdl] && [have_spec usb]]
|
|
|
|
|
|
|
|
lappend_if $use_usb_input build_components drivers/usb
|
2012-07-19 20:09:59 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build Noux packages only once
|
|
|
|
#
|
|
|
|
set noux_pkgs {bash coreutils make}
|
|
|
|
|
|
|
|
foreach pkg $noux_pkgs {
|
|
|
|
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2012-07-19 20:09:59 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<config verbose="yes">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
2015-09-17 12:15:28 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2012-07-19 20:09:59 +00:00
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2012-07-19 20:09:59 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append_if [have_spec sdl] config {
|
|
|
|
<start name="fb_sdl">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Input"/>
|
|
|
|
<service name="Framebuffer"/>
|
|
|
|
</provides>
|
|
|
|
</start>}
|
|
|
|
|
2013-12-01 21:27:38 +00:00
|
|
|
append_if $use_usb_input config {
|
|
|
|
<start name="usb_drv">
|
|
|
|
<resource name="RAM" quantum="12M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
|
|
|
<config uhci="yes" ehci="no" xhci="no"> <hid/> </config>
|
|
|
|
</start> }
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
append_platform_drv_config
|
2012-07-19 20:09:59 +00:00
|
|
|
|
2013-04-29 08:51:27 +00:00
|
|
|
append_if [have_spec framebuffer] config {
|
2017-05-07 20:36:11 +00:00
|
|
|
<start name="fb_drv" caps="200">
|
2013-04-29 08:51:27 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2012-07-19 20:09:59 +00:00
|
|
|
<provides><service name="Framebuffer"/></provides>
|
|
|
|
</start>}
|
|
|
|
|
|
|
|
append_if [have_spec ps2] config {
|
|
|
|
<start name="ps2_drv">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<start name="terminal">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides><service name="Terminal"/></provides>
|
|
|
|
<config>
|
|
|
|
<keyboard layout="de"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
<start name="ram_fs">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides><service name="File_system"/></provides>
|
|
|
|
<config>
|
|
|
|
|
|
|
|
<!-- preload RAM file system with some ROM images -->
|
|
|
|
<content>
|
|
|
|
<dir name="home">
|
|
|
|
<dir name="user">
|
2012-09-26 10:29:07 +00:00
|
|
|
<inline name=".bash_profile">
|
|
|
|
/home/test_script1 correct
|
|
|
|
/home/test_script2 "execution of test_script2 succeeded"
|
|
|
|
</inline>
|
|
|
|
<inline name="test_script1">#!/bin/make -f
|
2012-07-19 20:09:59 +00:00
|
|
|
wrong:
|
2012-09-26 10:29:07 +00:00
|
|
|
@echo "execution of test_script1 failed"
|
2012-07-19 20:09:59 +00:00
|
|
|
correct:
|
2012-09-26 10:29:07 +00:00
|
|
|
@echo "execution of test_script1 succeeded"
|
|
|
|
</inline>
|
|
|
|
<inline name="test_script2">#!/bin/bash
|
|
|
|
echo "$1"
|
2012-07-19 20:09:59 +00:00
|
|
|
</inline>
|
|
|
|
</dir>
|
|
|
|
</dir>
|
|
|
|
</content>
|
|
|
|
|
|
|
|
<!-- constrain sessions according to their labels -->
|
|
|
|
<policy label="noux -> root" root="/" />
|
|
|
|
<policy label="noux -> home" root="/home/user" writeable="yes" />
|
|
|
|
</config>
|
|
|
|
</start>
|
2017-05-07 20:36:11 +00:00
|
|
|
<start name="noux" caps="500">
|
2012-07-19 20:09:59 +00:00
|
|
|
<resource name="RAM" quantum="1G" />
|
|
|
|
<config>
|
|
|
|
<fstab> }
|
|
|
|
|
|
|
|
foreach pkg $noux_pkgs {
|
|
|
|
append config " <tar name=\"$pkg.tar\" />" }
|
|
|
|
|
|
|
|
append config {
|
2017-05-14 20:00:40 +00:00
|
|
|
<dir name="bin"> <symlink name="sh" target="bash"/> </dir>
|
2012-07-19 20:09:59 +00:00
|
|
|
<dir name="home"> <fs label="home" /> </dir>
|
2015-11-18 11:17:32 +00:00
|
|
|
<dir name="ram"> <fs label="root" /> </dir>
|
2012-07-19 20:09:59 +00:00
|
|
|
|
|
|
|
</fstab>
|
|
|
|
<start name="/bin/bash">
|
|
|
|
<env name="TERM" value="linux" />
|
|
|
|
<env name="HOME" value="/home" />
|
|
|
|
<arg value="--login" />
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
2017-05-14 19:55:57 +00:00
|
|
|
core init timer ld.lib.so noux terminal ram_fs posix.lib.so
|
2012-07-19 20:09:59 +00:00
|
|
|
libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so }
|
|
|
|
|
2017-05-14 20:00:40 +00:00
|
|
|
foreach pkg $noux_pkgs { lappend boot_modules "$pkg.tar" }
|
2012-07-19 20:09:59 +00:00
|
|
|
|
|
|
|
# platform-specific modules
|
2013-04-29 08:51:27 +00:00
|
|
|
lappend_if [have_spec linux] boot_modules fb_sdl
|
|
|
|
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
|
|
|
lappend_if [have_spec ps2] boot_modules ps2_drv
|
2013-12-01 21:27:38 +00:00
|
|
|
lappend_if $use_usb_input boot_modules usb_drv
|
2012-07-19 20:09:59 +00:00
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
|
2012-07-19 20:09:59 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
|
|
|
|
run_genode_until forever
|