diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2009-03-20 13:43:11 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-03-20 13:43:11 -0700 |
commit | 22cd4e378e3aafd402f43030941d6f6b300d0cea (patch) | |
tree | ed4ed22984b4d82fd652f6a4580ff8288b52c9bf | |
parent | ec90083cc6f7513d68807e19f893dbb27d2a45aa (diff) | |
download | syslinux-22cd4e378e3aafd402f43030941d6f6b300d0cea.tar.gz |
ansicon: handle the disabled case properly
Even when disabled, we need to set the screen size, because the
downstream code depends on it. Set it to 25x80 (maybe we should
swtich this is 24x80) in this case.
Furthermore, when disabled, we should return success == bytes
"written", not zero.
-rw-r--r-- | com32/lib/sys/ansicon_write.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c index 711f8b5a..01d69da1 100644 --- a/com32/lib/sys/ansicon_write.c +++ b/com32/lib/sys/ansicon_write.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved + * Copyright 2004-2009 H. Peter Anvin - All Rights Reserved * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -38,6 +38,7 @@ #include <minmax.h> #include <colortbl.h> #include <klibc/compiler.h> +#include <syslinux/config.h> #include "file.h" #include "ansi.h" @@ -83,11 +84,10 @@ int __ansicon_open(struct file_info *fp) if (!ansicon_counter) { /* Are we disabled? */ - ireg.eax.w[0] = 0x000b; - __intcall(0x22, &ireg, &oreg); - - if ( (signed char)oreg.ebx.b[1] < 0 ) { + if (syslinux_serial_console_info()->flowctl & 0x8000) { ti.disabled = 1; + ti.rows = 25; + ti.cols = 80; } else { /* Force text mode */ ireg.eax.w[0] = 0x0005; @@ -228,7 +228,7 @@ ssize_t __ansicon_write(struct file_info *fp, const void *buf, size_t count) (void)fp; if ( ti.disabled ) - return n; /* Nothing to do */ + return count; /* Nothing to do */ while ( count-- ) { __ansi_putchar(&ti, *bufp++); |