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.
13 __export
void writechr(char data
)
16 syslinux_force_text_mode();
18 write_serial(data
); /* write to serial port if needed */
20 /* Write to screen? */
21 if (DisplayCon
& 0x01) {
22 com32sys_t ireg
, oreg
;
26 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
27 ireg
.eax
.b
[1] = 0x03; /* Read cursor position */
28 __intcall(0x10, &ireg
, &oreg
);
29 ireg
.edx
.l
= oreg
.edx
.l
;
33 if (ireg
.edx
.b
[0]--) {
38 ireg
.edx
.b
[0] = VidCols
;
39 if (ireg
.edx
.b
[1]--) {
56 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
57 ireg
.ebx
.b
[0] = 0x07; /* White on black */
58 ireg
.ecx
.w
[0] = 1; /* One only */
60 ireg
.eax
.b
[1] = 0x09; /* Write char and attribute */
61 __intcall(0x10, &ireg
, NULL
);
64 if (++ireg
.edx
.b
[0] <= VidCols
)
70 if (!curxyok
&& ++ireg
.edx
.b
[1] > VidRows
) {
73 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
75 __intcall(0x10, &ireg
, NULL
);
77 ireg
.eax
.w
[0] = 0x0601; /* Scroll up one line */
78 ireg
.ebx
.b
[1] = ScrollAttribute
;
80 ireg
.edx
.w
[0] = ScreenSize
; /* The whole screen */
81 __intcall(0x10, &ireg
, NULL
);
83 ireg
.ebx
.b
[1] = *(uint8_t *)BIOS_page
;
84 ireg
.eax
.b
[1] = 0x02; /* Set cursor position */
85 __intcall(0x10, &ireg
, NULL
);
90 void pm_writechr(com32sys_t
*regs
)
92 writechr(regs
->eax
.b
[0]);