genode/repos/os/src/server/tz_vmm/include/serial.h
Martin Stein 59d2a83f30 TZ VMM & USB Armory: Demo
* Provide paravirtualized block API for accessing the second partition
  of the block device that is provided by the ESDHC driver.

* Provide paravirtualized serial API for sending log-output over Genodes
  serial port.

* Use the latest Linux suggested in the USB Armory Wiki [1] when on USB Armory
  while still using the older vendor Linux when on i.MX53 QSB. I.e.,
  provide a device tree through RAM and a rootfs through the paravirtualized
  block device when on USB Armory while providing ATAGs and Initrd when on
  i.MX53 QSB.

* Switch on the LED on the USB Armory when the VMM catches a VM-exception
  and switch it off again when as soon as the exception is handled. This
  merely show-cases the ability to instrument the LED for such purposes. In an
  ideal world, the LED is switched on as long as we're on the "Secure Side"
  and switched off as long as we're not.

* For further information see repos/os/run/tz_vmm.run

[1] https://github.com/inversepath/usbarmory/wiki/Preparing-a-bootable-microSD-image

Fixes #1497
2015-11-29 18:17:04 +01:00

54 lines
993 B
C++

/*
* \brief Paravirtualized access to serial devices for a Trustzone VM
* \author Martin Stein
* \date 2015-10-23
*/
/*
* Copyright (C) 2015 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 _TZ_VMM__INCLUDE__SERIAL_H_
#define _TZ_VMM__INCLUDE__SERIAL_H_
/* Genode includes */
#include <vm_base.h>
#include <os/attached_ram_dataspace.h>
namespace Vmm { class Serial; }
/**
* Paravirtualized access to serial devices for a Trustzone VM
*/
class Vmm::Serial : private Genode::Attached_ram_dataspace
{
private:
enum {
BUF_SIZE = 4096,
WRAP = BUF_SIZE - sizeof(char),
};
Genode::addr_t _off;
void _push(char const c);
void _flush();
void _send(Vm_base * const vm);
public:
/**
* Handle Secure Monitor Call of VM 'vm' on VMM serial
*/
void handle(Vm_base * const vm);
Serial();
};
#endif /* _TZ_VMM__INCLUDE__SERIAL_H_ */