2 * General port I/O utility
3 * NetWatch system management mode administration console
5 * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
6 * This program is free software; you can redistribute and/or modify it under
7 * the terms found in the file LICENSE in the root of this source tree.
14 int main(int argc, char **argv)
17 unsigned char type = 'b';
26 if ((argc < 2) || (argc > 4))
29 printf("usage: %s port [b|w|l [datum]]\n", argv[0]);
33 port = strtoul(argv[1], NULL, 0);
40 datum = strtoul(argv[3], NULL, 0);
46 printf("Wrote byte 0x%02x to port 0x%04x\n", datum, port);
51 printf("Wrote word 0x%04x to port 0x%04x\n", datum, port);
55 printf("Wrote long 0x%08x to port 0x%04x\n", datum, port);
65 printf("Read byte 0x%02x from port 0x%04x\n", datum, port);
69 printf("Read word 0x%04x from port 0x%04x\n", datum, port);
73 printf("Read long 0x%08x from port 0x%04x\n", datum, port);