File: plaincon.c

package info (click to toggle)
syslinux 3%3A6.03%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 41,220 kB
  • sloc: ansic: 358,747; asm: 9,606; pascal: 4,809; perl: 3,894; makefile: 2,488; sh: 324; python: 266; xml: 39
file content (37 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <sys/io.h>
#include <fs.h>
#include <com32.h>

#include "bios.h"
#include "graphics.h"
#include <syslinux/video.h>

/*
 * Write a single character in AL to the console without
 * mangling any registers; handle video pages correctly.
 */
__export void writechr(char data)
{
	com32sys_t ireg, oreg;

        memset(&ireg, 0, sizeof ireg);
        memset(&oreg, 0, sizeof oreg);
	write_serial(data);	/* write to serial port if needed */

	if (UsingVGA & 0x8)
		syslinux_force_text_mode();

	if (!(DisplayCon & 0x1))
		return;

	ireg.eax.b[0] = data;
	ireg.eax.b[1] = 0xE;
	ireg.ebx.b[0] = 0x07;	/* attribute */
	ireg.ebx.b[1] = *(uint8_t *)BIOS_page; /* current page */
	__intcall(0x10, &ireg, &oreg);
}

void pm_writechr(com32sys_t *regs)
{
	writechr(regs->eax.b[0]);
}