#define MAX_PARMS 16
struct term_state {
+ int disabled;
int attr; /* Current display attribute */
int vtgraphics; /* VT graphics on/off */
int intensity;
static const struct term_state default_state =
{
+ .disabled = 0,
.attr = 0x07, /* Grey on black */
.vtgraphics = 0,
.intensity = 1,
static void __constructor ansicon_init(void)
{
static com32sys_t ireg; /* Auto-initalized to all zero */
+ com32sys_t oreg;
/* Initial state */
memcpy(&st, &default_state, sizeof st);
+ /* Are we disabled? */
+ ireg.eax.w[0] = 0x000b;
+ __intcall(0x22, &ireg, &oreg);
+
+ if ( (signed char)oreg.ebx.b[1] < 0 ) {
+ st.disabled = 1;
+ return;
+ }
+
/* Force text mode */
ireg.eax.w[0] = 0x0005;
__intcall(0x22, &ireg, NULL);
/* Get cursor shape */
ireg.eax.b[1] = 0x03;
ireg.ebx.b[1] = BIOS_PAGE;
- __intcall(0x10, &ireg, &ireg);
- st.cursor_type = ireg.ecx.w[0];
+ __intcall(0x10, &ireg, &oreg);
+ st.cursor_type = oreg.ecx.w[0];
}
/* Erase a region of the screen */
(void)fp;
+ if ( st.disabled )
+ return n; /* Nothing to do */
+
while ( count-- ) {
ansicon_putchar(*bufp++);
n++;
Output: DX Serial port I/O base (e.g. 3F8h = COM1...)
CX Baud rate divisor (1 = 115200 bps, 2 = 57600 bps...)
BX Flow control configuration bits (see syslinux.doc)
+ -> Bit 15 is set if the video console is disabled
If no serial port is configured, DX will be set to 0 and the
other registers are undefined.