aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-09 17:08:14 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-09 17:08:14 -0700
commit119f57d3ee3514dda5b5acee9392fcd7a1b6720f (patch)
tree842a24dc801e5d8965d5ca6eedb926aba7766153
parentca4267ebc934621468a2d48089df3a72434a7775 (diff)
downloadsyslinux-elf-119f57d3ee3514dda5b5acee9392fcd7a1b6720f.tar.gz
syslinux-elf-119f57d3ee3514dda5b5acee9392fcd7a1b6720f.tar.xz
syslinux-elf-119f57d3ee3514dda5b5acee9392fcd7a1b6720f.zip
ansicon, vesacon: beep on ^G
If we get a ^G, issue a beep. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/lib/sys/ansi.c3
-rw-r--r--com32/lib/sys/ansi.h2
-rw-r--r--com32/lib/sys/ansicon_write.c10
-rw-r--r--com32/lib/sys/vesacon_write.c1
4 files changed, 16 insertions, 0 deletions
diff --git a/com32/lib/sys/ansi.c b/com32/lib/sys/ansi.c
index 29a069f0..590b1b4a 100644
--- a/com32/lib/sys/ansi.c
+++ b/com32/lib/sys/ansi.c
@@ -83,6 +83,9 @@ void __ansi_putchar(const struct term_info *ti, uint8_t ch)
st->state = st_tbl;
st->parms[0] = ch;
break;
+ case '\a':
+ op->beep();
+ break;
case '\b':
if ( xy.x > 0 ) xy.x--;
break;
diff --git a/com32/lib/sys/ansi.h b/com32/lib/sys/ansi.h
index 5ac008ea..da06903c 100644
--- a/com32/lib/sys/ansi.h
+++ b/com32/lib/sys/ansi.h
@@ -47,6 +47,7 @@ struct ansi_ops {
void (*showcursor)(const struct term_state *st);
void (*scroll_up)(const struct term_state *st);
void (*set_cursor)(int x, int y, int visible);
+ void (*beep)(void);
};
struct term_info {
@@ -58,5 +59,6 @@ struct term_info {
void __ansi_init(const struct term_info *ti);
void __ansi_putchar(const struct term_info *ti, uint8_t ch);
+void __ansicon_beep(void);
#endif /* COM32_LIB_SYS_ANSI_H */
diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c
index e4369660..711f8b5a 100644
--- a/com32/lib/sys/ansicon_write.c
+++ b/com32/lib/sys/ansicon_write.c
@@ -54,6 +54,7 @@ struct ansi_ops __ansicon_ops = {
.showcursor = ansicon_showcursor,
.set_cursor = ansicon_set_cursor,
.scroll_up = ansicon_scroll_up,
+ .beep = __ansicon_beep,
};
static struct term_info ti =
@@ -237,6 +238,15 @@ ssize_t __ansicon_write(struct file_info *fp, const void *buf, size_t count)
return n;
}
+void __ansicon_beep(void)
+{
+ static com32sys_t ireg;
+
+ ireg.eax.w[0] = 0x0e07;
+ ireg.ebx.b[1] = BIOS_PAGE;
+ __intcall(0x10, &ireg, NULL);
+}
+
const struct output_dev dev_ansicon_w = {
.dev_magic = __DEV_MAGIC,
.flags = __DEV_TTY | __DEV_OUTPUT,
diff --git a/com32/lib/sys/vesacon_write.c b/com32/lib/sys/vesacon_write.c
index bae52652..fda967c0 100644
--- a/com32/lib/sys/vesacon_write.c
+++ b/com32/lib/sys/vesacon_write.c
@@ -55,6 +55,7 @@ static struct ansi_ops op = {
.showcursor = vesacon_showcursor,
.set_cursor = __vesacon_set_cursor, /* in drawtxt.c */
.scroll_up = vesacon_scroll_up,
+ .beep = __ansicon_beep,
};
static struct term_info ti =