1 /* -*- linux-c -*- ------------------------------------------------------- *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007 rPath, Inc. - All Rights Reserved
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
9 * ----------------------------------------------------------------------- */
12 * arch/i386/boot/tty.c
14 * Very simple screen I/O
15 * XXX: Probably should add very simple serial I/O?
21 * These functions are in .inittext so they can be used to signal
22 * error during initialization.
25 void __attribute__((section(".inittext"))) putchar(int ch
)
30 putchar('\r'); /* \n -> \r\n */
32 /* int $0x10 is known to have bugs involving touching registers
33 it shouldn't. Be extra conservative... */
34 asm volatile("pushal; pushw %%ds; int $0x10; popw %%ds; popal"
35 : : "b" (0x0007), "c" (0x0001), "a" (0x0e00|ch
));
38 void __attribute__((section(".inittext"))) puts(const char *str
)
48 * Read the CMOS clock through the BIOS, and return the
52 static u8
gettime(void)
57 asm volatile("int $0x1a"
58 : "+a" (ax
), "=c" (cx
), "=d" (dx
)
59 : : "ebx", "esi", "edi");
65 * Read from the keyboard
70 asm volatile("int $0x16" : "+a" (ax
));
75 static int kbd_pending(void)
78 asm volatile("int $0x16; setnz %0"
93 int getchar_timeout(void)
111 return 0; /* Timeout! */