mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
parent
9f9e2daedf
commit
2322ab202c
3
README
3
README
@ -171,8 +171,7 @@ The Genode source tree is composed of the following subdirectories:
|
||||
:'ports-<platform>':
|
||||
|
||||
These platform-specific source-code repositories contain software that
|
||||
capitalizes special features of the respective kernel platform. I.e.,
|
||||
for the OKL4 base platform, a port of OKLinux is provided in 'ports-okl4'.
|
||||
capitalizes special features of the respective kernel platform.
|
||||
For the Fiasco.OC platform, 'ports-foc' hosts a port of the L4Linux
|
||||
kernel. For further information, please refer to the README file at the
|
||||
top level of the respective repository.
|
||||
|
@ -455,10 +455,6 @@ Runtime environments
|
||||
that enables the use of unmodified command-line based GNU software. For using
|
||||
noux, refer to the run script 'ports/run/noux.run'.
|
||||
|
||||
:'ports-okl4/src/oklinux': OKLinux is a paravirtualized Linux kernel that
|
||||
enables the use of Linux-based OSes as subsystems on the OKL4 kernel. For
|
||||
using OKLinux, refer to the run script 'ports-okl4/run/lx_block.run'.
|
||||
|
||||
:'ports-foc/src/l4linux': L4Linux is a paravirtualized Linux kernel that
|
||||
enables the use of Linux-based OSes as subsystems on the Fiasco.OC kernel.
|
||||
For using L4Linux, refer to the run script 'ports-foc/run/l4linux.run'.
|
||||
|
@ -1,83 +0,0 @@
|
||||
#
|
||||
# \brief Download, unpack and patch OKLinux source code
|
||||
# \author Stefan Kalkowski
|
||||
# \date 2010-01-06
|
||||
|
||||
DOWNLOAD_DIR = download
|
||||
CONTRIB_DIR = contrib
|
||||
PATCH_FILE = patches/oklx_genode.patch
|
||||
PATCH_UNIONFS = patches/unionfs.patch
|
||||
|
||||
VERBOSE ?= @
|
||||
ECHO = @echo
|
||||
OKLX_URL = http://wiki.ok-labs.com/downloads/release-2.1.1-patch.9
|
||||
OKLX_VERSION = oklinux_2.6.23.24
|
||||
OKLX_ARCHIVE = $(OKLX_VERSION).tar.gz
|
||||
OKLX_CONTRIB = kernel-2.6.23-v2
|
||||
|
||||
#
|
||||
# Utility to check if a tool is installed
|
||||
#
|
||||
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
|
||||
|
||||
$(call check_tool,wget)
|
||||
$(call check_tool,patch)
|
||||
$(call check_tool,sed)
|
||||
|
||||
#
|
||||
# Print help information by default
|
||||
#
|
||||
help:
|
||||
$(ECHO)
|
||||
$(ECHO) "Prepare the OKLinux repository"
|
||||
$(ECHO)
|
||||
$(ECHO) "--- available commands ---"
|
||||
$(ECHO) "prepare - download and extract the OKLinux source code"
|
||||
$(ECHO) "clean - clean everything except downloaded archives"
|
||||
$(ECHO) "cleanall - clean everything including downloaded archives"
|
||||
$(ECHO) "update-patch - updates patch to the original OKLinux code"
|
||||
$(ECHO)
|
||||
|
||||
prepare: $(CONTRIB_DIR) message
|
||||
|
||||
$(CONTRIB_DIR): $(DOWNLOAD_DIR)/$(OKLX_ARCHIVE)
|
||||
$(ECHO) "unpacking source code to '$(CONTRIB_DIR)/'"
|
||||
$(VERBOSE)tar xzf $<
|
||||
$(VERBOSE)mv $(OKLX_VERSION)/$(OKLX_CONTRIB) $@
|
||||
$(VERBOSE)rm -rf $(OKLX_VERSION)
|
||||
$(ECHO) "applying patches to '$(CONTRIB_DIR)/'"
|
||||
$(VERBOSE)patch -p0 < $(PATCH_FILE)
|
||||
$(VERBOSE)cd $(CONTRIB_DIR); patch --no-backup-if-mismatch -p1 < ../$(PATCH_UNIONFS)
|
||||
|
||||
$(DOWNLOAD_DIR)/$(OKLX_ARCHIVE):
|
||||
$(ECHO) "downloading source code to '$(DOWNLOAD_DIR)/'"
|
||||
$(VERBOSE)mkdir -p $(DOWNLOAD_DIR)
|
||||
$(VERBOSE)wget -c $(OKLX_URL)/$(OKLX_ARCHIVE) -O $@
|
||||
|
||||
message:
|
||||
$(ECHO)
|
||||
$(ECHO) "Preparation completed!"
|
||||
$(ECHO) "Now, go to your Genode build directory and type 'make oklinux'."
|
||||
$(ECHO) "Hint: don't forget to put '$(shell pwd)' "
|
||||
$(ECHO) " as a repository into your build.conf"
|
||||
$(ECHO)
|
||||
|
||||
update-patch:
|
||||
$(ECHO) "producing a new diff and save it to '$(PATCH_FILE)'"
|
||||
$(VERBOSE)cd $(CONTRIB_DIR); patch --no-backup-if-mismatch -R -p1 < ../$(PATCH_UNIONFS)
|
||||
$(VERBOSE)tar xzf $(DOWNLOAD_DIR)/$(OKLX_ARCHIVE)
|
||||
$(VERBOSE)mv $(OKLX_VERSION)/$(OKLX_CONTRIB) .
|
||||
$(VERBOSE)find $(CONTRIB_DIR) -name "*~" -delete
|
||||
$(VERBOSE)LC_COLLATE=C diff -urNpB $(OKLX_CONTRIB) $(CONTRIB_DIR) \
|
||||
| sed "s/\(^--- [^\t]*\).*/\\1/" \
|
||||
| sed "s/\(^+++ [^\t]*\).*/\\1/" \
|
||||
> $(PATCH_FILE) || true
|
||||
$(VERBOSE)rm -rf $(OKLX_CONTRIB) $(OKLX_VERSION)
|
||||
$(VERBOSE)cd $(CONTRIB_DIR); patch --no-backup-if-mismatch -p1 < ../$(PATCH_UNIONFS)
|
||||
|
||||
clean:
|
||||
$(VERBOSE)rm -rf $(CONTRIB_DIR)
|
||||
|
||||
cleanall: clean
|
||||
$(VERBOSE)rm -rf $(DOWNLOAD_DIR)
|
||||
|
@ -1,120 +0,0 @@
|
||||
This repository contains the port of OKLinux for Genode.
|
||||
|
||||
OKLinux is a para-virtualized version of Linux running on top of the
|
||||
micro-kernel OKL4. The original code uses the Iguana framework - a bunch of
|
||||
server components and libraries to simplify construction of applications
|
||||
running on top of OKL4. This package contains a small OKLinux support library,
|
||||
as well as a patch for OKLinux, that replaces Iguana by the Genode framework.
|
||||
Nevertheless, OKLinux stays to be dependent on OKL4, meaning that
|
||||
you can only use it in combination with Genode running on top of OKL4.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
If you haven't build Genode for OKL4 yet, please refer to the following documents:
|
||||
|
||||
:[http://genode.org/community/wiki/GenodeOnOKL4 - Genode on OKL4 Wiki page]:
|
||||
This Wiki page contains the information on how to build and use
|
||||
Genode with OKL4.
|
||||
|
||||
For building OKLinux for Genode, you first need to download and patch the
|
||||
original sources. The top-level makefile of this repository automates this
|
||||
task. Just issue:
|
||||
|
||||
! make prepare
|
||||
|
||||
Afterwards you need to include the OKLinux repository into the Genode build
|
||||
process. Just add the path to this directory to the 'REPOSITORIES' declaration
|
||||
of the 'etc/build.conf' file within your build directory.
|
||||
Now, you can change to your build directory and simply type:
|
||||
|
||||
! make oklinux
|
||||
|
||||
That's all. The 'bin/' directory within your build directory should now contain
|
||||
a symbolic link to the 'vmlinux' binary.
|
||||
To test your Linux binary, you also need to tweak the config file for init and
|
||||
for the elfweaver tool. You will find examples for this in the 'config/'
|
||||
directory of this repository.
|
||||
|
||||
Block, net and audio driver
|
||||
---------------------------
|
||||
|
||||
OKLinux for Genode provides special drivers, that provide network-card and
|
||||
block-device to Linux applications. They are based on the block- and nic-session
|
||||
interfaces of Genode.
|
||||
|
||||
The drivers are compiled in by default, but needs to be enabled in the
|
||||
XML configuration of OKLinux, like so:
|
||||
|
||||
! <config>
|
||||
! <block/>
|
||||
! <nic/>
|
||||
! </config>
|
||||
|
||||
The block device gets available under the name 'sda', like traditionally
|
||||
scsi, ata and sata disks under Linux. The nic is available as the first
|
||||
ethernet device 'eth0'. The audio-card is available as a simple ALSA device.
|
||||
|
||||
Kernel command line
|
||||
-------------------
|
||||
|
||||
You can state the Linux kernel command line by using the XML configuration of
|
||||
the start entry of your OKLinux instance:
|
||||
|
||||
! <config>
|
||||
! <commandline args="root=/dev/gda1"/>
|
||||
! </config>
|
||||
|
||||
Initrd
|
||||
------
|
||||
|
||||
If you need to start Linux with an initramfs, you have to provide the name of the
|
||||
archive within the config area of your Linux instance:
|
||||
|
||||
! <config>
|
||||
! <initrd name="initrd-2.6.23.gz"/>
|
||||
! </config>
|
||||
|
||||
Of course, you need to add this archive-file to the list of rom-files provided.
|
||||
|
||||
Screens
|
||||
-------
|
||||
|
||||
Genode's version of OKlinux does include a special screen driver, which maps
|
||||
framebuffer, input and/or nitpicker sessions to Linux's framebuffer device and
|
||||
input event device interfaces.
|
||||
A single screen is either a conglomerate of native framebuffer and input session,
|
||||
or framebuffer and input sessions of a nitpicker session. To enable one or more
|
||||
devices in Linux use the 'screens' section in your XML configuration:
|
||||
|
||||
! <config>
|
||||
! <screens>
|
||||
! <framebuffer/>
|
||||
! <nitpicker/>
|
||||
! </screens>
|
||||
! </config>
|
||||
|
||||
The order in the 'screens' section determine the order of visible devices in Linux.
|
||||
|
||||
Configure Linux
|
||||
---------------
|
||||
|
||||
This OKLinux package contains only a minimal Linux configuration. Especially,
|
||||
any hardware drivers are missing, as Genode/OKL4 doesn't allow direct hardware
|
||||
access from Linux. If you want to enable/disable options in Linux, you can
|
||||
simply do so by using the normal Linux build system. You will find the
|
||||
'.config' file Linux is using within the 'oklinux/' directory of your build
|
||||
directory. If you don't want to tweak '.config' directly, you can also change
|
||||
to the 'oklinux/' directory of your build directory and issue:
|
||||
|
||||
! ARCH=l4 SYSTEM=i386 make menuconfig
|
||||
|
||||
Then you will get the well known ncurses interface.
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
If you run into problems when building OKLinux and you want the build process
|
||||
to be somehow more verbose, you can build OKLinux this way:
|
||||
|
||||
! VERBOSE_LX_MK=1 make oklinux
|
@ -1,72 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE image SYSTEM "weaver-1.1.dtd">
|
||||
<image>
|
||||
<machine>
|
||||
<word_size size="0x20" />
|
||||
<virtual_memory name="virtual">
|
||||
<region base="0x120000" size="0x3fe00000" />
|
||||
</virtual_memory>
|
||||
<physical_memory name="system_dram">
|
||||
<region base="0x0" size="0xa000" type="dedicated" />
|
||||
</physical_memory>
|
||||
<physical_memory name="bios">
|
||||
<region base="0xf0000" size="0x10000" type="dedicated" />
|
||||
</physical_memory>
|
||||
<physical_memory name="rom_expansion">
|
||||
<region base="0x100000" size="0x2800000" type="dedicated" />
|
||||
</physical_memory>
|
||||
<physical_memory name="physical">
|
||||
<region base="0x3000000" size="0xaf00000" type="conventional" />
|
||||
</physical_memory>
|
||||
<phys_device name="timer_dev">
|
||||
<interrupt name="int_timer0" number="0" />
|
||||
</phys_device>
|
||||
<phys_device name="serial_dev">
|
||||
<interrupt name="int_serial0" number="4" />
|
||||
</phys_device>
|
||||
<phys_device name="rtc_dev">
|
||||
</phys_device>
|
||||
<page_size size="0x1000" />
|
||||
<page_size size="0x400000" />
|
||||
</machine>
|
||||
<physical_pool name="system_dram" direct="true">
|
||||
<memory src="system_dram" />
|
||||
</physical_pool>
|
||||
|
||||
<virtual_pool name="virtual">
|
||||
<memory src="virtual" />
|
||||
</virtual_pool>
|
||||
|
||||
<physical_pool name="bios" direct="true">
|
||||
<memory src="bios" />
|
||||
</physical_pool>
|
||||
|
||||
<physical_pool name="rom_expansion" direct="true">
|
||||
<memory src="rom_expansion" />
|
||||
</physical_pool>
|
||||
|
||||
<physical_pool name="physical" direct="true">
|
||||
<memory src="physical" />
|
||||
</physical_pool>
|
||||
|
||||
<kernel file="kernel" xip="false" >
|
||||
<dynamic max_threads="0x400" />
|
||||
<config>
|
||||
<option key="root_caps" value="4096"/>
|
||||
</config>
|
||||
</kernel>
|
||||
|
||||
<rootprogram file="core" virtpool="virtual" physpool="physical" />
|
||||
|
||||
<pd name="modules">
|
||||
<memsection name="init" file="init" direct="true" />
|
||||
<memsection name="config" file="config" direct="true" />
|
||||
<memsection name="pci_drv" file="pci_drv" direct="true" />
|
||||
<memsection name="fb_drv" file="fb_drv" direct="true" />
|
||||
<memsection name="ps2_drv" file="ps2_drv" direct="true" />
|
||||
<memsection name="timer" file="timer" direct="true" />
|
||||
<memsection name="vmlinux" file="vmlinux" direct="true" />
|
||||
<memsection name="ramdisk" file="ramdisk" direct="true" />
|
||||
</pd>
|
||||
|
||||
</image>
|
@ -1,606 +0,0 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.23-i386
|
||||
# Mon Nov 15 17:17:20 2010
|
||||
#
|
||||
CONFIG_L4=y
|
||||
CONFIG_GENERIC_HARDIRQS=y
|
||||
CONFIG_MMU=y
|
||||
CONFIG_RWSEM_GENERIC_SPINLOCK=y
|
||||
|
||||
#
|
||||
# L4/Linux-specific options
|
||||
#
|
||||
CONFIG_L4KDB_CONSOLE=y
|
||||
# CONFIG_IG_SERIAL is not set
|
||||
# CONFIG_IG_INPUT is not set
|
||||
# CONFIG_IG_MMC is not set
|
||||
# CONFIG_IG_NET is not set
|
||||
# CONFIG_IG_AUDIO is not set
|
||||
# CONFIG_FB_IGVIRTUAL is not set
|
||||
CONFIG_SCREEN_GENODE=y
|
||||
CONFIG_BLOCK_GENODE=y
|
||||
CONFIG_NET_GENODE=y
|
||||
CONFIG_GENERIC_HWEIGHT=y
|
||||
CONFIG_GENERIC_IOMAP=y
|
||||
|
||||
#
|
||||
# System selection
|
||||
#
|
||||
# CONFIG_ARCH_MIPS64 is not set
|
||||
# CONFIG_ARCH_ARM is not set
|
||||
CONFIG_ARCH_I386=y
|
||||
# CONFIG_U4600 is not set
|
||||
# CONFIG_OMAP1510 is not set
|
||||
# CONFIG_SA1100 is not set
|
||||
# CONFIG_PXA is not set
|
||||
# CONFIG_KZM is not set
|
||||
# CONFIG_IXP4XX is not set
|
||||
CONFIG_PC99=y
|
||||
# CONFIG_GENERIC_PXA25X is not set
|
||||
# CONFIG_GENERIC_PXA27X is not set
|
||||
# CONFIG_GUMSTIX is not set
|
||||
# CONFIG_IBOX is not set
|
||||
# CONFIG_PLEB2 is not set
|
||||
CONFIG_NODES_SHIFT=5
|
||||
CONFIG_L4_ZONE_SIZE=24
|
||||
# CONFIG_GENERIC_CALIBRATE_DELAY is not set
|
||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
|
||||
CONFIG_UID16=y
|
||||
CONFIG_SELECT_MEMORY_MODEL=y
|
||||
# CONFIG_FLATMEM_MANUAL is not set
|
||||
CONFIG_DISCONTIGMEM_MANUAL=y
|
||||
# CONFIG_SPARSEMEM_MANUAL is not set
|
||||
CONFIG_DISCONTIGMEM=y
|
||||
CONFIG_FLAT_NODE_MEM_MAP=y
|
||||
CONFIG_NEED_MULTIPLE_NODES=y
|
||||
# CONFIG_SPARSEMEM_STATIC is not set
|
||||
CONFIG_SPLIT_PTLOCK_CPUS=4
|
||||
# CONFIG_RESOURCES_64BIT is not set
|
||||
CONFIG_ZONE_DMA_FLAG=0
|
||||
CONFIG_VIRT_TO_BUS=y
|
||||
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
|
||||
|
||||
#
|
||||
# General setup
|
||||
#
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_BROKEN_ON_SMP=y
|
||||
CONFIG_INIT_ENV_ARG_LIMIT=32
|
||||
CONFIG_LOCALVERSION=""
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
# CONFIG_SWAP is not set
|
||||
# CONFIG_SYSVIPC is not set
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_BSD_PROCESS_ACCT_V3=y
|
||||
# CONFIG_TASKSTATS is not set
|
||||
# CONFIG_USER_NS is not set
|
||||
# CONFIG_AUDIT is not set
|
||||
# CONFIG_IKCONFIG is not set
|
||||
CONFIG_LOG_BUF_SHIFT=17
|
||||
CONFIG_SYSFS_DEPRECATED=y
|
||||
# CONFIG_RELAY is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_SYSCTL=y
|
||||
CONFIG_EMBEDDED=y
|
||||
CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_KALLSYMS=y
|
||||
# CONFIG_KALLSYMS_EXTRA_PASS is not set
|
||||
CONFIG_HOTPLUG=y
|
||||
CONFIG_PRINTK=y
|
||||
CONFIG_BUG=y
|
||||
CONFIG_ELF_CORE=y
|
||||
CONFIG_BASE_FULL=y
|
||||
CONFIG_FUTEX=y
|
||||
CONFIG_ANON_INODES=y
|
||||
CONFIG_EPOLL=y
|
||||
CONFIG_SIGNALFD=y
|
||||
CONFIG_EVENTFD=y
|
||||
# CONFIG_SHMEM is not set
|
||||
CONFIG_VM_EVENT_COUNTERS=y
|
||||
CONFIG_SLAB=y
|
||||
# CONFIG_SLUB is not set
|
||||
# CONFIG_SLOB is not set
|
||||
CONFIG_RT_MUTEXES=y
|
||||
CONFIG_TINY_SHMEM=y
|
||||
CONFIG_BASE_SMALL=0
|
||||
# CONFIG_MODULES is not set
|
||||
CONFIG_BLOCK=y
|
||||
# CONFIG_LBD is not set
|
||||
# CONFIG_BLK_DEV_IO_TRACE is not set
|
||||
# CONFIG_LSF is not set
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
|
||||
#
|
||||
# IO Schedulers
|
||||
#
|
||||
CONFIG_IOSCHED_NOOP=y
|
||||
# CONFIG_IOSCHED_AS is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
CONFIG_IOSCHED_CFQ=y
|
||||
# CONFIG_DEFAULT_AS is not set
|
||||
# CONFIG_DEFAULT_DEADLINE is not set
|
||||
CONFIG_DEFAULT_CFQ=y
|
||||
# CONFIG_DEFAULT_NOOP is not set
|
||||
CONFIG_DEFAULT_IOSCHED="cfq"
|
||||
|
||||
#
|
||||
# Generic Driver Options
|
||||
#
|
||||
CONFIG_STANDALONE=y
|
||||
CONFIG_PREVENT_FIRMWARE_BUILD=y
|
||||
# CONFIG_FW_LOADER is not set
|
||||
# CONFIG_SYS_HYPERVISOR is not set
|
||||
# CONFIG_BLK_DEV is not set
|
||||
# CONFIG_IDE is not set
|
||||
|
||||
#
|
||||
# Networking
|
||||
#
|
||||
CONFIG_NET=y
|
||||
|
||||
#
|
||||
# Networking options
|
||||
#
|
||||
CONFIG_PACKET=y
|
||||
# CONFIG_PACKET_MMAP is not set
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_XFRM=y
|
||||
# CONFIG_XFRM_USER is not set
|
||||
# CONFIG_XFRM_SUB_POLICY is not set
|
||||
# CONFIG_XFRM_MIGRATE is not set
|
||||
CONFIG_NET_KEY=y
|
||||
# CONFIG_NET_KEY_MIGRATE is not set
|
||||
CONFIG_INET=y
|
||||
# CONFIG_IP_MULTICAST is not set
|
||||
CONFIG_IP_ADVANCED_ROUTER=y
|
||||
CONFIG_ASK_IP_FIB_HASH=y
|
||||
# CONFIG_IP_FIB_TRIE is not set
|
||||
CONFIG_IP_FIB_HASH=y
|
||||
# CONFIG_IP_MULTIPLE_TABLES is not set
|
||||
# CONFIG_IP_ROUTE_MULTIPATH is not set
|
||||
# CONFIG_IP_ROUTE_VERBOSE is not set
|
||||
# CONFIG_IP_PNP is not set
|
||||
# CONFIG_NET_IPIP is not set
|
||||
# CONFIG_NET_IPGRE is not set
|
||||
# CONFIG_ARPD is not set
|
||||
# CONFIG_SYN_COOKIES is not set
|
||||
# CONFIG_INET_AH is not set
|
||||
# CONFIG_INET_ESP is not set
|
||||
# CONFIG_INET_IPCOMP is not set
|
||||
# CONFIG_INET_XFRM_TUNNEL is not set
|
||||
# CONFIG_INET_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
|
||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
CONFIG_INET_DIAG=y
|
||||
CONFIG_INET_TCP_DIAG=y
|
||||
# CONFIG_TCP_CONG_ADVANCED is not set
|
||||
CONFIG_TCP_CONG_CUBIC=y
|
||||
CONFIG_DEFAULT_TCP_CONG="cubic"
|
||||
# CONFIG_TCP_MD5SIG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_INET6_XFRM_TUNNEL is not set
|
||||
# CONFIG_INET6_TUNNEL is not set
|
||||
# CONFIG_NETWORK_SECMARK is not set
|
||||
# CONFIG_NETFILTER is not set
|
||||
# CONFIG_IP_DCCP is not set
|
||||
# CONFIG_IP_SCTP is not set
|
||||
# CONFIG_TIPC is not set
|
||||
# CONFIG_ATM is not set
|
||||
# CONFIG_BRIDGE is not set
|
||||
# CONFIG_VLAN_8021Q is not set
|
||||
# CONFIG_DECNET is not set
|
||||
# CONFIG_LLC2 is not set
|
||||
# CONFIG_IPX is not set
|
||||
# CONFIG_ATALK is not set
|
||||
# CONFIG_X25 is not set
|
||||
# CONFIG_LAPB is not set
|
||||
# CONFIG_ECONET is not set
|
||||
# CONFIG_WAN_ROUTER is not set
|
||||
|
||||
#
|
||||
# QoS and/or fair queueing
|
||||
#
|
||||
# CONFIG_NET_SCHED is not set
|
||||
|
||||
#
|
||||
# Network testing
|
||||
#
|
||||
# CONFIG_NET_PKTGEN is not set
|
||||
# CONFIG_HAMRADIO is not set
|
||||
# CONFIG_IRDA is not set
|
||||
# CONFIG_BT is not set
|
||||
# CONFIG_AF_RXRPC is not set
|
||||
|
||||
#
|
||||
# Wireless
|
||||
#
|
||||
# CONFIG_CFG80211 is not set
|
||||
# CONFIG_WIRELESS_EXT is not set
|
||||
# CONFIG_MAC80211 is not set
|
||||
# CONFIG_IEEE80211 is not set
|
||||
# CONFIG_RFKILL is not set
|
||||
# CONFIG_NET_9P is not set
|
||||
|
||||
#
|
||||
# File systems
|
||||
#
|
||||
CONFIG_EXT2_FS=y
|
||||
# CONFIG_EXT2_FS_XATTR is not set
|
||||
# CONFIG_EXT2_FS_XIP is not set
|
||||
CONFIG_EXT3_FS=y
|
||||
# CONFIG_EXT3_FS_XATTR is not set
|
||||
# CONFIG_EXT4DEV_FS is not set
|
||||
CONFIG_JBD=y
|
||||
# CONFIG_JBD_DEBUG is not set
|
||||
# CONFIG_REISERFS_FS is not set
|
||||
# CONFIG_JFS_FS is not set
|
||||
# CONFIG_FS_POSIX_ACL is not set
|
||||
# CONFIG_XFS_FS is not set
|
||||
# CONFIG_GFS2_FS is not set
|
||||
# CONFIG_OCFS2_FS is not set
|
||||
# CONFIG_MINIX_FS is not set
|
||||
# CONFIG_ROMFS_FS is not set
|
||||
# CONFIG_INOTIFY is not set
|
||||
# CONFIG_QUOTA is not set
|
||||
CONFIG_DNOTIFY=y
|
||||
# CONFIG_AUTOFS_FS is not set
|
||||
# CONFIG_AUTOFS4_FS is not set
|
||||
# CONFIG_FUSE_FS is not set
|
||||
|
||||
#
|
||||
# CD-ROM/DVD Filesystems
|
||||
#
|
||||
# CONFIG_ISO9660_FS is not set
|
||||
# CONFIG_UDF_FS is not set
|
||||
|
||||
#
|
||||
# DOS/FAT/NT Filesystems
|
||||
#
|
||||
# CONFIG_MSDOS_FS is not set
|
||||
# CONFIG_VFAT_FS is not set
|
||||
# CONFIG_NTFS_FS is not set
|
||||
|
||||
#
|
||||
# Pseudo filesystems
|
||||
#
|
||||
CONFIG_PROC_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_PROC_SYSCTL=y
|
||||
CONFIG_SYSFS=y
|
||||
# CONFIG_TMPFS is not set
|
||||
# CONFIG_HUGETLB_PAGE is not set
|
||||
CONFIG_RAMFS=y
|
||||
# CONFIG_CONFIGFS_FS is not set
|
||||
|
||||
#
|
||||
# Layered filesystems
|
||||
#
|
||||
CONFIG_UNION_FS=y
|
||||
CONFIG_UNION_FS_XATTR=y
|
||||
# CONFIG_UNION_FS_DEBUG is not set
|
||||
|
||||
#
|
||||
# Miscellaneous filesystems
|
||||
#
|
||||
# CONFIG_ADFS_FS is not set
|
||||
# CONFIG_AFFS_FS is not set
|
||||
# CONFIG_HFS_FS is not set
|
||||
# CONFIG_HFSPLUS_FS is not set
|
||||
# CONFIG_BEFS_FS is not set
|
||||
# CONFIG_BFS_FS is not set
|
||||
# CONFIG_EFS_FS is not set
|
||||
# CONFIG_CRAMFS is not set
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_HPFS_FS is not set
|
||||
# CONFIG_QNX4FS_FS is not set
|
||||
# CONFIG_SYSV_FS is not set
|
||||
# CONFIG_UFS_FS is not set
|
||||
|
||||
#
|
||||
# Network File Systems
|
||||
#
|
||||
# CONFIG_NFS_FS is not set
|
||||
# CONFIG_NFSD is not set
|
||||
# CONFIG_SMB_FS is not set
|
||||
# CONFIG_CIFS is not set
|
||||
# CONFIG_NCP_FS is not set
|
||||
# CONFIG_CODA_FS is not set
|
||||
# CONFIG_AFS_FS is not set
|
||||
|
||||
#
|
||||
# Partition Types
|
||||
#
|
||||
# CONFIG_PARTITION_ADVANCED is not set
|
||||
CONFIG_MSDOS_PARTITION=y
|
||||
|
||||
#
|
||||
# Native Language Support
|
||||
#
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_DEFAULT="utf8"
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
# CONFIG_NLS_CODEPAGE_737 is not set
|
||||
# CONFIG_NLS_CODEPAGE_775 is not set
|
||||
CONFIG_NLS_CODEPAGE_850=y
|
||||
CONFIG_NLS_CODEPAGE_852=y
|
||||
# CONFIG_NLS_CODEPAGE_855 is not set
|
||||
# CONFIG_NLS_CODEPAGE_857 is not set
|
||||
# CONFIG_NLS_CODEPAGE_860 is not set
|
||||
# CONFIG_NLS_CODEPAGE_861 is not set
|
||||
# CONFIG_NLS_CODEPAGE_862 is not set
|
||||
# CONFIG_NLS_CODEPAGE_863 is not set
|
||||
# CONFIG_NLS_CODEPAGE_864 is not set
|
||||
# CONFIG_NLS_CODEPAGE_865 is not set
|
||||
# CONFIG_NLS_CODEPAGE_866 is not set
|
||||
# CONFIG_NLS_CODEPAGE_869 is not set
|
||||
# CONFIG_NLS_CODEPAGE_936 is not set
|
||||
# CONFIG_NLS_CODEPAGE_950 is not set
|
||||
# CONFIG_NLS_CODEPAGE_932 is not set
|
||||
# CONFIG_NLS_CODEPAGE_949 is not set
|
||||
# CONFIG_NLS_CODEPAGE_874 is not set
|
||||
# CONFIG_NLS_ISO8859_8 is not set
|
||||
CONFIG_NLS_CODEPAGE_1250=y
|
||||
# CONFIG_NLS_CODEPAGE_1251 is not set
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_ISO8859_2=y
|
||||
# CONFIG_NLS_ISO8859_3 is not set
|
||||
# CONFIG_NLS_ISO8859_4 is not set
|
||||
# CONFIG_NLS_ISO8859_5 is not set
|
||||
# CONFIG_NLS_ISO8859_6 is not set
|
||||
# CONFIG_NLS_ISO8859_7 is not set
|
||||
# CONFIG_NLS_ISO8859_9 is not set
|
||||
# CONFIG_NLS_ISO8859_13 is not set
|
||||
# CONFIG_NLS_ISO8859_14 is not set
|
||||
# CONFIG_NLS_ISO8859_15 is not set
|
||||
# CONFIG_NLS_KOI8_R is not set
|
||||
# CONFIG_NLS_KOI8_U is not set
|
||||
CONFIG_NLS_UTF8=y
|
||||
|
||||
#
|
||||
# Distributed Lock Manager
|
||||
#
|
||||
# CONFIG_DLM is not set
|
||||
# CONFIG_OKL4FS is not set
|
||||
# CONFIG_MMC is not set
|
||||
|
||||
#
|
||||
# Executable file formats
|
||||
#
|
||||
CONFIG_BINFMT_ELF=y
|
||||
# CONFIG_BINFMT_MISC is not set
|
||||
|
||||
#
|
||||
# Bus options (PCI)
|
||||
#
|
||||
# CONFIG_PCI is not set
|
||||
# CONFIG_ARCH_SUPPORTS_MSI is not set
|
||||
# CONFIG_MCA is not set
|
||||
# CONFIG_PARPORT is not set
|
||||
# CONFIG_MISC_DEVICES is not set
|
||||
|
||||
#
|
||||
# SCSI device support
|
||||
#
|
||||
# CONFIG_RAID_ATTRS is not set
|
||||
# CONFIG_SCSI is not set
|
||||
# CONFIG_SCSI_DMA is not set
|
||||
# CONFIG_SCSI_NETLINK is not set
|
||||
# CONFIG_ATA is not set
|
||||
# CONFIG_MD is not set
|
||||
# CONFIG_MTD is not set
|
||||
|
||||
#
|
||||
# Input device support
|
||||
#
|
||||
CONFIG_INPUT=y
|
||||
# CONFIG_INPUT_FF_MEMLESS is not set
|
||||
# CONFIG_INPUT_POLLDEV is not set
|
||||
|
||||
#
|
||||
# Userland interfaces
|
||||
#
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
# CONFIG_INPUT_JOYDEV is not set
|
||||
# CONFIG_INPUT_TSDEV is not set
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
# CONFIG_INPUT_EVBUG is not set
|
||||
|
||||
#
|
||||
# Input Device Drivers
|
||||
#
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_INPUT_JOYSTICK is not set
|
||||
# CONFIG_INPUT_TABLET is not set
|
||||
# CONFIG_INPUT_TOUCHSCREEN is not set
|
||||
# CONFIG_INPUT_MISC is not set
|
||||
|
||||
#
|
||||
# Hardware I/O ports
|
||||
#
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_GAMEPORT is not set
|
||||
|
||||
#
|
||||
# Character devices
|
||||
#
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
# CONFIG_VT_HW_CONSOLE_BINDING is not set
|
||||
# CONFIG_SERIAL_NONSTANDARD is not set
|
||||
|
||||
#
|
||||
# Serial drivers
|
||||
#
|
||||
# CONFIG_SERIAL_8250 is not set
|
||||
|
||||
#
|
||||
# Non-8250 serial port support
|
||||
#
|
||||
CONFIG_UNIX98_PTYS=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_IPMI_HANDLER is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_R3964 is not set
|
||||
|
||||
#
|
||||
# PCMCIA character devices
|
||||
#
|
||||
# CONFIG_RAW_DRIVER is not set
|
||||
# CONFIG_TCG_TPM is not set
|
||||
|
||||
#
|
||||
# Graphics support
|
||||
#
|
||||
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Display device support
|
||||
#
|
||||
# CONFIG_DISPLAY_SUPPORT is not set
|
||||
# CONFIG_VGASTATE is not set
|
||||
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
|
||||
CONFIG_FB=y
|
||||
# CONFIG_FIRMWARE_EDID is not set
|
||||
# CONFIG_FB_DDC is not set
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
# CONFIG_FB_SYS_FILLRECT is not set
|
||||
# CONFIG_FB_SYS_COPYAREA is not set
|
||||
# CONFIG_FB_SYS_IMAGEBLIT is not set
|
||||
# CONFIG_FB_SYS_FOPS is not set
|
||||
CONFIG_FB_DEFERRED_IO=y
|
||||
# CONFIG_FB_SVGALIB is not set
|
||||
# CONFIG_FB_MACMODES is not set
|
||||
# CONFIG_FB_BACKLIGHT is not set
|
||||
CONFIG_FB_MODE_HELPERS=y
|
||||
CONFIG_FB_TILEBLITTING=y
|
||||
|
||||
#
|
||||
# Frame buffer hardware drivers
|
||||
#
|
||||
# CONFIG_FB_S1D13XXX is not set
|
||||
# CONFIG_FB_VIRTUAL is not set
|
||||
|
||||
#
|
||||
# Console display driver support
|
||||
#
|
||||
CONFIG_VGA_CONSOLE=y
|
||||
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||
# CONFIG_FONTS is not set
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_LOGO_LINUX_MONO=y
|
||||
CONFIG_LOGO_LINUX_VGA16=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
# CONFIG_NETDEVICES is not set
|
||||
# CONFIG_HID_SUPPORT is not set
|
||||
# CONFIG_HWMON is not set
|
||||
|
||||
#
|
||||
# Multimedia devices
|
||||
#
|
||||
# CONFIG_VIDEO_DEV is not set
|
||||
# CONFIG_DVB_CORE is not set
|
||||
# CONFIG_DAB is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_NEW_LEDS is not set
|
||||
|
||||
#
|
||||
# Sound
|
||||
#
|
||||
CONFIG_SOUND=y
|
||||
|
||||
#
|
||||
# Advanced Linux Sound Architecture
|
||||
#
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_TIMER=y
|
||||
CONFIG_SND_PCM=y
|
||||
# CONFIG_SND_SEQUENCER is not set
|
||||
CONFIG_SND_OSSEMUL=y
|
||||
CONFIG_SND_MIXER_OSS=y
|
||||
CONFIG_SND_PCM_OSS=y
|
||||
# CONFIG_SND_PCM_OSS_PLUGINS is not set
|
||||
# CONFIG_SND_DYNAMIC_MINORS is not set
|
||||
CONFIG_SND_SUPPORT_OLD_API=y
|
||||
CONFIG_SND_VERBOSE_PROCFS=y
|
||||
# CONFIG_SND_VERBOSE_PRINTK is not set
|
||||
# CONFIG_SND_DEBUG is not set
|
||||
|
||||
#
|
||||
# Generic devices
|
||||
#
|
||||
# CONFIG_SND_DUMMY is not set
|
||||
# CONFIG_SND_MTPAV is not set
|
||||
# CONFIG_SND_SERIAL_U16550 is not set
|
||||
# CONFIG_SND_MPU401 is not set
|
||||
|
||||
#
|
||||
# System on Chip audio support
|
||||
#
|
||||
# CONFIG_SND_SOC is not set
|
||||
|
||||
#
|
||||
# SoC Audio support for SuperH
|
||||
#
|
||||
|
||||
#
|
||||
# Open Sound System
|
||||
#
|
||||
# CONFIG_SOUND_PRIME is not set
|
||||
# CONFIG_I2C is not set
|
||||
|
||||
#
|
||||
# Security options
|
||||
#
|
||||
# CONFIG_KEYS is not set
|
||||
# CONFIG_SECURITY is not set
|
||||
# CONFIG_CRYPTO is not set
|
||||
|
||||
#
|
||||
# Library routines
|
||||
#
|
||||
CONFIG_BITREVERSE=y
|
||||
# CONFIG_CRC_CCITT is not set
|
||||
# CONFIG_CRC16 is not set
|
||||
# CONFIG_CRC_ITU_T is not set
|
||||
CONFIG_CRC32=y
|
||||
# CONFIG_CRC7 is not set
|
||||
# CONFIG_LIBCRC32C is not set
|
||||
CONFIG_PLIST=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT=y
|
||||
CONFIG_HAS_DMA=y
|
||||
|
||||
#
|
||||
# Kernel hacking
|
||||
#
|
||||
# CONFIG_PRINTK_TIME is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
# CONFIG_MAGIC_SYSRQ is not set
|
||||
# CONFIG_UNUSED_SYMBOLS is not set
|
||||
# CONFIG_DEBUG_FS is not set
|
||||
# CONFIG_HEADERS_CHECK is not set
|
||||
# CONFIG_DEBUG_KERNEL is not set
|
||||
# CONFIG_EARLY_PRINTK is not set
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* \brief Oklx's framebuffer driver for Genode ioctl interface
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2010-04-23
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLX_KERNEL__OKLX__IOCTL_H_
|
||||
#define _INCLUDE__OKLX_KERNEL__OKLX__IOCTL_H_
|
||||
|
||||
struct genode_screen_region
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
};
|
||||
|
||||
struct genode_view_place
|
||||
{
|
||||
int view;
|
||||
struct genode_screen_region reg;
|
||||
};
|
||||
|
||||
struct genode_view_stack
|
||||
{
|
||||
int view;
|
||||
int neighbor;
|
||||
int behind;
|
||||
};
|
||||
|
||||
enum Ioctl_nums {
|
||||
NITPICKER_IOCTL_CREATE_VIEW = _IOW('F', 11, int),
|
||||
NITPICKER_IOCTL_DESTROY_VIEW = _IOW('F', 12, int),
|
||||
NITPICKER_IOCTL_BACK_VIEW = _IOW('F', 13, int),
|
||||
NITPICKER_IOCTL_PLACE_VIEW = _IOW('F', 14, struct genode_view_place),
|
||||
NITPICKER_IOCTL_STACK_VIEW = _IOW('F', 15, struct genode_view_stack),
|
||||
FRAMEBUFFER_IOCTL_REFRESH = _IOW('F', 16, struct genode_screen_region)
|
||||
};
|
||||
|
||||
#endif //_INCLUDE__OKLX_KERNEL__OKLX__IOCTL_H_
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API audio functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-11-09
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__AUDIO_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__AUDIO_H_
|
||||
|
||||
int genode_audio_ready(void);
|
||||
|
||||
void genode_audio_collect_acks(void);
|
||||
|
||||
void genode_audio_trigger_start(void (*func)(unsigned long), unsigned long data);
|
||||
|
||||
void genode_audio_trigger_stop(void);
|
||||
|
||||
void genode_audio_prepare(void);
|
||||
|
||||
unsigned long genode_audio_position(void);
|
||||
|
||||
void genode_audio_write(void* src, unsigned long sz);
|
||||
|
||||
void genode_audio_fill_silence(unsigned long sz);
|
||||
|
||||
unsigned int genode_audio_packet_size(void);
|
||||
|
||||
unsigned int genode_audio_packet_count(void);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__AUDIO_H_
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API block driver related functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2010-07-08
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__BLOCK_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__BLOCK_H_
|
||||
|
||||
void genode_block_register_callback(void (*func)(void*, short,
|
||||
void*, unsigned long));
|
||||
|
||||
void genode_block_geometry(unsigned long *blk_cnt, unsigned long *blk_sz,
|
||||
int *writeable, unsigned long *req_queue_sz);
|
||||
|
||||
void* genode_block_request(unsigned long sz, void *req, unsigned long *offset);
|
||||
|
||||
void genode_block_submit(unsigned long queue_offset, unsigned long size,
|
||||
unsigned long disc_offset, int write);
|
||||
|
||||
void genode_block_collect_responses(void);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__BLOCK_H_
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API configuration related functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-07-08
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__CONFIG_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__CONFIG_H_
|
||||
|
||||
/**
|
||||
* Get the kernel command line
|
||||
*/
|
||||
char* genode_config_cmdline(void);
|
||||
|
||||
/**
|
||||
* Get name of initrd file
|
||||
*/
|
||||
char* genode_config_initrd(void);
|
||||
|
||||
/**
|
||||
* Returns whether audio driver should be used, or not.
|
||||
*/
|
||||
int genode_config_audio(void);
|
||||
|
||||
/**
|
||||
* Returns whether nic driver should be used, or not.
|
||||
*/
|
||||
int genode_config_nic(void);
|
||||
|
||||
/**
|
||||
* Returns whether block driver should be used, or not.
|
||||
*/
|
||||
int genode_config_block(void);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__CONFIG_H_
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API exit function needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-08-14
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009
|
||||
* Genode Labs, Feske & Helmuth Systementwicklung GbR
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__EXIT_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__EXIT_H_
|
||||
|
||||
/**
|
||||
* Tell parent to exit the program
|
||||
*/
|
||||
void genode_exit(int value);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__EXIT_H_
|
@ -1,85 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API framebuffer/input functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-06-08
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLX_LIB__GENODE__FRAMEBUFFER_H_
|
||||
#define _INCLUDE__OKLX_LIB__GENODE__FRAMEBUFFER_H_
|
||||
|
||||
/**
|
||||
* Returns the count of screens (framebuffer + input devices)
|
||||
* given by config-file information
|
||||
*/
|
||||
int genode_screen_count(void);
|
||||
|
||||
/**
|
||||
* Get the size of the framebuffer
|
||||
*
|
||||
* \param screen the index of the framebuffer
|
||||
* \return the size
|
||||
*/
|
||||
unsigned long genode_fb_size(unsigned int screen);
|
||||
|
||||
/**
|
||||
* Attach the framebuffer to our address space
|
||||
*
|
||||
* \param screen the index of the framebuffer
|
||||
* \return the virtual address the framebuffer was attached to
|
||||
*/
|
||||
void *genode_fb_attach(unsigned int screen);
|
||||
|
||||
/**
|
||||
* Get information about the resolution of the framebuffer
|
||||
*
|
||||
* \param screen the index of the framebuffer
|
||||
* \param out_w resulting pointer to the horizontal resolution info
|
||||
* \param out_h resulting pointer to the vertical resolution info
|
||||
*/
|
||||
void genode_fb_info(unsigned int screen, int *out_w, int *out_h);
|
||||
|
||||
/**
|
||||
* Refresh a specified area of the framebuffer
|
||||
*
|
||||
* \param screen the index of the framebuffer
|
||||
* \param x x-coordinate of the area's position
|
||||
* \param y y-coordinate of the area's position
|
||||
* \param w width of the area
|
||||
* \param h height of the area
|
||||
*/
|
||||
void genode_fb_refresh(unsigned int screen, int x, int y, int w, int h);
|
||||
|
||||
/**
|
||||
* Close the framebuffer session
|
||||
*
|
||||
* \param screen the index of the framebuffer
|
||||
*/
|
||||
void genode_fb_close(unsigned screen);
|
||||
|
||||
int genode_nit_view_create(unsigned screen, unsigned view);
|
||||
|
||||
void genode_nit_view_destroy(unsigned screen, unsigned view);
|
||||
|
||||
void genode_nit_view_back(unsigned screen, unsigned view);
|
||||
|
||||
void genode_nit_view_place(unsigned screen, unsigned view, int x,
|
||||
int y, int w, int h);
|
||||
|
||||
void genode_nit_view_stack(unsigned int screen, unsigned view,
|
||||
unsigned neighbor, int behind);
|
||||
|
||||
/**
|
||||
* Close all views of a nitpicker session
|
||||
*
|
||||
* \param screen the index of the framebuffer
|
||||
*/
|
||||
void genode_nit_close_all_views(unsigned screen);
|
||||
|
||||
#endif //_INCLUDE__OKLX_LIB__GENODE__FRAMEBUFFER_H_
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API input functions
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2010-04-22
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLX_LIB__GENODE__INPUT_H_
|
||||
#define _INCLUDE__OKLX_LIB__GENODE__INPUT_H_
|
||||
|
||||
void genode_input_register_callback(void (*genode_input_event)
|
||||
(void*,unsigned int, unsigned int, int));
|
||||
|
||||
void genode_input_unregister_callback(void);
|
||||
|
||||
void genode_input_register_keyb(unsigned int idx, void* dev);
|
||||
|
||||
void genode_input_register_mouse(unsigned int idx, void* dev);
|
||||
|
||||
void genode_input_unregister_keyb(unsigned int idx);
|
||||
|
||||
void genode_input_unregister_mouse(unsigned int idx);
|
||||
|
||||
void genode_input_handle_events(void);
|
||||
|
||||
#endif //_INCLUDE__OKLX_LIB__GENODE__INPUT_H_
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API lock functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-08-17
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__LOCK_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__LOCK_H_
|
||||
|
||||
/**
|
||||
* Allocate a lock
|
||||
*
|
||||
* \return virtual address of the lock
|
||||
*/
|
||||
void *genode_alloc_lock(void);
|
||||
|
||||
/**
|
||||
* Free a lock
|
||||
*
|
||||
* \param lock_addr virtual address of the lock
|
||||
*/
|
||||
void genode_free_lock(void* lock_addr);
|
||||
|
||||
/**
|
||||
* Lock the lock
|
||||
*
|
||||
* \param lock_addr virtual address of the lock
|
||||
*/
|
||||
void genode_lock(void* lock_addr);
|
||||
|
||||
/**
|
||||
* Unlock the lock
|
||||
*
|
||||
* \param lock_addr virtual address of the lock
|
||||
*/
|
||||
void genode_unlock(void* lock_addr);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__LOCK_H_
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API memory functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__MEMORY_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__MEMORY_H_
|
||||
|
||||
/**
|
||||
* Allocate memory from the heap
|
||||
*
|
||||
* \param sz amount of memory
|
||||
* \return virtual address of the allocated memory area
|
||||
*/
|
||||
void *genode_malloc(unsigned long sz);
|
||||
|
||||
/**
|
||||
* Set the invoking thread as the pager of newly started Linux user processes
|
||||
*/
|
||||
void genode_set_pager(void);
|
||||
|
||||
/**
|
||||
* Get the absolute maximum of RAM Linux is allowed to consume
|
||||
*/
|
||||
unsigned long genode_quota(void);
|
||||
|
||||
/**
|
||||
* Get the actual used portion of RAM
|
||||
*/
|
||||
unsigned long genode_used_mem(void);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__MEMORY_H_
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API network functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-09-10
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLX_LIB__GENODE__NET_H_
|
||||
#define _INCLUDE__OKLX_LIB__GENODE__NET_H_
|
||||
|
||||
int genode_net_ready (void);
|
||||
void genode_net_start (void *dev, void (*func)(void*, void*, unsigned long));
|
||||
void genode_net_stop (void);
|
||||
void genode_net_mac (void* mac_addr, unsigned long size);
|
||||
int genode_net_tx (void* addr, unsigned long len, void *skb);
|
||||
int genode_net_tx_ack_avail(void);
|
||||
void* genode_net_tx_ack (void);
|
||||
void genode_net_rx_receive (void);
|
||||
|
||||
#endif /* _INCLUDE__OKLX_LIB__GENODE__NET_H_ */
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API file functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__OPEN_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__OPEN_H_
|
||||
|
||||
/**
|
||||
* Opens a file and attach it (read-only) to the address-space
|
||||
*
|
||||
* \param name name of the file
|
||||
* \param sz resulting pointer to the size of the opened file
|
||||
* \return virtual address of the attached file
|
||||
*/
|
||||
void *genode_open(const char *name, unsigned long *sz);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__OPEN_H_
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API print functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__PRINT_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__PRINT_H_
|
||||
|
||||
/**
|
||||
* Prints a message via Genode's log session mechanism
|
||||
*/
|
||||
void genode_printf(const char *format, ...);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__PRINT_H_
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API sleep functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__GENODE__SLEEP_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__GENODE__SLEEP_H_
|
||||
|
||||
/**
|
||||
* Sleep for a given period of time
|
||||
*
|
||||
* \param ms milliseconds to sleep
|
||||
*/
|
||||
void genode_sleep(unsigned ms);
|
||||
|
||||
/**
|
||||
* Sleep forever, never wake up again
|
||||
*/
|
||||
void genode_sleep_forever(void);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__GENODE__SLEEP_H_
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*
|
||||
* This file contains function definitions to create/destroy address spaces,
|
||||
* threads within other address spaces and to populate the address spaces
|
||||
* with pages.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__EAS_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__EAS_H_
|
||||
|
||||
#include <iguana/types.h>
|
||||
|
||||
typedef uintptr_t eas_ref_t; /* Address space id corresponds to OKL4 space id*/
|
||||
|
||||
/**
|
||||
* Create a thread within another address space
|
||||
*
|
||||
* \param eas identifier of the target address space
|
||||
* \param pager thread id of the new thread's pager
|
||||
* \param scheduler thread id of the new thread's scheduler
|
||||
* \param utcb address of utcb of the new thread
|
||||
* \param handle_rv resulting pointer to the id of the new thread
|
||||
* \return id of the new thread
|
||||
*/
|
||||
L4_ThreadId_t eas_create_thread(eas_ref_t eas, L4_ThreadId_t pager,
|
||||
L4_ThreadId_t scheduler, void *utcb,
|
||||
L4_ThreadId_t *handle_rv);
|
||||
|
||||
/**
|
||||
* Create a new address space
|
||||
*
|
||||
* \param utcb defines utcb region of the address space
|
||||
* \param l4_id resulting pointer to the id of the new address space
|
||||
* \return id of the new address space
|
||||
*/
|
||||
eas_ref_t eas_create(L4_Fpage_t utcb, L4_SpaceId_t *l4_id);
|
||||
|
||||
/**
|
||||
* Deletes an address space
|
||||
*
|
||||
* \param eas identifier of the target address space
|
||||
*/
|
||||
void eas_delete(eas_ref_t eas);
|
||||
|
||||
/**
|
||||
* Map a page area to an address space
|
||||
*
|
||||
* \param eas identifier of the target address space
|
||||
* \param src_fpage flexpage describing the area to be mapped
|
||||
* \param dst_addr destination address where the area will be mapped to
|
||||
* \param attributes describes the caching policy (OKL4 manual)
|
||||
*/
|
||||
int eas_map(eas_ref_t eas, L4_Fpage_t src_fpage,
|
||||
uintptr_t dst_addr, uintptr_t attributes);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__EAS_H_
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__HARDWARE_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__HARDWARE_H_
|
||||
|
||||
#include <iguana/types.h>
|
||||
|
||||
/**
|
||||
* Register thread as interrupt handler
|
||||
*
|
||||
* \param thrd thread id of the interrupt handler
|
||||
* \param interrupt interrupt number
|
||||
* \return 0 if no error occured
|
||||
*/
|
||||
int hardware_register_interrupt(L4_ThreadId_t thrd, int interrupt);
|
||||
|
||||
/**
|
||||
* Register physical memory region
|
||||
*
|
||||
* \param memsection describes virtual memory area
|
||||
* \param paddr physical address backing the memory area
|
||||
* \param attributes caching policy
|
||||
* \return 0 if no error occured
|
||||
*/
|
||||
int hardware_back_memsection(memsection_ref_t memsection,
|
||||
uintptr_t paddr, uintptr_t attributes);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__HARDWARE_H_
|
@ -1,110 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__MEMSECTION_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__MEMSECTION_H_
|
||||
|
||||
#include <iguana/types.h>
|
||||
|
||||
/**
|
||||
* Get physical address of the given virtual one
|
||||
*
|
||||
* \param vaddr the virtual address
|
||||
* \param size resulting pointer to the size of the corresponding area
|
||||
* \return the requested physical address
|
||||
*/
|
||||
uintptr_t memsection_virt_to_phys(uintptr_t vaddr, size_t *size);
|
||||
|
||||
/**
|
||||
* Establish mapping to virtual memory area
|
||||
*
|
||||
* \param memsect the target memory area
|
||||
* \param from_page flexpage describing the source memory area
|
||||
* \param to_page flexpage describing the virtual memory area
|
||||
* \return 0 if no error occurred
|
||||
*/
|
||||
int memsection_page_map(memsection_ref_t memsect,
|
||||
L4_Fpage_t from_page,
|
||||
L4_Fpage_t to_page);
|
||||
|
||||
/**
|
||||
* Destroy mapping to virtual memory area
|
||||
*
|
||||
* \param memsect the target memory area
|
||||
* \param to_page flexpage describing the virtual memory area
|
||||
* \return 0 if no error occurred
|
||||
*/
|
||||
int memsection_page_unmap(memsection_ref_t memsect,
|
||||
L4_Fpage_t to_page);
|
||||
|
||||
/**
|
||||
* Register pager of a memory area
|
||||
*
|
||||
* \param memsect the target memory area
|
||||
* \param server the pager's thread id
|
||||
* \return 0 if no error occurred
|
||||
*/
|
||||
int memsection_register_server(memsection_ref_t memsect,
|
||||
thread_ref_t server);
|
||||
|
||||
/**
|
||||
* Lookup pager of an object
|
||||
*
|
||||
* \param object reference to object
|
||||
* \param server resulting pointer to object's pager
|
||||
* \return memory area id, object is part of
|
||||
*/
|
||||
memsection_ref_t memsection_lookup(objref_t object, thread_ref_t *server);
|
||||
|
||||
/**
|
||||
* Get base address of a memory area
|
||||
*
|
||||
* \param memsect memory area id
|
||||
* \return base address of the memory area
|
||||
*/
|
||||
void *memsection_base(memsection_ref_t memsect);
|
||||
|
||||
/**
|
||||
* Get size of a memory area
|
||||
*
|
||||
* \param memsect memory area id
|
||||
* \return size of the memory area
|
||||
*/
|
||||
uintptr_t memsection_size(memsection_ref_t memsect);
|
||||
|
||||
/**
|
||||
* Create a blank memory area
|
||||
*
|
||||
* \param size size of the area
|
||||
* \param base base address of the area
|
||||
* \return memory area id
|
||||
*/
|
||||
memsection_ref_t memsection_create_user(uintptr_t size, uintptr_t *base);
|
||||
|
||||
/**
|
||||
* Delete a memory area
|
||||
*
|
||||
* \param memsect memory area id
|
||||
*/
|
||||
void memsection_delete(memsection_ref_t);
|
||||
|
||||
/**
|
||||
* Create a blank memory area
|
||||
*
|
||||
* \param size size of the area
|
||||
* \param base base address of the area
|
||||
* \param memsect memory area id
|
||||
*/
|
||||
memsection_ref_t memsection_create(uintptr_t size, uintptr_t *base);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__MEMSECTION_H_
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__PD_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__PD_H_
|
||||
|
||||
#include <iguana/types.h>
|
||||
|
||||
typedef int pd_ref_t; /* protection domain id */
|
||||
|
||||
/**
|
||||
* Get my protection domain
|
||||
*
|
||||
* \return protection domain id
|
||||
*/
|
||||
pd_ref_t pd_myself(void);
|
||||
|
||||
|
||||
/**
|
||||
* Delete protection domain
|
||||
*
|
||||
* \param pd protection domain id
|
||||
*/
|
||||
void pd_delete(pd_ref_t pd);
|
||||
|
||||
/**
|
||||
* Create memory area for protection domain
|
||||
*
|
||||
* \param pd protection domain id
|
||||
* \param size size of new memory area
|
||||
* \param base base address of new memory area
|
||||
* \return memory area id
|
||||
*/
|
||||
memsection_ref_t pd_create_memsection(pd_ref_t pd, uintptr_t size,
|
||||
uintptr_t *base);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__PD_H_
|
@ -1,20 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__STDINT_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__STDINT_H_
|
||||
|
||||
typedef long intptr_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__STDINT_H_
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__THREAD_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__THREAD_H_
|
||||
|
||||
#include <iguana/types.h>
|
||||
|
||||
/**
|
||||
* Initializes the Iguana library
|
||||
*
|
||||
* \param obj_env resulting pointer to the iguana environment object
|
||||
*/
|
||||
void __lib_iguana_init(uintptr_t *obj_env);
|
||||
|
||||
/**
|
||||
* Create a new thread in this address space
|
||||
*
|
||||
* \param thrd resulting pointer to the thread id of the new thread
|
||||
* \return Iguana thread id of the new thread
|
||||
*/
|
||||
thread_ref_t thread_create(L4_ThreadId_t *thrd);
|
||||
|
||||
/**
|
||||
* Get OKL4 thread id from the Iguana thread id
|
||||
*
|
||||
* \param server Iguana thread id
|
||||
* \return OKL4 thread id requested
|
||||
*/
|
||||
L4_ThreadId_t thread_l4tid(thread_ref_t server);
|
||||
|
||||
/**
|
||||
* Get the Iguana thread id of the active thread
|
||||
*
|
||||
* \return Iguana thread id
|
||||
*/
|
||||
thread_ref_t thread_myself(void);
|
||||
|
||||
/**
|
||||
* Delete a thread within the same address space
|
||||
*
|
||||
* \param thrd iguana thread id of the thread to be deleted
|
||||
*/
|
||||
void thread_delete(L4_ThreadId_t thrd);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__THREAD_H_
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__TLS_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__TLS_H_
|
||||
|
||||
/**
|
||||
* Initialize thread local storage for the actual thread
|
||||
*
|
||||
* \param tls_buffer buffer for the actual thread
|
||||
*/
|
||||
void __tls_init(void *tls_buffer);
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__TLS_H_
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Norman Feske
|
||||
* \date 2009-04-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OKLINUX_SUPPORT__IGUANA__TYPES_H_
|
||||
#define _INCLUDE__OKLINUX_SUPPORT__IGUANA__TYPES_H_
|
||||
|
||||
#include <l4/types.h>
|
||||
#include <iguana/stdint.h>
|
||||
|
||||
typedef uintptr_t memsection_ref_t; /* Iguana memory area id */
|
||||
typedef uintptr_t cap_t; /* Iguana capability */
|
||||
typedef L4_Word_t thread_ref_t; /* Iguana thread id corresponds to OKL4 id */
|
||||
typedef uintptr_t objref_t; /* Iguana object reference */
|
||||
|
||||
#endif //_INCLUDE__OKLINUX_SUPPORT__IGUANA__TYPES_H_
|
@ -1,31 +0,0 @@
|
||||
#
|
||||
# OKLinux support library
|
||||
#
|
||||
SRC_CC = genode_block.cc \
|
||||
genode_config.cc \
|
||||
genode_exit.cc \
|
||||
genode_framebuffer.cc \
|
||||
genode_input.cc \
|
||||
genode_lock.cc \
|
||||
genode_memory.cc \
|
||||
genode_net.cc \
|
||||
genode_threads.cc \
|
||||
genode_open.cc \
|
||||
genode_printf.cc \
|
||||
genode_sleep.cc
|
||||
SRC_CC += iguana_eas.cc \
|
||||
iguana_hardware.cc \
|
||||
iguana_memsection.cc \
|
||||
iguana_pd.cc \
|
||||
iguana_thread.cc \
|
||||
iguana_tls.cc
|
||||
INC_DIR += $(REP_DIR)/include/oklx_lib
|
||||
INC_DIR += $(REP_DIR)/src/lib/oklx/include
|
||||
LIBS = base config
|
||||
|
||||
# do not produce position-independent code
|
||||
CC_OPT_PIC =
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/lib/oklx/genode
|
||||
vpath %.cc $(REP_DIR)/src/lib/oklx/iguana
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,104 +0,0 @@
|
||||
#
|
||||
# Build
|
||||
#
|
||||
|
||||
if {[have_spec okl4] == 0} {
|
||||
puts "Runs on OKL4 only"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# generic components
|
||||
set build_components {
|
||||
core
|
||||
init
|
||||
drivers/timer
|
||||
drivers/pci
|
||||
drivers/framebuffer/vesa
|
||||
drivers/input/ps2
|
||||
server/rom_loopdev
|
||||
oklinux
|
||||
}
|
||||
|
||||
build $build_components
|
||||
create_boot_directory
|
||||
|
||||
|
||||
#
|
||||
# Config
|
||||
#
|
||||
|
||||
set config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="RAM"/>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="CAP"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="SIGNAL"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<start name="pci_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="PCI"/></provides>
|
||||
</start>
|
||||
<start name="fb_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Framebuffer"/></provides>
|
||||
<config><!--<preinit/>--></config>
|
||||
</start>
|
||||
<start name="ps2_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Input"/></provides>
|
||||
</start>
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
<start name="rom_loopdev">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Block"/></provides>
|
||||
<config file="tinycore.img" block_size="512"/>
|
||||
</start>
|
||||
<start name="vmlinux">
|
||||
<resource name="RAM" quantum="256M"/>
|
||||
<config>
|
||||
<commandline args="root=/dev/sda host=tinycore"/>
|
||||
<initrd name="initrd.gz"/>
|
||||
<screens><framebuffer/></screens>
|
||||
<block/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
|
||||
#
|
||||
# Boot modules
|
||||
#
|
||||
|
||||
set boot_modules { }
|
||||
|
||||
# basic binaries
|
||||
lappend boot_modules "core init"
|
||||
|
||||
# drivers
|
||||
lappend boot_modules "pci_drv fb_drv ps2_drv timer rom_loopdev"
|
||||
|
||||
# oklinux
|
||||
lappend boot_modules "vmlinux initrd.gz tinycore.img"
|
||||
|
||||
build_boot_image [join $boot_modules " "]
|
||||
|
||||
append qemu_args " -m 512 "
|
||||
|
||||
run_genode_until forever
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* \brief Bounding box collects different refresh ops and combines them.
|
||||
* \author Norman Feske
|
||||
* \date 2009-11-03
|
||||
*
|
||||
* taken from Xvfb display application for Nitpicker
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _APP__XEV_TRACK__BOUNDING_BOX_H_
|
||||
#define _APP__XEV_TRACK__BOUNDING_BOX_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/misc_math.h>
|
||||
|
||||
class Bounding_box
|
||||
{
|
||||
private:
|
||||
|
||||
int _x1, _y1, _x2, _y2;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Bounding_box() { reset(); }
|
||||
|
||||
bool valid() { return _x1 <= _x2 && _y1 <= _y2; }
|
||||
|
||||
void reset() { _x1 = 0, _y1 = 0, _x2 = -1, _y2 = -1; }
|
||||
|
||||
void extend(int x, int y, int w, int h)
|
||||
{
|
||||
int nx2 = x + w - 1;
|
||||
int ny2 = y + h - 1;
|
||||
|
||||
if (!valid()) {
|
||||
_x1 = x, _y1 = y, _x2 = x + w - 1, _y2 = y + h - 1;
|
||||
} else {
|
||||
_x1 = Genode::min(_x1, x);
|
||||
_y1 = Genode::min(_y1, y);
|
||||
_x2 = Genode::max(_x2, nx2);
|
||||
_y2 = Genode::max(_y2, ny2);
|
||||
}
|
||||
}
|
||||
|
||||
int x() { return _x1; }
|
||||
int y() { return _y1; }
|
||||
int w() { return _x2 - _x1 + 1; }
|
||||
int h() { return _y2 - _y1 + 1; }
|
||||
};
|
||||
|
||||
#endif //_APP__XEV_TRACK__BOUNDING_BOX_H_
|
@ -1,187 +0,0 @@
|
||||
/*
|
||||
* \brief X event tracker, sending X11 events via ioctl to OKlinux's screen driver
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2010-04-27
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Standard includes */
|
||||
#include <stdio.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* X11 includes */
|
||||
#include <X11/XWDFile.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
/* X event-tracker includes */
|
||||
#include <xev_track/xev_track.h>
|
||||
|
||||
/* OKlinux kernel includes */
|
||||
#include <oklx/ioctl.h>
|
||||
|
||||
/* App-specific includes */
|
||||
#include "bounding_box.h"
|
||||
|
||||
int config_force_top = 1; /* evaluated by the X event-tracker library */
|
||||
int nitpicker_fd = -1; /* nitpicker screen device file-descriptor */
|
||||
static Bounding_box pending_redraw; /* collects refresh operations */
|
||||
|
||||
|
||||
/**
|
||||
* C++ wrapper around C struct 'genode_screen_region'
|
||||
*/
|
||||
struct Genode_screen_region : public genode_screen_region
|
||||
{
|
||||
Genode_screen_region() { }
|
||||
Genode_screen_region(int ix, int iy, int iw, int ih) {
|
||||
x = ix, y = iy, w = iw, h = ih; }
|
||||
|
||||
bool operator != (Genode_screen_region &r) {
|
||||
return x != r.x || y != r.y || w != r.w || h != r.h; }
|
||||
};
|
||||
|
||||
|
||||
struct View_state
|
||||
{
|
||||
Genode_screen_region flushed; /* last flushed view position */
|
||||
Genode_screen_region curr; /* current view position */
|
||||
|
||||
bool to_be_flushed() { return flushed != curr; }
|
||||
};
|
||||
|
||||
|
||||
static View_state view_states[MAX_VIEWS];
|
||||
|
||||
|
||||
static bool view_id_is_valid(int view_id) {
|
||||
return view_id > 0 && view_id < MAX_VIEWS; }
|
||||
|
||||
|
||||
/*******************************
|
||||
** X event-tracker callbacks **
|
||||
*******************************/
|
||||
|
||||
void create_view(int view_id) {
|
||||
if(ioctl(nitpicker_fd, NITPICKER_IOCTL_CREATE_VIEW, view_id))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void destroy_view(int view_id) {
|
||||
if(ioctl(nitpicker_fd, NITPICKER_IOCTL_DESTROY_VIEW, view_id))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void set_background_view(int view_id) {
|
||||
if(ioctl(nitpicker_fd, NITPICKER_IOCTL_BACK_VIEW, view_id))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void place_view(int view_id, int x, int y, int w, int h) {
|
||||
if (view_id_is_valid(view_id))
|
||||
view_states[view_id].curr = Genode_screen_region(x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
void stack_view(int view_id, int neighbor_id, bool behind) {
|
||||
struct genode_view_stack st = { view_id, neighbor_id, behind };
|
||||
if(ioctl(nitpicker_fd, NITPICKER_IOCTL_STACK_VIEW, &st))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void refresh(int x, int y, int w, int h)
|
||||
{
|
||||
pending_redraw.extend(x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
static void flush(int x, int y, int width, int height)
|
||||
{
|
||||
if (width <= 0 || height <= 0) return;
|
||||
|
||||
struct genode_screen_region reg = { x, y, width, height };
|
||||
if(ioctl(nitpicker_fd, FRAMEBUFFER_IOCTL_REFRESH, ®))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
|
||||
for (int i = 0; i < MAX_VIEWS; i++) {
|
||||
if (!view_states[i].to_be_flushed()) continue;
|
||||
|
||||
struct genode_view_place place = { i, view_states[i].curr };
|
||||
if(ioctl(nitpicker_fd, NITPICKER_IOCTL_PLACE_VIEW, &place))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
|
||||
view_states[i].flushed = view_states[i].curr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void flush_view_placements()
|
||||
{
|
||||
for (int i = 0; i < MAX_VIEWS; i++) {
|
||||
if (!view_states[i].to_be_flushed()) continue;
|
||||
|
||||
struct genode_view_place place = { i, view_states[i].curr };
|
||||
if(ioctl(nitpicker_fd, NITPICKER_IOCTL_PLACE_VIEW, &place))
|
||||
printf("An error occured! errno=%d\n", errno);
|
||||
|
||||
view_states[i].flushed = view_states[i].curr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main program
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
/* create connection to the X server */
|
||||
Display *dpy = XOpenDisplay(":0");
|
||||
if (!dpy) {
|
||||
printf("Error: Cannot open display\n");
|
||||
return -4;
|
||||
}
|
||||
|
||||
/* open nitpicker screen device */
|
||||
if((nitpicker_fd = open("/dev/fb1", O_WRONLY)) < 0)
|
||||
return -7;
|
||||
|
||||
/* init event tracker library */
|
||||
if (!xev_track_init(dpy))
|
||||
return -6;
|
||||
|
||||
/* busy loop polls X events */
|
||||
for (;;) {
|
||||
pending_redraw.reset();
|
||||
|
||||
XEvent ev;
|
||||
while (XPending(dpy)) {
|
||||
XNextEvent(dpy, &ev);
|
||||
xev_track_handle_event(dpy, ev);
|
||||
}
|
||||
|
||||
flush_view_placements();
|
||||
xev_track_handle_cursor(dpy);
|
||||
|
||||
if (pending_redraw.valid())
|
||||
flush(pending_redraw.x(), pending_redraw.y(),
|
||||
pending_redraw.w(), pending_redraw.h());
|
||||
|
||||
usleep(10000);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
TARGET = xevent-tracker
|
||||
REQUIRES = host x11 xtest xdamage
|
||||
SRC_CC = main.cc
|
||||
LIBS = xev_track
|
||||
EXT_OBJECTS += -lX11 -lXdamage /usr/lib/libXtst.so.6
|
||||
INC_DIR += $(REP_DIR)/include/oklx_kernel
|
@ -1,303 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API audio functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-11-12
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/allocator_avl.h>
|
||||
#include <base/printf.h>
|
||||
#include <audio_out_session/connection.h>
|
||||
|
||||
extern "C" {
|
||||
#include <genode/config.h>
|
||||
}
|
||||
|
||||
static unsigned long stream_data = 0;
|
||||
static void (*interrupt_handler)(unsigned long) = 0;
|
||||
|
||||
class Audio_cache
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Audio_out::Session::Channel::Source Stream;
|
||||
|
||||
enum Channels { LEFT, RIGHT, CHANNEL };
|
||||
|
||||
enum {
|
||||
FRAME_SIZE_OUT = Audio_out::FRAME_SIZE,
|
||||
FRAME_SIZE_IN = sizeof(Genode::int16_t),
|
||||
PACKET_SIZE_OUT = FRAME_SIZE_OUT * Audio_out::PERIOD,
|
||||
PACKET_SIZE_IN = FRAME_SIZE_IN * Audio_out::PERIOD * CHANNEL,
|
||||
PACKET_CNT_MAX = Audio_out::QUEUE_SIZE - 1,
|
||||
BUF_SIZE = PACKET_CNT_MAX * PACKET_SIZE_OUT + 0x400
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
class Entry
|
||||
{
|
||||
private:
|
||||
|
||||
Stream *_stream;
|
||||
Packet_descriptor _descriptor; /* packet stream descriptor */
|
||||
bool _ready; /* ready to submit */
|
||||
bool _submitted; /* submitted to hardware */
|
||||
|
||||
public:
|
||||
|
||||
Entry(Stream *stream)
|
||||
: _stream(stream), _descriptor(_stream->alloc_packet(PACKET_SIZE_OUT)),
|
||||
_ready(false), _submitted(false) {}
|
||||
|
||||
Entry() : _ready(false), _submitted(false) { }
|
||||
|
||||
~Entry() {}
|
||||
|
||||
Packet_descriptor descriptor() { return _descriptor; }
|
||||
|
||||
float* content() {
|
||||
return _stream->packet_content(_descriptor); }
|
||||
|
||||
void submit(bool delay=false)
|
||||
{
|
||||
_ready = true;
|
||||
if(interrupt_handler && !_submitted && !delay) {
|
||||
_submitted = true;
|
||||
_stream->submit_packet(_descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
bool submitted() { return _submitted; }
|
||||
|
||||
bool ready() { return _ready; }
|
||||
|
||||
void acknowledge()
|
||||
{
|
||||
_submitted = false;
|
||||
_ready = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Genode::Allocator_avl _alloc_left;
|
||||
Genode::Allocator_avl _alloc_right;
|
||||
Audio_out::Connection _left;
|
||||
Audio_out::Connection _right;
|
||||
Entry _entries[CHANNEL][PACKET_CNT_MAX];
|
||||
unsigned _idx[CHANNEL];
|
||||
Genode::size_t _offset;
|
||||
unsigned _hw_pointer[CHANNEL];
|
||||
|
||||
Stream *_stream(unsigned channel) {
|
||||
return channel == LEFT ? _left.stream() : _right.stream(); }
|
||||
|
||||
public:
|
||||
|
||||
Audio_cache() : _alloc_left(Genode::env()->heap()),
|
||||
_alloc_right(Genode::env()->heap()),
|
||||
_left("front left", &_alloc_left, BUF_SIZE),
|
||||
_right("front right", &_alloc_right, BUF_SIZE)
|
||||
{
|
||||
for (unsigned ch=LEFT; ch < CHANNEL; ch++) {
|
||||
for (unsigned i = 0; i < PACKET_CNT_MAX; i++)
|
||||
_entries[ch][i] = Entry(_stream(ch));
|
||||
_idx[ch] = 0;
|
||||
_hw_pointer[ch] = 0;
|
||||
}
|
||||
_offset = 0;
|
||||
_right.sync_session(_left.session_capability());
|
||||
}
|
||||
|
||||
~Audio_cache()
|
||||
{
|
||||
for (unsigned ch=LEFT; ch < CHANNEL; ch++)
|
||||
for (unsigned i = 0; i < PACKET_CNT_MAX; i++)
|
||||
_stream(ch)->release_packet(_entries[ch][i].descriptor());
|
||||
}
|
||||
|
||||
void write (void *src, Genode::size_t size)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
/* The actual packet should not be in use */
|
||||
for (unsigned ch=0; ch < CHANNEL; ch++)
|
||||
if (_entries[ch][_idx[ch]].submitted()) {
|
||||
PERR("Error: (un-)acknowledged packet chan=%d idx=%d",
|
||||
ch, _idx[ch]);
|
||||
}
|
||||
|
||||
short *src_ptr = (short*)src;
|
||||
while (size) {
|
||||
/* Use left space in packet or content-size */
|
||||
size_t packet_space =
|
||||
min<size_t>(size / CHANNEL / FRAME_SIZE_IN * FRAME_SIZE_OUT,
|
||||
PACKET_SIZE_OUT - _offset);
|
||||
|
||||
for (unsigned chan=0; chan < CHANNEL; chan++) {
|
||||
float *dest = _entries[chan][_idx[chan]].content()
|
||||
+ (_offset / FRAME_SIZE_OUT);
|
||||
for (unsigned frame = 0; frame < packet_space / FRAME_SIZE_OUT;
|
||||
frame++)
|
||||
dest[frame] = src_ptr[(frame * CHANNEL) + chan] / 32767.0;
|
||||
}
|
||||
|
||||
/* If packet is full, submit it and switch to next one */
|
||||
if ((_offset + packet_space) == PACKET_SIZE_OUT) {
|
||||
for (unsigned chan=0; chan < CHANNEL; chan++) {
|
||||
_entries[chan][_idx[chan]].submit(true);
|
||||
_idx[chan] = (_idx[chan] + 1) % PACKET_CNT_MAX;
|
||||
}
|
||||
_offset = 0;
|
||||
} else
|
||||
_offset += packet_space;
|
||||
src_ptr += (packet_space / FRAME_SIZE_OUT) * CHANNEL;
|
||||
size -= packet_space / FRAME_SIZE_OUT * FRAME_SIZE_IN * CHANNEL;
|
||||
}
|
||||
}
|
||||
|
||||
void submit_all()
|
||||
{
|
||||
for (unsigned i = 0; i < PACKET_CNT_MAX; i++) {
|
||||
for (unsigned ch = 0; ch < CHANNEL; ch++) {
|
||||
if (_entries[ch][i].ready() && !_entries[ch][i].submitted())
|
||||
_entries[ch][i].submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void flush() {
|
||||
_left.flush();
|
||||
_right.flush();
|
||||
|
||||
for (unsigned i = 0; i < PACKET_CNT_MAX; i++) {
|
||||
for (unsigned ch = 0; ch < CHANNEL; ch++) {
|
||||
if (_entries[ch][i].submitted())
|
||||
_stream(ch)->get_acked_packet();
|
||||
_entries[ch][i].acknowledge();
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned ch = 0; ch < CHANNEL; ch++) {
|
||||
_idx[ch] = 0;
|
||||
_hw_pointer[ch] = 0;
|
||||
}
|
||||
_offset = 0;
|
||||
}
|
||||
|
||||
void acknowledge()
|
||||
{
|
||||
bool acked = false;
|
||||
for (unsigned ch = 0; ch < CHANNEL; ch++) {
|
||||
if (_stream(ch)->ack_avail()) {
|
||||
_stream(ch)->get_acked_packet();
|
||||
|
||||
for (unsigned i = _idx[ch]; ;
|
||||
i = (i + 1) % PACKET_CNT_MAX) {
|
||||
if (_entries[ch][i].submitted()) {
|
||||
_entries[ch][i].acknowledge();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_hw_pointer[ch]++;
|
||||
acked = true;
|
||||
}
|
||||
}
|
||||
if (acked)
|
||||
interrupt_handler(stream_data);
|
||||
}
|
||||
|
||||
Genode::size_t pointer()
|
||||
{
|
||||
using namespace Genode;
|
||||
Genode::size_t size = min<size_t>(_hw_pointer[LEFT], _hw_pointer[RIGHT]);
|
||||
return size * Audio_cache::PACKET_SIZE_OUT * CHANNEL
|
||||
/ FRAME_SIZE_OUT * FRAME_SIZE_IN ;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static Audio_cache *audio_cache(void)
|
||||
{
|
||||
try {
|
||||
static Audio_cache _cache;
|
||||
return &_cache;
|
||||
} catch(...) {}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Genode::uint8_t zeroes[Audio_cache::PACKET_SIZE_IN];
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <genode/audio.h>
|
||||
|
||||
int genode_audio_ready()
|
||||
{
|
||||
return genode_config_audio() && audio_cache();
|
||||
}
|
||||
|
||||
|
||||
void genode_audio_collect_acks()
|
||||
{
|
||||
if (!interrupt_handler)
|
||||
return;
|
||||
audio_cache()->submit_all();
|
||||
audio_cache()->acknowledge();
|
||||
}
|
||||
|
||||
|
||||
void genode_audio_prepare()
|
||||
{
|
||||
audio_cache()->flush();
|
||||
}
|
||||
|
||||
|
||||
void genode_audio_trigger_start(void (*func)(unsigned long), unsigned long data)
|
||||
{
|
||||
interrupt_handler = func;
|
||||
stream_data = data;
|
||||
}
|
||||
|
||||
|
||||
void genode_audio_trigger_stop()
|
||||
{
|
||||
interrupt_handler = 0;
|
||||
stream_data = 0;
|
||||
audio_cache()->flush();
|
||||
}
|
||||
|
||||
|
||||
unsigned long genode_audio_position()
|
||||
{
|
||||
unsigned long ret = audio_cache()->pointer();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void genode_audio_write(void* src, unsigned long sz)
|
||||
{
|
||||
audio_cache()->write(src, sz);
|
||||
}
|
||||
|
||||
|
||||
void genode_audio_fill_silence(unsigned long sz)
|
||||
{
|
||||
audio_cache()->write(&zeroes, sz);
|
||||
}
|
||||
|
||||
|
||||
unsigned int genode_audio_packet_size() { return Audio_cache::PACKET_SIZE_IN; }
|
||||
|
||||
|
||||
unsigned int genode_audio_packet_count() { return Audio_cache::PACKET_CNT_MAX; }
|
||||
|
||||
} // extern "C"
|
@ -1,179 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API config functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*
|
||||
* OKLinux includes several stub drivers, used as frontends to the Genode
|
||||
* framework, e.g. framebuffer-driver or rom-file block-driver.
|
||||
* Due to the strong bond of these drivers with the Genode framework,
|
||||
* they should be configured using Genode's configuration format and
|
||||
* not the kernel commandline.
|
||||
* A valid configuration example can be found in 'config/init_config'
|
||||
* within this repository.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/env.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/allocator_avl.h>
|
||||
#include <block_session/connection.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <genode/block.h>
|
||||
#include <genode/config.h>
|
||||
}
|
||||
|
||||
class Req_cache
|
||||
{
|
||||
private:
|
||||
|
||||
class Req_entry
|
||||
{
|
||||
public:
|
||||
|
||||
void *pkt;
|
||||
void *req;
|
||||
|
||||
Req_entry() : pkt(0), req(0) {}
|
||||
Req_entry(void *packet, void *request)
|
||||
: pkt(packet), req(request) {}
|
||||
};
|
||||
|
||||
|
||||
enum { MAX = 128 };
|
||||
|
||||
Req_entry _cache[MAX];
|
||||
|
||||
int _find(void *packet)
|
||||
{
|
||||
for (int i=0; i < MAX; i++)
|
||||
if (_cache[i].pkt == packet)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void insert(void *packet, void *request)
|
||||
{
|
||||
int idx = _find(0);
|
||||
if (idx < 0)
|
||||
PERR("Req cache is full!");
|
||||
else
|
||||
_cache[idx] = Req_entry(packet, request);
|
||||
}
|
||||
|
||||
void remove(void *packet, void **request)
|
||||
{
|
||||
int idx = _find(packet);
|
||||
|
||||
if (idx < 0) {
|
||||
*request = 0;
|
||||
PERR("Req cache entry not found!");
|
||||
}
|
||||
*request = _cache[idx].req;
|
||||
_cache[idx].pkt = 0;
|
||||
_cache[idx].req = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
enum Dimensions {
|
||||
TX_BUF_SIZE = 1024 * 1024
|
||||
};
|
||||
|
||||
|
||||
static void (*end_request)(void*, short, void*, unsigned long) = 0;
|
||||
static Genode::size_t blk_size = 0;
|
||||
static Genode::size_t blk_cnt = 0;
|
||||
static Block::Session::Operations blk_ops;
|
||||
|
||||
|
||||
static Req_cache *cache()
|
||||
{
|
||||
static Req_cache _cache;
|
||||
return &_cache;
|
||||
}
|
||||
|
||||
|
||||
static Block::Connection *session()
|
||||
{
|
||||
static Genode::Allocator_avl _alloc(Genode::env()->heap());
|
||||
static Block::Connection _session(&_alloc, TX_BUF_SIZE);
|
||||
return &_session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
void genode_block_register_callback(void (*func)(void*, short,
|
||||
void*, unsigned long))
|
||||
{
|
||||
end_request = func;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
genode_block_geometry(unsigned long *cnt, unsigned long *sz,
|
||||
int *write, unsigned long *queue_sz)
|
||||
{
|
||||
if (!blk_size && !blk_cnt)
|
||||
session()->info(&blk_cnt, &blk_size, &blk_ops);
|
||||
*cnt = blk_cnt;
|
||||
*sz = blk_size;
|
||||
*queue_sz = session()->tx()->bulk_buffer_size();
|
||||
*write = blk_ops.supported(Block::Packet_descriptor::WRITE) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
void* genode_block_request(unsigned long sz, void *req, unsigned long *offset)
|
||||
{
|
||||
try {
|
||||
Block::Packet_descriptor p = session()->tx()->alloc_packet(sz);
|
||||
void *addr = session()->tx()->packet_content(p);
|
||||
cache()->insert(addr, req);
|
||||
*offset = p.offset();
|
||||
return addr;
|
||||
} catch (Block::Session::Tx::Source::Packet_alloc_failed) { }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void genode_block_submit(unsigned long queue_offset, unsigned long size,
|
||||
unsigned long disc_offset, int write)
|
||||
{
|
||||
Genode::size_t sector = disc_offset / blk_size;
|
||||
Genode::size_t sector_cnt = size / blk_size;
|
||||
Block::Packet_descriptor p(Block::Packet_descriptor(queue_offset, size),
|
||||
write ? Block::Packet_descriptor::WRITE
|
||||
: Block::Packet_descriptor::READ,
|
||||
sector, sector_cnt);
|
||||
session()->tx()->submit_packet(p);
|
||||
}
|
||||
|
||||
|
||||
void genode_block_collect_responses()
|
||||
{
|
||||
static bool avail = genode_config_block();
|
||||
if (avail) {
|
||||
void *req;
|
||||
while (session()->tx()->ack_avail()) {
|
||||
Block::Packet_descriptor packet = session()->tx()->get_acked_packet();
|
||||
void *addr = session()->tx()->packet_content(packet);
|
||||
bool write = packet.operation() == Block::Packet_descriptor::WRITE;
|
||||
cache()->remove(session()->tx()->packet_content(packet), &req);
|
||||
if (req && end_request)
|
||||
end_request(req, write, addr, packet.size());
|
||||
session()->tx()->release_packet(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
@ -1,145 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API config functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*
|
||||
* OKLinux includes several stub drivers, used as frontends to the Genode
|
||||
* framework, e.g. framebuffer-driver or rom-file block-driver.
|
||||
* Due to the strong bond of these drivers with the Genode framework,
|
||||
* they should be configured using Genode's configuration format and
|
||||
* not the kernel commandline.
|
||||
* A valid configuration example can be found in 'config/init_config'
|
||||
* within this repository.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/env.h>
|
||||
#include <os/config.h>
|
||||
|
||||
#include <oklx_screens.h>
|
||||
|
||||
|
||||
static Genode::Xml_node node(const char* name)
|
||||
{
|
||||
Genode::Xml_node config_node = Genode::config()->xml_node();
|
||||
|
||||
for (unsigned i = 0; i < config_node.num_sub_nodes(); i++) {
|
||||
Genode::Xml_node node = config_node.sub_node(i);
|
||||
if(node.has_type(name))
|
||||
return node;
|
||||
}
|
||||
throw Genode::Xml_node::Nonexistent_sub_node();
|
||||
}
|
||||
|
||||
|
||||
static void content(const char* node_name, const char *attr_name,
|
||||
char *buf, Genode::size_t sz)
|
||||
{
|
||||
*buf = 0;
|
||||
try {
|
||||
Genode::Xml_node _node = node(node_name);
|
||||
_node.attribute(attr_name).value(buf, sz);
|
||||
} catch (Genode::Xml_node::Invalid_syntax) {
|
||||
PWRN("Malformed entry in Linux config.");
|
||||
} catch (...) { }
|
||||
}
|
||||
|
||||
|
||||
Screen_array::Screen_array()
|
||||
{
|
||||
try {
|
||||
Genode::Xml_node scr_node = node("screens");
|
||||
for (unsigned i = 0; i < SIZE; i++) {
|
||||
if (i >= scr_node.num_sub_nodes())
|
||||
_screens[i] = (Screen*) 0;
|
||||
else {
|
||||
Genode::Xml_node n = scr_node.sub_node(i);
|
||||
if(n.has_type("framebuffer"))
|
||||
_screens[i] = new (Genode::env()->heap()) Simple_screen();
|
||||
else if(n.has_type("nitpicker"))
|
||||
_screens[i] = new (Genode::env()->heap()) Nitpicker_screen();
|
||||
else
|
||||
PWRN("Ignoring unknown tag in screen section");
|
||||
}
|
||||
}
|
||||
} catch (Genode::Xml_node::Invalid_syntax) {
|
||||
PWRN("Malformed entry in Linux config.");
|
||||
} catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
PWRN("No screen section in config");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <genode/config.h>
|
||||
|
||||
char* genode_config_cmdline()
|
||||
{
|
||||
static char cmd_line[512];
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
content("commandline", "args", cmd_line, sizeof(cmd_line));
|
||||
initialized = true;
|
||||
}
|
||||
return Genode::strlen(cmd_line) ? cmd_line : 0;
|
||||
}
|
||||
|
||||
|
||||
char* genode_config_initrd()
|
||||
{
|
||||
static char initrd[64];
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
content("initrd", "name", initrd, sizeof(initrd));
|
||||
initialized = true;
|
||||
}
|
||||
return Genode::strlen(initrd) ? initrd : 0;
|
||||
}
|
||||
|
||||
|
||||
int genode_config_audio()
|
||||
{
|
||||
try {
|
||||
node("audio");
|
||||
return 1;
|
||||
} catch (Genode::Xml_node::Invalid_syntax) {
|
||||
PWRN("Malformed entry in Linux config.");
|
||||
} catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int genode_config_nic()
|
||||
{
|
||||
try {
|
||||
node("nic");
|
||||
return 1;
|
||||
} catch (Genode::Xml_node::Invalid_syntax) {
|
||||
PWRN("Malformed entry in Linux config.");
|
||||
} catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int genode_config_block()
|
||||
{
|
||||
try {
|
||||
node("block");
|
||||
return 1;
|
||||
} catch (Genode::Xml_node::Invalid_syntax) {
|
||||
PWRN("Malformed entry in Linux config.");
|
||||
} catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API exit function needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-08-14
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009
|
||||
* Genode Labs, Feske & Helmuth Systementwicklung GbR
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
namespace Okl4 {
|
||||
#include <genode/exit.h>
|
||||
}
|
||||
|
||||
void genode_exit(int value)
|
||||
{
|
||||
Genode::env()->parent()->exit(1);
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,174 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API framebuffer functions of the OKLinux support library
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-06-08
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/env.h>
|
||||
#include <dataspace/client.h>
|
||||
#include <dataspace/client.h>
|
||||
#include <framebuffer_session/connection.h>
|
||||
#include <nitpicker_view/client.h>
|
||||
|
||||
/* Oklx library includes */
|
||||
#include <oklx_memory_maps.h>
|
||||
#include <oklx_screens.h>
|
||||
|
||||
|
||||
Screen_array* Screen_array::screens()
|
||||
{
|
||||
static Screen_array _screens;
|
||||
return &_screens;
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
namespace Okl4 {
|
||||
#include <genode/framebuffer.h>
|
||||
}
|
||||
|
||||
using namespace Okl4;
|
||||
|
||||
|
||||
int genode_screen_count()
|
||||
{
|
||||
return Screen_array::screens()->count();
|
||||
}
|
||||
|
||||
|
||||
unsigned long genode_fb_size(unsigned screen)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(screen);
|
||||
if (s && s->framebuffer()) {
|
||||
Genode::Dataspace_client dsc(s->framebuffer()->dataspace());
|
||||
return dsc.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void *genode_fb_attach(unsigned screen)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
Screen *s = Screen_array::screens()->get(screen);
|
||||
if (!s || !s->framebuffer())
|
||||
return (void*) 0;
|
||||
|
||||
/* Attach the framebuffer */
|
||||
Dataspace_capability cap = s->framebuffer()->dataspace();
|
||||
Dataspace_client dsc(cap);
|
||||
void* base = Genode::env()->rm_session()->attach(cap);
|
||||
size_t size = dsc.size();
|
||||
|
||||
/* Put the framebuffer area in our database*/
|
||||
Memory_area::memory_map()->insert(new (env()->heap())
|
||||
Memory_area((addr_t)base, size, cap));
|
||||
return (void*)base;
|
||||
}
|
||||
|
||||
|
||||
void genode_fb_info(unsigned screen, int *out_w, int *out_h)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(screen);
|
||||
if (s && s->framebuffer()) {
|
||||
Framebuffer::Mode const mode = s->framebuffer()->mode();
|
||||
*out_w = mode.width();
|
||||
*out_h = mode.height();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void genode_fb_refresh(unsigned screen, int x, int y, int w, int h)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(screen);
|
||||
if (s && s->framebuffer())
|
||||
s->framebuffer()->refresh(x,y,w,h);
|
||||
}
|
||||
|
||||
|
||||
void genode_fb_close(unsigned screen)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(screen);
|
||||
if (s)
|
||||
destroy(Genode::env()->heap(), s);
|
||||
}
|
||||
|
||||
|
||||
void genode_nit_view_create(unsigned screen, unsigned view)
|
||||
{
|
||||
Nitpicker_screen *s =
|
||||
dynamic_cast<Nitpicker_screen*>(Screen_array::screens()->get(screen));
|
||||
if (s)
|
||||
s->put_view(view, s->nitpicker()->create_view());
|
||||
}
|
||||
|
||||
|
||||
void genode_nit_view_destroy(unsigned screen, unsigned view)
|
||||
{
|
||||
Nitpicker_screen *s =
|
||||
dynamic_cast<Nitpicker_screen*>(Screen_array::screens()->get(screen));
|
||||
if (s) {
|
||||
s->nitpicker()->destroy_view(s->get_view(view));
|
||||
s->put_view(view, Nitpicker::View_capability());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void genode_nit_view_back(unsigned screen, unsigned view)
|
||||
{
|
||||
Nitpicker_screen *s =
|
||||
dynamic_cast<Nitpicker_screen*>(Screen_array::screens()->get(screen));
|
||||
if (s)
|
||||
s->nitpicker()->background(s->get_view(view));
|
||||
}
|
||||
|
||||
void genode_nit_view_place(unsigned screen, unsigned view,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
Nitpicker_screen *s =
|
||||
dynamic_cast<Nitpicker_screen*>(Screen_array::screens()->get(screen));
|
||||
if (s) {
|
||||
Nitpicker::View_client v(s->get_view(view));
|
||||
v.viewport(x, y, w, h, -x, -y, false);
|
||||
}
|
||||
}
|
||||
|
||||
void genode_nit_view_stack(unsigned screen, unsigned view,
|
||||
unsigned neighbor, int behind)
|
||||
{
|
||||
Nitpicker_screen *s =
|
||||
dynamic_cast<Nitpicker_screen*>(Screen_array::screens()->get(screen));
|
||||
if (s) {
|
||||
Nitpicker::View_client v(s->get_view(view));
|
||||
v.stack(s->get_view(neighbor), behind, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void genode_nit_close_all_views(unsigned screen)
|
||||
{
|
||||
Nitpicker_screen *s =
|
||||
dynamic_cast<Nitpicker_screen*>(Screen_array::screens()->get(screen));
|
||||
if(s) {
|
||||
for (unsigned i = 0; i < Nitpicker_screen::VIEW_CNT; i++) {
|
||||
Nitpicker::View_capability n = s->get_view(i);
|
||||
if (n.valid()) {
|
||||
s->nitpicker()->destroy_view(n);
|
||||
s->put_view(i, Nitpicker::View_capability());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,153 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API input functions for the OKLinux support libary
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2010-04-21
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
#include <input_session/connection.h>
|
||||
#include <input/event.h>
|
||||
#include <input/keycodes.h>
|
||||
|
||||
/* OKLx library includes */
|
||||
#include <oklx_memory_maps.h>
|
||||
#include <oklx_screens.h>
|
||||
|
||||
enum Event_types {EV_SYN=0x00, EV_KEY=0x01, EV_REL=0x02, EV_ABS=0x03 };
|
||||
enum Relative_axes {REL_X=0x00, REL_Y=0x01, REL_WHEEL=0x08 };
|
||||
enum Absolute_axes {ABS_X=0x00, ABS_Y=0x01, ABS_WHEEL=0x08 };
|
||||
|
||||
extern "C" {
|
||||
namespace Okl4 {
|
||||
#include <genode/input.h>
|
||||
}
|
||||
|
||||
using namespace Okl4;
|
||||
|
||||
static void (*genode_input_event) (void*,unsigned int, unsigned int, int) = 0;
|
||||
|
||||
|
||||
void genode_input_register_callback(void (*func)
|
||||
(void*,unsigned int, unsigned int, int))
|
||||
{
|
||||
genode_input_event = func;
|
||||
}
|
||||
|
||||
|
||||
void genode_input_unregister_callback(void)
|
||||
{
|
||||
genode_input_event = 0;
|
||||
}
|
||||
|
||||
|
||||
void genode_input_register_keyb(unsigned int idx, void* dev)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(idx);
|
||||
if(s)
|
||||
s->keyb_device(dev);
|
||||
}
|
||||
|
||||
|
||||
void genode_input_unregister_keyb(unsigned int idx)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(idx);
|
||||
if(s)
|
||||
s->keyb_device(0);
|
||||
}
|
||||
|
||||
|
||||
void genode_input_register_mouse(unsigned int idx, void* dev)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(idx);
|
||||
if(s)
|
||||
s->mouse_device(dev);
|
||||
}
|
||||
|
||||
|
||||
void genode_input_unregister_mouse(unsigned int idx)
|
||||
{
|
||||
Screen *s = Screen_array::screens()->get(idx);
|
||||
if(s)
|
||||
s->mouse_device(0);
|
||||
}
|
||||
|
||||
|
||||
static void handle_event(void *mouse, void *keyb, Input::Event *ev)
|
||||
{
|
||||
using namespace Input;
|
||||
|
||||
switch(ev->type()) {
|
||||
case Event::MOTION:
|
||||
{
|
||||
if(ev->rx())
|
||||
genode_input_event(mouse, EV_REL, REL_X, ev->rx());
|
||||
if(ev->ry())
|
||||
genode_input_event(mouse, EV_REL, REL_Y, ev->ry());
|
||||
if(ev->ax())
|
||||
genode_input_event(mouse, EV_ABS, ABS_X, ev->ax());
|
||||
if(ev->ay())
|
||||
genode_input_event(mouse, EV_ABS, ABS_Y, ev->ay());
|
||||
return;
|
||||
}
|
||||
case Event::PRESS:
|
||||
{
|
||||
if (ev->code() < BTN_MISC)
|
||||
genode_input_event(keyb, EV_KEY, ev->code(), 1);
|
||||
else
|
||||
genode_input_event(mouse, EV_KEY, ev->code(), 1);
|
||||
return;
|
||||
}
|
||||
case Event::RELEASE:
|
||||
{
|
||||
if (ev->code() < BTN_MISC)
|
||||
genode_input_event(keyb, EV_KEY, ev->code(), 0);
|
||||
else
|
||||
genode_input_event(mouse, EV_KEY, ev->code(), 0);
|
||||
return;
|
||||
}
|
||||
case Event::WHEEL:
|
||||
{
|
||||
if(ev->rx())
|
||||
genode_input_event(mouse, EV_REL, REL_WHEEL, ev->rx());
|
||||
else
|
||||
genode_input_event(mouse, EV_ABS, ABS_WHEEL, ev->ax());
|
||||
return;
|
||||
}
|
||||
case Event::INVALID:
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void genode_input_handle_events(void)
|
||||
{
|
||||
if (!genode_input_event)
|
||||
return;
|
||||
|
||||
for (unsigned i = 0; i < Screen_array::SIZE; i++) {
|
||||
Screen *s = Screen_array::screens()->get(i);
|
||||
if (!s)
|
||||
break;
|
||||
|
||||
Input::Session *inp = s->input();
|
||||
if (inp && s->mouse_device() && s->keyb_device() ) {
|
||||
int num = inp->flush();
|
||||
for (int i = 0; i < num; i++) {
|
||||
Input::Event *ev = &s->buffer()[i];
|
||||
handle_event(s->mouse_device(),
|
||||
s->keyb_device(), ev);
|
||||
}
|
||||
}
|
||||
s = s->next();
|
||||
}
|
||||
}
|
||||
} //extern "C"
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API memory functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/lock.h>
|
||||
#include <base/env.h>
|
||||
#include <base/allocator.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
namespace Okl4 {
|
||||
#include <genode/lock.h>
|
||||
}
|
||||
|
||||
void *genode_alloc_lock()
|
||||
{
|
||||
return new (Genode::env()->heap()) Genode::Lock();
|
||||
}
|
||||
|
||||
|
||||
void genode_free_lock(void* lock)
|
||||
{
|
||||
if(lock)
|
||||
Genode::destroy<Genode::Lock>(Genode::env()->heap(),
|
||||
static_cast<Genode::Lock*>(lock));
|
||||
}
|
||||
|
||||
|
||||
void genode_lock(void* lock)
|
||||
{
|
||||
if(lock)
|
||||
static_cast<Genode::Lock*>(lock)->lock();
|
||||
}
|
||||
|
||||
|
||||
void genode_unlock(void* lock)
|
||||
{
|
||||
if(lock)
|
||||
static_cast<Genode::Lock*>(lock)->unlock();
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API memory functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/env.h>
|
||||
|
||||
/* local includes */
|
||||
#include <oklx_memory_maps.h>
|
||||
#include <oklx_threads.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
namespace Okl4 {
|
||||
#include <genode/memory.h>
|
||||
#include <l4/kdebug.h>
|
||||
}
|
||||
|
||||
|
||||
void *genode_malloc(unsigned long sz)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
try {
|
||||
|
||||
/* Get a new dataspace and attach it to our address space */
|
||||
Dataspace_capability ds = env()->ram_session()->alloc(sz);
|
||||
void *base = env()->rm_session()->attach(ds);
|
||||
|
||||
/* Put the dataspace area in our database */
|
||||
Memory_area::memory_map()->insert(new (env()->heap())
|
||||
Memory_area((addr_t)base,sz,ds));
|
||||
return base;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
PWRN("Could not open dataspace!");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void genode_set_pager()
|
||||
{
|
||||
Genode::Oklx_process::set_pager();
|
||||
}
|
||||
|
||||
|
||||
unsigned long genode_quota()
|
||||
{
|
||||
return Genode::env()->ram_session()->quota();
|
||||
}
|
||||
|
||||
|
||||
unsigned long genode_used_mem()
|
||||
{
|
||||
return Genode::env()->ram_session()->used();
|
||||
}
|
||||
|
||||
|
||||
} // extern "C"
|
@ -1,176 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API framebuffer functions of the OKLinux support library
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-06-08
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/allocator_avl.h>
|
||||
#include <base/env.h>
|
||||
#include <base/exception.h>
|
||||
#include <base/printf.h>
|
||||
#include <util/misc_math.h>
|
||||
#include <util/string.h>
|
||||
#include <nic_session/connection.h>
|
||||
|
||||
extern "C" {
|
||||
#include <genode/config.h>
|
||||
}
|
||||
|
||||
static bool avail = false;
|
||||
|
||||
static Nic::Connection *nic() {
|
||||
try {
|
||||
static Genode::Allocator_avl tx_block_alloc(Genode::env()->heap());
|
||||
static Nic::Connection nic(&tx_block_alloc);
|
||||
avail = true;
|
||||
return &nic;
|
||||
} catch(...) { }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
class Packet_pool
|
||||
{
|
||||
private:
|
||||
|
||||
class Entry
|
||||
{
|
||||
public:
|
||||
|
||||
Packet_descriptor packet;
|
||||
void *addr;
|
||||
|
||||
Entry() : addr(0) {}
|
||||
};
|
||||
|
||||
|
||||
enum { MAX_ENTRIES = 100 };
|
||||
|
||||
Entry _entries[MAX_ENTRIES];
|
||||
|
||||
public:
|
||||
|
||||
class Pool_full : Genode::Exception {};
|
||||
|
||||
|
||||
void add(Packet_descriptor p, void* addr)
|
||||
{
|
||||
for (unsigned i=0; i < MAX_ENTRIES; i++) {
|
||||
if (!_entries[i].addr) {
|
||||
_entries[i].addr = addr;
|
||||
_entries[i].packet = p;
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw Pool_full();
|
||||
}
|
||||
|
||||
void* get(Packet_descriptor _packet)
|
||||
{
|
||||
for (unsigned i=0; i < MAX_ENTRIES; i++)
|
||||
if (nic()->tx()->packet_content(_packet)
|
||||
== nic()->tx()->packet_content(_entries[i].packet)) {
|
||||
void *ret = _entries[i].addr;
|
||||
_entries[i].addr = 0;
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static Packet_pool *packet_pool()
|
||||
{
|
||||
static Packet_pool pool;
|
||||
return &pool;
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include <genode/net.h>
|
||||
|
||||
static void (*receive_packet)(void*, void*, unsigned long) = 0;
|
||||
static void *net_device = 0;
|
||||
|
||||
|
||||
void genode_net_start(void *dev, void (*func)(void*, void*, unsigned long))
|
||||
{
|
||||
receive_packet = func;
|
||||
net_device = dev;
|
||||
}
|
||||
|
||||
|
||||
void genode_net_stop()
|
||||
{
|
||||
net_device = 0;
|
||||
receive_packet = 0;
|
||||
}
|
||||
|
||||
|
||||
void genode_net_mac(void* mac, unsigned long size)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
Nic::Mac_address m = nic()->mac_address();
|
||||
memcpy(mac, &m.addr, min(sizeof(m.addr), (size_t)size));
|
||||
}
|
||||
|
||||
|
||||
int genode_net_tx(void* addr, unsigned long len, void *skb)
|
||||
{
|
||||
try {
|
||||
Packet_descriptor packet = nic()->tx()->alloc_packet(len);
|
||||
void* content = nic()->tx()->packet_content(packet);
|
||||
packet_pool()->add(packet, skb);
|
||||
Genode::memcpy(content, addr, len);
|
||||
nic()->tx()->submit_packet(packet);
|
||||
return 0;
|
||||
} catch(Packet_pool::Pool_full) {
|
||||
PWRN("skb_buff/packet pool full!");
|
||||
} catch(...) {
|
||||
PWRN("Send failed!");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int genode_net_tx_ack_avail() {
|
||||
return nic()->tx()->ack_avail(); }
|
||||
|
||||
|
||||
void* genode_net_tx_ack()
|
||||
{
|
||||
Packet_descriptor packet = nic()->tx()->get_acked_packet();
|
||||
void *skb = packet_pool()->get(packet);
|
||||
nic()->tx()->release_packet(packet);
|
||||
return skb;
|
||||
}
|
||||
|
||||
|
||||
void genode_net_rx_receive()
|
||||
{
|
||||
if (avail) {
|
||||
while(nic()->rx()->packet_avail()) {
|
||||
Packet_descriptor p = nic()->rx()->get_packet();
|
||||
if (receive_packet && net_device)
|
||||
receive_packet(net_device, nic()->rx()->packet_content(p), p.size());
|
||||
nic()->rx()->acknowledge_packet(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int genode_net_ready()
|
||||
{
|
||||
return genode_config_nic() && nic();
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API file functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/env.h>
|
||||
#include <rom_session/connection.h>
|
||||
#include <dataspace/client.h>
|
||||
|
||||
/* OKLinux support includes */
|
||||
#include <oklx_memory_maps.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
namespace Okl4 {
|
||||
#include <genode/open.h>
|
||||
}
|
||||
|
||||
|
||||
void* genode_open(const char *name, unsigned long *sz)
|
||||
{
|
||||
using namespace Genode;
|
||||
try {
|
||||
|
||||
/* Open the file dataspace and attach it */
|
||||
Rom_connection rc(name);
|
||||
rc.on_destruction(Rom_connection::KEEP_OPEN);
|
||||
Rom_dataspace_capability cap = rc.dataspace();
|
||||
Dataspace_client dsc(cap);
|
||||
*sz = dsc.size();
|
||||
void *base = env()->rm_session()->attach(cap);
|
||||
|
||||
/* Put it in our database */
|
||||
Memory_area::memory_map()->insert(new (env()->heap())
|
||||
Memory_area((addr_t)base, *sz,
|
||||
cap));
|
||||
return base;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
PWRN("Could not open rom dataspace %s!", name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API print functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/exception.h>
|
||||
|
||||
extern "C" {
|
||||
#include <genode/printf.h>
|
||||
|
||||
|
||||
void genode_printf(const char *format, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, format);
|
||||
Genode::vprintf(format, list);
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* \brief Timer functions needed by Genode/OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <timer_session/connection.h>
|
||||
#include <base/sleep.h>
|
||||
|
||||
/*
|
||||
* We only have one timer connection by now, as only the timer thread
|
||||
* in OKLinux uses this functionality
|
||||
*/
|
||||
static Timer::Connection timer;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <genode/sleep.h>
|
||||
|
||||
|
||||
void genode_sleep(unsigned ms) { timer.msleep(ms); }
|
||||
|
||||
|
||||
void genode_sleep_forever() { Genode::sleep_forever(); }
|
||||
|
||||
} // extern "C"
|
@ -1,179 +0,0 @@
|
||||
/*
|
||||
* \brief Genode C API thread functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-19
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
/* OKLinux support library */
|
||||
#include <oklx_threads.h>
|
||||
|
||||
namespace Okl4 {
|
||||
extern "C" {
|
||||
#include <iguana/thread.h>
|
||||
#include <genode/sleep.h>
|
||||
}
|
||||
}
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Okl4;
|
||||
|
||||
static Thread_capability oklx_pager_cap; /* cap to the Linux main thread */
|
||||
|
||||
|
||||
/**
|
||||
* Get the thread capability of the active kernel thread
|
||||
*/
|
||||
static Thread_capability my_cap()
|
||||
{
|
||||
Okl4::L4_Word_t tid = thread_myself();
|
||||
|
||||
Oklx_kernel_thread * thread = Genode::Oklx_thread_list::thread_list()->first();
|
||||
while (thread) {
|
||||
if (thread->tid().raw == tid)
|
||||
return thread->cap();
|
||||
thread = thread->next();
|
||||
}
|
||||
|
||||
/* invalid cap */
|
||||
return Thread_capability();
|
||||
}
|
||||
|
||||
|
||||
void Oklx_kernel_thread::entry()
|
||||
{
|
||||
L4_ThreadId_t tid;
|
||||
|
||||
/* Save our thread id to the first entry in the UTCB */
|
||||
__L4_TCR_Set_ThreadWord(0, L4_UserDefinedHandle());
|
||||
|
||||
/* Synchronize with the thread, that created us and sleep afterwards */
|
||||
L4_Wait(&tid);
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
||||
L4_ThreadId_t Oklx_thread_list::add()
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Create the thread an start it immediately */
|
||||
Thread_capability cap = _cpu.create_thread("Lx_kernel_thread");
|
||||
Oklx_kernel_thread *thd = new (env()->heap()) Oklx_kernel_thread(cap);
|
||||
_threads.insert(thd);
|
||||
env()->pd_session()->bind_thread(cap);
|
||||
Pager_capability pager = env()->rm_session()->add_client(cap);
|
||||
_cpu.set_pager(cap, pager);
|
||||
_cpu.start(cap, (addr_t)&Oklx_kernel_thread::entry,
|
||||
(addr_t)thd->stack_addr());
|
||||
|
||||
/* Get the OKL4 thread id of the new thread */
|
||||
Thread_state state = _cpu.state(cap);
|
||||
thd->set_tid(state.tid);
|
||||
|
||||
/* Acknowledge startup and return */
|
||||
L4_Send(state.tid);
|
||||
return state.tid;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
PWRN("Creation of new thread failed!");
|
||||
return L4_nilthread;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Oklx_thread_list* Oklx_thread_list::thread_list()
|
||||
{
|
||||
static Oklx_thread_list _list;
|
||||
return &_list;
|
||||
}
|
||||
|
||||
|
||||
Oklx_process::~Oklx_process()
|
||||
{
|
||||
/* When the process dies, kill all of its threads */
|
||||
while(_threads.first())
|
||||
{
|
||||
Oklx_user_thread *th = _threads.first();
|
||||
_threads.remove(th);
|
||||
destroy(env()->heap(), th);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
L4_ThreadId_t
|
||||
Oklx_process::add_thread()
|
||||
{
|
||||
Oklx_user_thread *th = 0;
|
||||
try {
|
||||
Thread_state dst_state;
|
||||
th = new (env()->heap()) Oklx_user_thread();
|
||||
_pd.bind_thread(th->cap());
|
||||
|
||||
/*
|
||||
* Initialize eip and esp with max. value to signal
|
||||
* core, that it doesn't really need to start this thread,
|
||||
* but will create the OKL4 thread inactive
|
||||
*/
|
||||
_cpu.start(th->cap(), 0xffffffff, 0xffffffff);
|
||||
dst_state = _cpu.state(th->cap());
|
||||
th->_tid = dst_state.tid;
|
||||
_threads.insert(th);
|
||||
return th->_tid;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
PWRN("Couldn't create a new Thread for space %lx", _pd.space_id().raw);
|
||||
if(th)
|
||||
destroy(env()->heap(), th);
|
||||
return L4_nilthread;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Oklx_process::kill_thread(Okl4::L4_ThreadId_t tid)
|
||||
{
|
||||
Oklx_user_thread *th = _threads.first();
|
||||
while (th)
|
||||
{
|
||||
if(th->tid().raw == tid.raw)
|
||||
{
|
||||
_threads.remove(th);
|
||||
destroy(env()->heap(), th);
|
||||
return true;
|
||||
}
|
||||
th = th->next();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
List<Oklx_process>*
|
||||
Oklx_process::processes()
|
||||
{
|
||||
static List<Oklx_process> _list;
|
||||
return &_list;
|
||||
}
|
||||
|
||||
|
||||
void Oklx_process::set_pager()
|
||||
{
|
||||
oklx_pager_cap = my_cap();
|
||||
}
|
||||
|
||||
|
||||
Thread_capability Oklx_process::pager_cap()
|
||||
{
|
||||
return oklx_pager_cap;
|
||||
}
|
@ -1,159 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <dataspace/client.h>
|
||||
|
||||
/* OKLinux support includes */
|
||||
#include <oklx_threads.h>
|
||||
#include <oklx_memory_maps.h>
|
||||
|
||||
namespace Okl4 {
|
||||
|
||||
/* OKL4 includes */
|
||||
#include <l4/types.h>
|
||||
#include <l4/space.h>
|
||||
}
|
||||
|
||||
using namespace Okl4;
|
||||
|
||||
|
||||
/**
|
||||
* Get OKLinux exregs page, a special page used to synchronize
|
||||
* OKLinux kernel main thread and the user processes
|
||||
*/
|
||||
static Genode::addr_t get_exregs_page()
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
static bool initialized = false;
|
||||
static addr_t phys_addr = 0;
|
||||
|
||||
if(!initialized)
|
||||
{
|
||||
/* Order one page and copy the src content to it */
|
||||
extern char __user_exregs_page[];
|
||||
Dataspace_capability ds = env()->ram_session()->alloc(1 << 12);
|
||||
Dataspace_client dsc(ds);
|
||||
void* page = env()->rm_session()->attach(ds);
|
||||
memcpy(page, (const void*)&__user_exregs_page, 1 << 12);
|
||||
phys_addr = dsc.phys_addr();
|
||||
}
|
||||
return phys_addr;
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
L4_ThreadId_t eas_create_thread(eas_ref_t eas, L4_ThreadId_t pager,
|
||||
L4_ThreadId_t scheduler,
|
||||
void *utcb, L4_ThreadId_t *handle_rv)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
/* Find the right user process and add a thread to it */
|
||||
Oklx_process *p = Oklx_process::processes()->first();
|
||||
while(p)
|
||||
{
|
||||
if(p->pd()->space_id().raw == eas)
|
||||
return p->add_thread();
|
||||
p = p->next();
|
||||
}
|
||||
PWRN("Oklinux user process %lx not found!", eas);
|
||||
return L4_nilthread;
|
||||
}
|
||||
|
||||
|
||||
eas_ref_t eas_create(L4_Fpage_t utcb, L4_SpaceId_t *l4_id)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
/* Create a new OKLinux user process and return its space id */
|
||||
Oklx_process *p = 0;
|
||||
try {
|
||||
p = new (env()->heap()) Oklx_process();
|
||||
Oklx_process::processes()->insert(p);
|
||||
*l4_id = p->pd()->space_id();
|
||||
return l4_id->raw;
|
||||
}
|
||||
catch(...) {
|
||||
PWRN("Could not create a new protection domain!\n");
|
||||
if(p)
|
||||
destroy(env()->heap(),p);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void eas_delete(eas_ref_t eas)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
/* Find the process and remove it from the global list */
|
||||
Oklx_process *p = Oklx_process::processes()->first();
|
||||
while(p)
|
||||
{
|
||||
if(p->pd()->space_id().raw == eas)
|
||||
{
|
||||
Oklx_process::processes()->remove(p);
|
||||
destroy(env()->heap(), p);
|
||||
return;
|
||||
}
|
||||
p = p->next();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int eas_map(eas_ref_t eas, L4_Fpage_t src_fpage, uintptr_t dst_addr,
|
||||
uintptr_t attributes)
|
||||
{
|
||||
using namespace Genode;
|
||||
using namespace Okl4;
|
||||
|
||||
unsigned long dest_addr = dst_addr & 0xfffff000;
|
||||
unsigned long phys_addr = 0;
|
||||
unsigned long src_addr = L4_Address(src_fpage);
|
||||
|
||||
/* Dirty hack for the evil oklx exregs page */
|
||||
if(dest_addr == 0x98765000UL)
|
||||
phys_addr = get_exregs_page();
|
||||
else
|
||||
{
|
||||
Memory_area *ma = Memory_area::memory_map()->first();
|
||||
while(ma)
|
||||
{
|
||||
if(src_addr >= ma->vaddr() &&
|
||||
src_addr < ma->vaddr()+ma->size())
|
||||
{
|
||||
phys_addr = ma->paddr() + src_addr - ma->vaddr();
|
||||
break;
|
||||
}
|
||||
ma = ma->next();
|
||||
}
|
||||
}
|
||||
if(phys_addr == 0)
|
||||
PERR("wants to map from=0x%08lx to=0x%08lx", src_addr, dest_addr);
|
||||
L4_Fpage_t vpage = L4_Fpage(dest_addr, 1 << 12);
|
||||
L4_PhysDesc_t pdesc = L4_PhysDesc(phys_addr, attributes);
|
||||
int rwx = L4_Rights(src_fpage);
|
||||
L4_SpaceId_t id;
|
||||
id.raw = eas;
|
||||
L4_FpageAddRightsTo(&vpage, rwx);
|
||||
if(!L4_MapFpage(id, vpage, pdesc))
|
||||
PERR("Mapping failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
|
||||
extern "C" {
|
||||
#include <iguana/hardware.h>
|
||||
|
||||
|
||||
int hardware_register_interrupt(L4_ThreadId_t thrd, int interrupt)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int hardware_back_memsection(memsection_ref_t memsection,
|
||||
uintptr_t paddr, uintptr_t attributes)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
@ -1,132 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
#include <oklx_memory_maps.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
namespace Okl4 {
|
||||
#include <stddef.h>
|
||||
#include <l4/kdebug.h>
|
||||
#include <iguana/memsection.h>
|
||||
#include <iguana/thread.h>
|
||||
}
|
||||
|
||||
using namespace Okl4;
|
||||
|
||||
|
||||
uintptr_t memsection_virt_to_phys(uintptr_t vaddr, size_t *size)
|
||||
{
|
||||
using namespace Genode;
|
||||
Memory_area *area = Memory_area::memory_map()->first();
|
||||
while(area)
|
||||
{
|
||||
if(area->vaddr() == vaddr)
|
||||
{
|
||||
uintptr_t paddr = area->paddr();
|
||||
*size = area->size();
|
||||
return paddr;
|
||||
}
|
||||
area = area->next();
|
||||
}
|
||||
PWRN("Memory area beginning @vaddr=0x%08lx doesn't exist!",
|
||||
(unsigned long)vaddr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int memsection_page_map(memsection_ref_t memsect, L4_Fpage_t from_page,
|
||||
L4_Fpage_t to_page)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int memsection_page_unmap(memsection_ref_t memsect, L4_Fpage_t to_page)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int memsection_register_server(memsection_ref_t memsect,
|
||||
thread_ref_t server)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
memsection_ref_t memsection_lookup(objref_t object, thread_ref_t *server)
|
||||
{
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
void *memsection_base(memsection_ref_t memsect)
|
||||
{
|
||||
using namespace Genode;
|
||||
Memory_area *area = Memory_area::memory_map()->first();
|
||||
while(area)
|
||||
{
|
||||
if((area->vaddr() <= memsect) &&
|
||||
((area->vaddr()+area->size()) >= memsect))
|
||||
return (void*) area->vaddr();
|
||||
area = area->next();
|
||||
}
|
||||
PWRN("Memory area with @vaddr=0x%08lx doesn't exist!",
|
||||
(unsigned long)memsect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uintptr_t memsection_size(memsection_ref_t memsect)
|
||||
{
|
||||
using namespace Genode;
|
||||
Memory_area *area = Memory_area::memory_map()->first();
|
||||
while(area)
|
||||
{
|
||||
if((area->vaddr() <= memsect) &&
|
||||
((area->vaddr()+area->size()) >= memsect))
|
||||
return area->size();
|
||||
area = area->next();
|
||||
}
|
||||
PWRN("Memory area with @vaddr=0x%08lx doesn't exist!",
|
||||
(unsigned long)memsect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
memsection_ref_t memsection_create_user(uintptr_t size, uintptr_t *base)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void memsection_delete(memsection_ref_t)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
}
|
||||
|
||||
|
||||
memsection_ref_t memsection_create(uintptr_t size, uintptr_t *base)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
|
||||
extern "C" {
|
||||
#include <iguana/pd.h>
|
||||
|
||||
|
||||
pd_ref_t pd_myself(void)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void pd_delete(pd_ref_t pd)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
}
|
||||
|
||||
|
||||
memsection_ref_t pd_create_memsection(pd_ref_t pd, uintptr_t size,
|
||||
uintptr_t *base)
|
||||
{
|
||||
PWRN("Not yet implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
#include <oklx_threads.h>
|
||||
|
||||
using namespace Okl4;
|
||||
|
||||
extern "C" {
|
||||
|
||||
thread_ref_t thread_create(L4_ThreadId_t *thrd)
|
||||
{
|
||||
thrd->raw = Genode::Oklx_thread_list::thread_list()->add().raw;
|
||||
return thrd->raw;
|
||||
}
|
||||
|
||||
|
||||
L4_ThreadId_t thread_l4tid(thread_ref_t server)
|
||||
{
|
||||
L4_ThreadId_t tid;
|
||||
tid.raw = server;
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
thread_ref_t thread_myself(void)
|
||||
{
|
||||
return __L4_TCR_ThreadWord(Genode::UTCB_TCR_THREAD_WORD_MYSELF);
|
||||
}
|
||||
|
||||
|
||||
void thread_delete(L4_ThreadId_t thrd)
|
||||
{
|
||||
using namespace Genode;
|
||||
Oklx_process *p = Oklx_process::processes()->first();
|
||||
while(p)
|
||||
{
|
||||
if(p->kill_thread(thrd))
|
||||
return;
|
||||
p = p->next();
|
||||
}
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* \brief Iguana API functions needed by OKLinux
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-07
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
#include <util/string.h>
|
||||
|
||||
enum {TLS_ERRNO_KEY, TLS_TIMER_KEY, TLS_NAMING_KEY,
|
||||
TLS_SYNCH_BITS_KEY, TLS_UNUSED1, TLS_UNUSED2, TLS_THREAD_ID};
|
||||
|
||||
extern "C" {
|
||||
#include <iguana/tls.h>
|
||||
#include <iguana/thread.h>
|
||||
#include <l4/utcb.h>
|
||||
|
||||
|
||||
void __tls_init(void *tls_buffer)
|
||||
{
|
||||
Genode::memset(tls_buffer, 0, 32 * sizeof(Genode::addr_t));
|
||||
__L4_TCR_Set_ThreadLocalStorage((L4_Word_t)tls_buffer);
|
||||
((L4_Word_t *)tls_buffer)[TLS_THREAD_ID] =
|
||||
thread_l4tid(thread_myself()).raw;
|
||||
}
|
||||
|
||||
} // extern "C"
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* \brief OKLinux library specific memory data
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-28
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _OKLINUX_SUPPORT__INCLUDE__OKLX_MEMORY_MAPS_H_
|
||||
#define _OKLINUX_SUPPORT__INCLUDE__OKLX_MEMORY_MAPS_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/list.h>
|
||||
#include <dataspace/client.h>
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
|
||||
/**
|
||||
* This class represents a memory area within the OKLinux kernel
|
||||
* address space.
|
||||
*/
|
||||
class Memory_area : public List<Memory_area>::Element
|
||||
{
|
||||
private:
|
||||
|
||||
addr_t _vaddr; /* virtual address */
|
||||
size_t _size; /* memory area size */
|
||||
Dataspace_capability _cap; /* dataspace mapped */
|
||||
|
||||
public:
|
||||
|
||||
Memory_area(addr_t vaddr, size_t size, Dataspace_capability cap)
|
||||
: _vaddr(vaddr), _size(size), _cap(cap) {}
|
||||
|
||||
/*
|
||||
* Get the virtual address of the memory area
|
||||
*/
|
||||
addr_t vaddr() { return _vaddr; }
|
||||
|
||||
/*
|
||||
* Get the size of the memory area
|
||||
*/
|
||||
size_t size() { return _size; }
|
||||
|
||||
/*
|
||||
* Get the capability of the dataspace backing this memory area
|
||||
*/
|
||||
Dataspace_capability dataspace() { return _cap; }
|
||||
|
||||
/*
|
||||
* Get the physical address of this memory area
|
||||
*/
|
||||
addr_t paddr()
|
||||
{
|
||||
Dataspace_client dsc(_cap);
|
||||
return dsc.phys_addr();
|
||||
}
|
||||
|
||||
/*
|
||||
* List of all memory areas of the OKLinux kernel
|
||||
*/
|
||||
static List<Memory_area> *memory_map()
|
||||
{
|
||||
static List<Memory_area> _maps;
|
||||
return &_maps;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //_OKLINUX_SUPPORT__INCLUDE__OKLX_MEMORY_MAPS_H_
|
@ -1,146 +0,0 @@
|
||||
/*
|
||||
* \brief Oklx library specific screen data
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2010-04-22
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _LIB__OKLX__INCLUDE__OKLX_SCREENS_H_
|
||||
#define _LIB__OKLX__INCLUDE__OKLX_SCREENS_H_
|
||||
|
||||
#include <util/list.h>
|
||||
#include <framebuffer_session/connection.h>
|
||||
#include <input_session/connection.h>
|
||||
#include <input/event.h>
|
||||
#include <nitpicker_session/connection.h>
|
||||
|
||||
|
||||
class Screen : public Genode::List<Screen>::Element
|
||||
{
|
||||
private:
|
||||
|
||||
void *_mouse_dev;
|
||||
void *_keyb_dev;
|
||||
|
||||
protected:
|
||||
|
||||
Input::Event *_ev_buf;
|
||||
|
||||
public:
|
||||
|
||||
Screen() : _mouse_dev(0), _keyb_dev(0), _ev_buf(0) {}
|
||||
|
||||
virtual Framebuffer::Session *framebuffer() = 0;
|
||||
virtual Input::Session *input() = 0;
|
||||
|
||||
void *keyb_device (void) { return _keyb_dev; }
|
||||
void *mouse_device (void) { return _mouse_dev; }
|
||||
void keyb_device (void *dev) { _keyb_dev = dev; }
|
||||
void mouse_device (void *dev) { _mouse_dev = dev; }
|
||||
Input::Event *buffer (void) { return _ev_buf; }
|
||||
};
|
||||
|
||||
|
||||
class Simple_screen : public Screen
|
||||
{
|
||||
private:
|
||||
|
||||
Framebuffer::Connection _fb_con;
|
||||
Input::Connection _input_con;
|
||||
|
||||
public:
|
||||
|
||||
Simple_screen()
|
||||
{
|
||||
_ev_buf = (Input::Event*)
|
||||
Genode::env()->rm_session()->attach(_input_con.dataspace());
|
||||
}
|
||||
|
||||
Framebuffer::Session *framebuffer() { return &_fb_con; }
|
||||
Input::Session *input() { return &_input_con; }
|
||||
};
|
||||
|
||||
class Nitpicker_screen : public Screen
|
||||
{
|
||||
public:
|
||||
|
||||
enum { VIEW_CNT=256 };
|
||||
|
||||
private:
|
||||
|
||||
Nitpicker::Connection _nit_con;
|
||||
Nitpicker::View_capability _views[VIEW_CNT];
|
||||
|
||||
public:
|
||||
|
||||
Nitpicker_screen()
|
||||
{
|
||||
_ev_buf = (Input::Event*)
|
||||
Genode::env()->rm_session()->attach(_nit_con.input()->dataspace());
|
||||
for (unsigned i = 0; i < VIEW_CNT; i++)
|
||||
_views[i] = Nitpicker::View_capability();
|
||||
}
|
||||
|
||||
Framebuffer::Session *framebuffer() { return _nit_con.framebuffer(); }
|
||||
|
||||
Input::Session *input() { return _nit_con.input(); }
|
||||
|
||||
Nitpicker::Connection *nitpicker() { return &_nit_con;}
|
||||
|
||||
Nitpicker::View_capability get_view (unsigned idx)
|
||||
{
|
||||
if (idx >= VIEW_CNT)
|
||||
return Nitpicker::View_capability();
|
||||
return _views[idx];
|
||||
}
|
||||
|
||||
void put_view (unsigned idx, Nitpicker::View_capability view)
|
||||
{
|
||||
if (idx < VIEW_CNT)
|
||||
_views[idx] = view;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Screen_array
|
||||
{
|
||||
public:
|
||||
|
||||
enum { SIZE=10 };
|
||||
|
||||
private:
|
||||
|
||||
Screen *_screens[SIZE];
|
||||
|
||||
public:
|
||||
|
||||
Screen_array();
|
||||
|
||||
Screen *get (unsigned int idx)
|
||||
{
|
||||
if (idx >= SIZE) {
|
||||
PWRN("Invalid index %d", idx);
|
||||
return (Screen*) 0;
|
||||
}
|
||||
return _screens[idx];
|
||||
}
|
||||
|
||||
unsigned count ()
|
||||
{
|
||||
for (unsigned i = 0; i < SIZE; i++) {
|
||||
if (!_screens[i])
|
||||
return i;
|
||||
}
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
static Screen_array *screens(void);
|
||||
};
|
||||
|
||||
#endif //_LIB__OKLX__INCLUDE__OKLX_SCREENS_H_
|
@ -1,178 +0,0 @@
|
||||
/*
|
||||
* \brief OKLinux library specific thread data
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2009-05-28
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2013 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _OKLINUX_SUPPORT__INCLUDE__OKLX_THREADS_H_
|
||||
#define _OKLINUX_SUPPORT__INCLUDE__OKLX_THREADS_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/sleep.h>
|
||||
#include <base/thread.h>
|
||||
#include <base/env.h>
|
||||
#include <base/printf.h>
|
||||
#include <util/list.h>
|
||||
#include <rm_session/connection.h>
|
||||
#include <cpu_session/connection.h>
|
||||
#include <okl4_pd_session/connection.h>
|
||||
|
||||
namespace Okl4 {
|
||||
extern "C" {
|
||||
|
||||
/* Iguana includes */
|
||||
#include <iguana/eas.h>
|
||||
#include <iguana/thread.h>
|
||||
|
||||
/* OKL4 includes */
|
||||
#include <l4/ipc.h>
|
||||
#include <l4/utcb.h>
|
||||
}
|
||||
}
|
||||
|
||||
namespace Genode {
|
||||
|
||||
/**
|
||||
* This class represents a OKLinux kernel thread
|
||||
*/
|
||||
class Oklx_kernel_thread : public List<Oklx_kernel_thread>::Element
|
||||
{
|
||||
private:
|
||||
|
||||
/*
|
||||
* We only need a small stack for startup code,
|
||||
* afterwards OKLinux will rearrange the stack pointer
|
||||
* to another memory area
|
||||
*/
|
||||
enum { STACK_SIZE=1024 };
|
||||
|
||||
Thread_capability _cap; /* Genodes thread capability */
|
||||
Okl4::L4_ThreadId_t _tid;
|
||||
|
||||
char _stack[STACK_SIZE]; /* stack for startup code */
|
||||
|
||||
public:
|
||||
|
||||
Oklx_kernel_thread(Thread_capability cap) : _cap(cap) {}
|
||||
|
||||
Thread_capability cap() { return _cap; }
|
||||
|
||||
void* stack_addr() { return (void*)&_stack[STACK_SIZE-1]; };
|
||||
|
||||
static void entry();
|
||||
|
||||
void set_tid(Okl4::L4_ThreadId_t tid) { _tid = tid; }
|
||||
|
||||
Okl4::L4_ThreadId_t tid() { return _tid; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* An object of this class contains OKLinux kernel threads and
|
||||
* an own cpu_session to create them.
|
||||
*/
|
||||
class Oklx_thread_list
|
||||
{
|
||||
private:
|
||||
|
||||
List<Oklx_kernel_thread> _threads;
|
||||
Cpu_connection _cpu;
|
||||
|
||||
public:
|
||||
|
||||
Okl4::L4_ThreadId_t add();
|
||||
Cpu_connection* cpu() { return &_cpu; }
|
||||
|
||||
/**
|
||||
* Get the global list of OKLinux kernel threads
|
||||
*/
|
||||
static Oklx_thread_list *thread_list();
|
||||
|
||||
Oklx_kernel_thread * first() { return _threads.first(); }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This class represents an OKLinux process, and its threads.
|
||||
*/
|
||||
class Oklx_process : public List<Oklx_process>::Element
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* A thread within an OKLinux process
|
||||
*/
|
||||
class Oklx_user_thread : public List<Oklx_user_thread>::Element
|
||||
{
|
||||
private:
|
||||
|
||||
friend class Oklx_process;
|
||||
|
||||
Okl4::L4_ThreadId_t _tid;
|
||||
Thread_capability _cap;
|
||||
|
||||
public:
|
||||
|
||||
Oklx_user_thread()
|
||||
: _cap(env()->cpu_session()->create_thread("Oklx user thread")) {}
|
||||
|
||||
~Oklx_user_thread() {
|
||||
env()->cpu_session()->kill_thread(_cap); }
|
||||
|
||||
Okl4::L4_ThreadId_t tid() { return _tid; }
|
||||
|
||||
Thread_capability cap() { return _cap; }
|
||||
};
|
||||
|
||||
|
||||
Pd_connection _pd; /* protection domain of the process */
|
||||
Cpu_connection _cpu; /* cpu session to construct threads */
|
||||
List<Oklx_user_thread> _threads; /* list of all threads */
|
||||
Rm_connection _rm; /* rm session to manage addr. space */
|
||||
|
||||
public:
|
||||
|
||||
Oklx_process() { _pd.space_pager(pager_cap()); }
|
||||
|
||||
~Oklx_process();
|
||||
|
||||
Pd_connection* pd() { return &_pd; }
|
||||
|
||||
Cpu_connection* cpu() { return &_cpu; }
|
||||
|
||||
Rm_connection* rm() { return &_rm; }
|
||||
|
||||
Okl4::L4_ThreadId_t add_thread();
|
||||
|
||||
bool kill_thread(Okl4::L4_ThreadId_t tid);
|
||||
|
||||
bool empty() { return !_threads.first(); }
|
||||
|
||||
/**
|
||||
* Get the global list of all OKLinux processes
|
||||
*/
|
||||
static List<Oklx_process> *processes();
|
||||
|
||||
/**
|
||||
* Get the capability of the pager thread,
|
||||
* that pages OKLinux user processes (kernel main thread)
|
||||
*/
|
||||
static Thread_capability pager_cap();
|
||||
|
||||
/**
|
||||
* Set the capability of the pager thread,
|
||||
* that pages OKLinux user processes (kernel main thread)
|
||||
*/
|
||||
static void set_pager();
|
||||
};
|
||||
}
|
||||
|
||||
#endif //_OKLINUX_SUPPORT__INCLUDE__OKLX_THREADS_H_
|
@ -1 +0,0 @@
|
||||
int main() { return 0; }
|
@ -1,53 +0,0 @@
|
||||
TARGET = dummy
|
||||
LIBS = oklx
|
||||
REQUIRES = okl4
|
||||
SRC_CC = main.cc
|
||||
VERBOSE_LX_MK ?= 0
|
||||
VMLINUX = $(BUILD_BASE_DIR)/oklinux/vmlinux
|
||||
|
||||
$(TARGET): $(VMLINUX) $(BUILD_BASE_DIR)/bin/vmlinux
|
||||
|
||||
$(BUILD_BASE_DIR)/bin/vmlinux:
|
||||
$(VERBOSE)ln -s $(VMLINUX) $(BUILD_BASE_DIR)/bin/.
|
||||
|
||||
WOMBAT_CFLAGS = -I$(BUILD_BASE_DIR)/include -I$(REP_DIR)/include/oklx_lib \
|
||||
-I$(REP_DIR)/include/oklx_kernel -DMAX_ELF_SEGMENTS=1000 \
|
||||
-DCONFIG_MAX_THREAD_BITS=10 -D__i386__ $(CC_MARCH)
|
||||
|
||||
#
|
||||
# The Linux kernel comes with its own declarations of typically builtin
|
||||
# functions. Unfortunately, gcc-4.6.1 complains that the size type used in
|
||||
# these declarations does not correspond to the compiler's __SIZE_TYPE__. This
|
||||
# causes a flood of compile warnings. By marking said functions as non-builtin,
|
||||
# those warnings are suppressed.
|
||||
#
|
||||
WOMBAT_CFLAGS += $(addprefix -fno-builtin-,strncpy strncat strncmp strlen memmove \
|
||||
memchr snprintf vsnprintf strncasecmp \
|
||||
strspn strcspn memcmp)
|
||||
|
||||
# disable noise caused by uncritical warnings
|
||||
WOMBAT_CFLAGS += -Wno-unused-but-set-variable
|
||||
|
||||
$(VMLINUX): $(BUILD_BASE_DIR)/oklinux/.config
|
||||
$(VERBOSE_MK)$(MAKE) $(VERBOSE_DIR) \
|
||||
-C $(REP_DIR)/contrib vmlinux \
|
||||
ARCH=l4 O=$(BUILD_BASE_DIR)/oklinux \
|
||||
CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
|
||||
WOMBAT_CFLAGS='$(WOMBAT_CFLAGS)' \
|
||||
LDFLAGS='$(LD_MARCH)' \
|
||||
LINK_ADDRESS=b000000 V=1 SYSTEM=i386 \
|
||||
GENODE_LIBS_DIR=$(BUILD_BASE_DIR)/var/libcache \
|
||||
GENODE_SRC_DIR=$(GENODE_DIR) \
|
||||
KBUILD_VERBOSE=$(VERBOSE_LX_MK) \
|
||||
V=$(VERBOSE_LX_MK)
|
||||
|
||||
$(BUILD_BASE_DIR)/oklinux/.config:
|
||||
$(VERBOSE)cp $(REP_DIR)/config/linux_config $@
|
||||
|
||||
clean: clean_oklinux
|
||||
|
||||
clean_oklinux:
|
||||
$(VERBOSE)rm -rf .t* ..t* .v* .missing-syscalls.d * .config
|
||||
|
||||
.PHONY: $(VMLINUX)
|
||||
|
@ -1,5 +0,0 @@
|
||||
|
||||
#
|
||||
# Software ported specifically for OKL4, i.e., OKLinux
|
||||
#
|
||||
#REPOSITORIES += $(GENODE_DIR)/ports-okl4
|
@ -108,14 +108,6 @@ $(BUILD_DIR)/etc/build.conf::
|
||||
@cat $(BUILD_CONF).optional >> $@
|
||||
endif
|
||||
|
||||
#
|
||||
# Add 'ports-okl4' repository to OKL4 build directory
|
||||
#
|
||||
ifeq ($(PLATFORM),okl4_x86)
|
||||
$(BUILD_DIR)/etc/build.conf::
|
||||
@cat $(BUILD_CONF).ports-okl4 >> $@
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/Makefile:
|
||||
@ln -sf $(GENODE_ABS_DIR)/tool/builddir/build.mk $@
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user