1 /* $NetBSD: conio.S,v 1.7 2011/06/16 13:27:59 joerg Exp $ */
4 originally from: FreeBSD:sys/i386/boot/netboot/start2.S
7 #include <machine/asm.h>
11 /**************************************************************************
13 **************************************************************************/
17 call _C_LABEL(prot_to_real) # enter real mode
24 movw $0x184f, %dx /* 80x25 */
33 calll _C_LABEL(real_to_prot) # back to protected mode
39 /**************************************************************************
40 PUTC - Print a character
41 **************************************************************************/
45 call _C_LABEL(prot_to_real) # enter real mode
49 cmp $0x08, %al # backspace?
52 # Multiline backspace support.
54 movb $0x3, %ah # get cursor position
58 testb %dl, %dl # cursor on first column?
60 testb %dh, %dh # cursor not on first row?
62 decb %dh # move up one row
63 movb $0x4f, %dl # move to last column
65 movb $0x02, %ah # set cursor position
69 #endif /* defined(__minix) */
75 #endif /* defined(__minix) */
78 calll _C_LABEL(real_to_prot) # back to protected mode
84 /**************************************************************************
85 GETC - Get a character
86 **************************************************************************/
91 call _C_LABEL(prot_to_real) # enter real mode
98 calll _C_LABEL(real_to_prot) # back to protected mode
106 /**************************************************************************
107 ISSHIFT - Check for keyboard interrupt; via shift key
108 **************************************************************************/
113 call _C_LABEL(prot_to_real) # enter real mode
122 calll _C_LABEL(real_to_prot) # back to protected mode
130 /**************************************************************************
131 ISKEY - Check for keyboard input
132 **************************************************************************/
137 call _C_LABEL(prot_to_real) # enter real mode
145 calll _C_LABEL(real_to_prot) # back to protected mode