aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2004-12-01 00:40:16 +0000
committerhpa <hpa>2004-12-01 00:40:16 +0000
commit7c4d8375a05ffaf58e1b6b5789758a2fcfeb3b87 (patch)
treec69091b1b4f342f407c120c007bde5927cf5e88d
parentc3ad9c5e8cf4716f5f8a1933bb6e638745cc95a0 (diff)
downloadsyslinux-2.12-pre3.tar.gz
syslinux-2.12-pre3.tar.xz
syslinux-2.12-pre3.zip
Make the console behave the same as com32 when compiling for Linuxsyslinux-2.12-pre3
-rw-r--r--com32/modules/fancyhello.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/com32/modules/fancyhello.c b/com32/modules/fancyhello.c
index 42c04d92..5cfc064f 100644
--- a/com32/modules/fancyhello.c
+++ b/com32/modules/fancyhello.c
@@ -30,14 +30,22 @@ static void console_init(void)
{
/* Write both to the ANSI console and the serial port, if configured */
openconsole(&dev_stdcon_r, &dev_ansiserial_w);
- printf("\033[20h"); /* Automatically convert \r\n -> \n */
}
#else
+#include <termios.h>
+#include <unistd.h>
+
static void console_init(void)
{
- /* Do Linux initialization (none needed) */
+ struct termios tio;
+
+ /* Set the termios flag so we behave the same as libcom32 */
+ tcgetattr(0, &tio);
+ tio.c_iflag &= ~ICRNL;
+ tio.c_iflag |= IGNCR;
+ tcsetattr(0, TCSANOW, &tio);
}
#endif
@@ -47,6 +55,7 @@ int main(void)
char buffer[1024];
console_init();
+ printf("\033[20h"); /* Automatically convert \r\n -> \n */
printf("\033[1;33;44m *** \033[37mHello, World!\033[33m *** \033[0m\n");