Merge commit 'f9ac61d6178d4994cd646fd4b6c4bb891351624c'
[syslinux.git] / com32 / samples / serialinfo.c
blob953a70549b764608cc98d74c8f9a8d468164eb28
1 /* ----------------------------------------------------------------------- *
3 * Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
14 * serialinfo.c
16 * Print serial port info
19 #include <string.h>
20 #include <stdio.h>
21 #include <console.h>
22 #include <syslinux/config.h>
24 int main(void)
26 const struct syslinux_serial_console_info *si;
28 openconsole(&dev_null_r, &dev_stdcon_w);
30 si = syslinux_serial_console_info();
32 printf("Serial port base: %#06x\n", si->iobase);
33 printf("Serial port divisor: %5d", si->divisor);
34 if (si->divisor)
35 printf(" (%d baud)", 115200/si->divisor);
36 printf("\n"
37 "Flow control bits: %#05x\n", si->flowctl);
39 return 0;