Deleted Added
full compact
vidconsole.c (50477) vidconsole.c (64187)
1/*
2 * Copyright (c) 1998 Michael Smith (msmith@freebsd.org)
3 * Copyright (c) 1997 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
28 *
1/*
2 * Copyright (c) 1998 Michael Smith (msmith@freebsd.org)
3 * Copyright (c) 1997 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp
28 *
29 * $FreeBSD: head/sys/boot/i386/libi386/vidconsole.c 50477 1999-08-28 01:08:13Z peter $
29 * $FreeBSD: head/sys/boot/i386/libi386/vidconsole.c 64187 2000-08-03 09:14:02Z jhb $
30 */
31
32#include <stand.h>
33#include <bootstrap.h>
34#include <btxv86.h>
35#include <machine/psl.h>
36#include "libi386.h"
37

--- 6 unchanged lines hidden (view full) ---

44static int vidc_init(int arg);
45static void vidc_putchar(int c);
46static int vidc_getchar(void);
47static int vidc_ischar(void);
48
49static int vidc_started;
50
51#ifdef TERM_EMU
30 */
31
32#include <stand.h>
33#include <bootstrap.h>
34#include <btxv86.h>
35#include <machine/psl.h>
36#include "libi386.h"
37

--- 6 unchanged lines hidden (view full) ---

44static int vidc_init(int arg);
45static void vidc_putchar(int c);
46static int vidc_getchar(void);
47static int vidc_ischar(void);
48
49static int vidc_started;
50
51#ifdef TERM_EMU
52void end_term();
52void end_term(void);
53void bail_out(int c);
54void vidc_term_emu(int c);
55void get_pos(void);
56void curs_move(int x, int y);
57void write_char(int c, int fg, int bg);
58void scroll_up(int rows, int fg, int bg);
53void bail_out(int c);
54void vidc_term_emu(int c);
55void get_pos(void);
56void curs_move(int x, int y);
57void write_char(int c, int fg, int bg);
58void scroll_up(int rows, int fg, int bg);
59int pow10(int i);
59void AB(void);
60void AF(void);
61void CD(void);
62void CM(void);
63void HO(void);
64void ME(void);
65
66static int args[2],argc,br;

--- 32 unchanged lines hidden (view full) ---

99}
100
101static int
102vidc_init(int arg)
103{
104 int i;
105
106 if (vidc_started && arg == 0)
60void AB(void);
61void AF(void);
62void CD(void);
63void CM(void);
64void HO(void);
65void ME(void);
66
67static int args[2],argc,br;

--- 32 unchanged lines hidden (view full) ---

100}
101
102static int
103vidc_init(int arg)
104{
105 int i;
106
107 if (vidc_started && arg == 0)
107 return;
108 return(0);
108 vidc_started = 1;
109#ifdef TERM_EMU
110 /* Init terminal emulator */
111 end_term();
112 get_pos();
113 curs_move(curx,cury);
114 fg_c=7;
115 bg_c=0;

--- 113 unchanged lines hidden (view full) ---

229 }
230}
231
232/* Scroll up the whole window by a number of rows. If rows==0,
233 * clear the window. fg and bg are attributes for the new lines
234 * inserted in the window.
235 */
236void
109 vidc_started = 1;
110#ifdef TERM_EMU
111 /* Init terminal emulator */
112 end_term();
113 get_pos();
114 curs_move(curx,cury);
115 fg_c=7;
116 bg_c=0;

--- 113 unchanged lines hidden (view full) ---

230 }
231}
232
233/* Scroll up the whole window by a number of rows. If rows==0,
234 * clear the window. fg and bg are attributes for the new lines
235 * inserted in the window.
236 */
237void
237scroll_up(int rows, int fg, int bg)
238scroll_up(int rows, int fgcol, int bgcol)
238{
239 if(rows==0) rows=25;
240 v86.ctl = 0;
241 v86.addr = 0x10;
242 v86.eax = 0x0600+(0x00ff & rows);
239{
240 if(rows==0) rows=25;
241 v86.ctl = 0;
242 v86.addr = 0x10;
243 v86.eax = 0x0600+(0x00ff & rows);
243 v86.ebx = (bg<<12)+(fg<<8);
244 v86.ebx = (bgcol<<12)+(fgcol<<8);
244 v86.ecx = 0x0;
245 v86.edx = 0x184f;
246 v86int();
247}
248
249/* Write character and attribute at cursor position. */
250void
245 v86.ecx = 0x0;
246 v86.edx = 0x184f;
247 v86int();
248}
249
250/* Write character and attribute at cursor position. */
251void
251write_char(int c, int fg, int bg)
252write_char(int c, int fgcol, int bgcol)
252{
253 v86.ctl=0;
254 v86.addr = 0x10;
255 v86.eax = 0x0900+(0x00ff & c);
253{
254 v86.ctl=0;
255 v86.addr = 0x10;
256 v86.eax = 0x0900+(0x00ff & c);
256 v86.ebx = (bg<<4)+fg;
257 v86.ebx = (bgcol<<4)+fgcol;
257 v86.ecx = 0x1;
258 v86int();
259}
260
261/* Calculate power of 10 */
262int
263pow10(int i)
264{

--- 363 unchanged lines hidden ---
258 v86.ecx = 0x1;
259 v86int();
260}
261
262/* Calculate power of 10 */
263int
264pow10(int i)
265{

--- 363 unchanged lines hidden ---