Skip to content

Instantly share code, notes, and snippets.

@podhrmic
Created July 28, 2017 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhrmic/cebc175cbcd449d7fdfb34882645eea3 to your computer and use it in GitHub Desktop.
Save podhrmic/cebc175cbcd449d7fdfb34882645eea3 to your computer and use it in GitHub Desktop.
Camkes VGA example
/*
* Copyright 2017, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(DATA61_BSD)
*/
/* CAmkES ADL description of the system. Every system needs such a description
* that covers the component types, their instantiations, connections between
* them and system configuration. This description can be split across multiple
* files, using the 'import' directive that works like CPP's #include
* directive. For simplicity, I've just defined everything in a single file.
*/
/* Import builtin ADL descriptions of CAmkES connector types. */
import <std_connector.camkes>;
/* Component definitions: */
component Screen {
hardware;
dataport Buf mem;
}
component VESADriver {
control;
dataport Buf mem;
}
/* The system definition: */
assembly {
composition {
component Screen video;
component VESADriver vesa;
connection seL4HardwareMMIO video_out(from vesa.mem, to video.mem);
}
configuration {
// this is the VGA buffer address
// however, when I run sel4 the assigned address of mem is 0x8400000
video.mem_paddr = 0xB8000;
// the vga buffer is componsed of uin16_t units, and is 1920*2 bytes long
// I have to define it 4k long because otherwise a static assert fails when
// checking the buffer size
video.mem_size = 4096;
video.mem_access = "W";
vesa.mem_acces = "W";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment