Skip to content

Grifo Kernel

Christopher Hall edited this page Oct 15, 2010 · 3 revisions


  • Separate kernel and application binaries
  • Simple API for application program in: grifo.h
  • Fixed ABI for separate kernel/application updates
  • Event queue mechanism with option for low power standby while waiting for the next event, and a callback to capture the timeout (allows for saving unsaved data before power off)
  • Text output to LCD
  • File/directory handling for SD card
  • Watchdog timer auto power off
  • Application main must be the first code in the first object linked

Boot sequence

  • Hardware initialisation
  • Run the command: auto-boot grifo-kernel
  • runs
  • All files are closed on return
  • One of three possible actions occurs depending on the value returned to the kernel:
    • Power off
    • Reboot - equivalent to power on reset
    • Run: restart grifo-kernel

Initial application:

  • Reads a configuration file: init.ini
    • example line: hello.ico : some test arguments
  • if auto-boot was present the it unconditionally runs the first program
  • if not the first 9 items are displayed as a graphic menu

Program code from examples/hello

This displays a message on the LCD and on the console serial port, then displays the command line arguments provided by

#include <grifo.h>
int main(int argc, char *argv[])
    lcd_printf("Hello LCD world\n");
    debug_printf("Hello serial world\n");
    size_t i;
    for (i = 0; i < argc; ++i) {
        lcd_printf("argv[%d] = '%s'\n", i, argv[i]);
        debug_printf("argv[%d] = '%s'\n", i, argv[i]);
Something went wrong with that request. Please try again.