2 * writechr: Write a single character in AL to the console without
3 * mangling any registers. This does raw console writes,
4 * since some PXE BIOSes seem to interfere regular console I/O.
12 #include <syslinux/video.h>
14 __export
void writechr(char data
)
17 syslinux_force_text_mode();
19 write_serial(data
); /* write to serial port if needed */
21 /* Write to screen? */
22 if (DisplayCon
& 0x01) {
23 com32sys_t ireg
, oreg
;
27 memset(&ireg
, 0, sizeof ireg
);
28 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
29 ireg
.eax
.b
[1] = 0x03; /* Read cursor position */
30 __intcall(0x10, &ireg
, &oreg
);
31 ireg
.edx
.l
= oreg
.edx
.l
;
35 if (ireg
.edx
.b
[0]--) {
40 ireg
.edx
.b
[0] = VidCols
;
41 if (ireg
.edx
.b
[1]--) {
58 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
59 ireg
.ebx
.b
[0] = 0x07; /* White on black */
60 ireg
.ecx
.w
[0] = 1; /* One only */
62 ireg
.eax
.b
[1] = 0x09; /* Write char and attribute */
63 __intcall(0x10, &ireg
, NULL
);
66 if (++ireg
.edx
.b
[0] <= VidCols
)
72 if (!curxyok
&& ++ireg
.edx
.b
[1] > VidRows
) {
75 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
77 __intcall(0x10, &ireg
, NULL
);
79 ireg
.eax
.w
[0] = 0x0601; /* Scroll up one line */
80 ireg
.ebx
.b
[1] = ScrollAttribute
;
82 ireg
.edx
.w
[0] = ScreenSize
; /* The whole screen */
83 __intcall(0x10, &ireg
, NULL
);
85 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
86 ireg
.eax
.b
[1] = 0x02; /* Set cursor position */
87 __intcall(0x10, &ireg
, NULL
);
92 void pm_writechr(com32sys_t
*regs
)
94 writechr(regs
->eax
.b
[0]);