1/* 2 * Copyright (c) 1998 Michael Smith (msmith@freebsd.org) 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * 25 * From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp 26 * |
27 * $Id: comconsole.c,v 1.2 1998/09/17 23:52:09 msmith Exp $ |
28 */ 29 30#include <stand.h> 31#include <bootstrap.h> 32#include <btxv86.h> 33#include "libi386.h" 34 35static void comc_probe(struct console *cp); --- 45 unchanged lines hidden (view full) --- 81static int 82comc_getchar(void) 83{ 84 if (comc_ischar()) { 85 v86.ctl = 0; 86 v86.addr = 0x14; 87 v86.eax = 0x300; 88 v86int(); |
89 return(v86.eax & 0xff); |
90 } else { 91 return(-1); 92 } 93} 94 95static int 96comc_ischar(void) 97{ 98 v86.ctl = 0; 99 v86.addr = 0x14; 100 v86.eax = 0x200; 101 v86int(); 102 return(v86.eax & 0x1); 103} |