Releasing debian version 6.03~pre1+dfsg-3.
[syslinux-debian/hramrach.git] / core / plaincon.c
blob2b7c4a63036652b36bf27b3ba42a463e30451832
1 #include <sys/io.h>
2 #include <fs.h>
3 #include <com32.h>
5 #include "bios.h"
6 #include "graphics.h"
7 #include <syslinux/video.h>
9 /*
10 * Write a single character in AL to the console without
11 * mangling any registers; handle video pages correctly.
13 __export void writechr(char data)
15 com32sys_t ireg, oreg;
17 write_serial(data); /* write to serial port if needed */
19 if (UsingVGA & 0x8)
20 syslinux_force_text_mode();
22 if (!(DisplayCon & 0x1))
23 return;
25 ireg.eax.b[0] = data;
26 ireg.eax.b[1] = 0xE;
27 ireg.ebx.b[0] = 0x07; /* attribute */
28 ireg.ebx.b[1] = *(uint8_t *)BIOS_page; /* current page */
29 __intcall(0x10, &ireg, &oreg);
32 void pm_writechr(com32sys_t *regs)
34 writechr(regs->eax.b[0]);