#define _GNU_SOURCE
#include <argp.h>               /* struct argp */
#include <mach/machine/pio.h>   /* outb */
#include <unistd.h>             /* sleep */
#include "../util.h"            /* _ */

const char *argp_program_version = "ioport (" PACKAGE ") " VERSION;
const char *argp_program_bug_address = "<tosi@stekt.oulu.fi>";

int
main (int argc, char **argv)
{
  static const struct argp argp = { 0, 0, 0,
    N_("Move the cursor to the top left corner for a second "
       "by outputting values to EGA I/O ports.") };
  argp_parse (&argp, argc, argv, 0, 0, 0);

  outb (0x3D4, 0x0E);           /* cursor position high byte register */
  outb (0x3D5, 0);
  outb (0x3D4, 0x0F);           /* cursor position low byte register */
  outb (0x3D5, 0);

  sleep (1);
  return 0;
}
