summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons/syscons.h
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1998-09-15 18:16:39 +0000
committersos <sos@FreeBSD.org>1998-09-15 18:16:39 +0000
commit653c2af6aea50955f84c98c164cfd99edb197426 (patch)
tree0a8dfaf5cfe4668ea247fe425c8b3d1a87f595d6 /sys/dev/syscons/syscons.h
parent9a318dd66f83207c7abcee476e380d062939ea19 (diff)
downloadFreeBSD-src-653c2af6aea50955f84c98c164cfd99edb197426.zip
FreeBSD-src-653c2af6aea50955f84c98c164cfd99edb197426.tar.gz
Add VESA support to syscons.
Kazu writes: The VESA support code requires vm86 support. Make sure your kernel configuration file has the following line. options "VM86" If you want to statically link the VESA support code to the kernel, add the following option to the kernel configuration file. options "VESA" The vidcontrol command now accepts the following video mode names: VESA_132x25, VESA_132x43, VESA_132x50, VESA_132x60, VESA_800x600 The VESA_800x600 mode is a raster display mode. The 80x25 text will be displayed on the 800x600 screen. Useful for some laptop computers. vidcontrol accepts the new `-i <info>' option, where <info> must be either `adapter' or `mode'. When the `-i adapter' option is given, vidcontrol will print basic information (not much) on the video adapter. When the `-i mode' option is specified, vidcontrol will list video modes which are actually supported by the video adapter. Submitted by: Kazutaka YOKOTA yokota@FreeBSD.ORG
Diffstat (limited to 'sys/dev/syscons/syscons.h')
-rw-r--r--sys/dev/syscons/syscons.h92
1 files changed, 62 insertions, 30 deletions
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index b23a2ae..315946b 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -1,18 +1,18 @@
/*-
- * Copyright (c) 1995-1997 Søren Schmidt
+ * Copyright (c) 1995-1998 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer
- * in this position and unchanged.
+ * notice, this list of conditions and the following disclaimer,
+ * without modification, immediately at the beginning of the file.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
+ * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.h,v 1.38 1998/08/03 09:09:35 yokota Exp $
+ * $Id$
*/
#ifndef _I386_ISA_SYSCONS_H_
@@ -65,6 +65,9 @@
#define MOUSE_MOVED 0x01000
#define MOUSE_CUTTING 0x02000
#define MOUSE_VISIBLE 0x04000
+#define GRAPHICS_MODE 0x08000
+#define PIXEL_MODE 0x10000
+#define SAVER_RUNNING 0x20000
/* configuration flags */
#define VISUAL_BELL 0x00001
@@ -74,6 +77,7 @@
#define XT_KEYBD 0x00010
#define KBD_NORESET 0x00020
#define QUIET_BELL 0x00040
+#define VESA800X600 0x00080
/* attribute flags */
#define NORMAL_ATTR 0x00
@@ -84,9 +88,6 @@
#define FOREGROUND_CHANGED 0x10
#define BACKGROUND_CHANGED 0x20
-/* video hardware memory addresses */
-#define VIDEOMEM 0x000A0000
-
/* misc defines */
#define FALSE 0
#define TRUE 1
@@ -104,20 +105,6 @@
#define FONT_14 4
#define FONT_16 8
-/* defines related to hardware addresses */
-#define MONO_BASE 0x3B4 /* crt controller base mono */
-#define COLOR_BASE 0x3D4 /* crt controller base color */
-#define MISC 0x3C2 /* misc output register */
-#define ATC IO_VGA+0x00 /* attribute controller */
-#define TSIDX IO_VGA+0x04 /* timing sequencer idx */
-#define TSREG IO_VGA+0x05 /* timing sequencer data */
-#define PIXMASK IO_VGA+0x06 /* pixel write mask */
-#define PALRADR IO_VGA+0x07 /* palette read address */
-#define PALWADR IO_VGA+0x08 /* palette write address */
-#define PALDATA IO_VGA+0x09 /* palette data register */
-#define GDCIDX IO_VGA+0x0E /* graph data controller idx */
-#define GDCREG IO_VGA+0x0F /* graph data controller data */
-
/* special characters */
#define cntlc 0x03
#define cntld 0x04
@@ -141,6 +128,7 @@ typedef struct term_stat {
} term_stat;
typedef struct scr_stat {
+ int adp; /* video adapter index */
u_short *scr_buf; /* buffer when off screen */
int xpos; /* current X position */
int ypos; /* current Y position */
@@ -150,6 +138,8 @@ typedef struct scr_stat {
int ysize; /* Y text size */
int xpixel; /* X graphics size */
int ypixel; /* Y graphics size */
+ int xoff; /* X offset in pixel mode */
+ int yoff; /* Y offset in pixel mode */
int font_size; /* fontsize in Y direction */
int start; /* modified area start */
int end; /* modified area end */
@@ -186,7 +176,8 @@ typedef struct scr_stat {
int history_size; /* size of history buffer */
struct apmhook r_hook; /* reconfiguration support */
#ifdef SC_SPLASH_SCREEN
- u_char splash_save_mode; /* saved mode for splash screen */
+ int splash_save_mode; /* saved mode for splash screen */
+ int splash_save_status; /* saved status for splash screen */
#endif
} scr_stat;
@@ -195,18 +186,59 @@ typedef struct default_attr {
int rev_color; /* reverse hardware color */
} default_attr;
+
+#define ISTEXTSC(scp) (!((scp)->status \
+ & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE)))
+#define ISGRAPHSC(scp) (((scp)->status \
+ & (UNKNOWN_MODE | GRAPHICS_MODE)))
+#define ISPIXELSC(scp) (((scp)->status \
+ & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))\
+ == PIXEL_MODE)
+#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
+
+#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
+#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
+#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
+
/* misc prototypes used by different syscons related LKM's */
-void set_border(u_char color);
-void set_mode(scr_stat *scp);
-void copy_font(int operation, int font_type, char* font_image);
-void load_palette(char *palette);
+
+/* syscons.c */
+extern int (*sc_user_ioctl)(dev_t dev, int cmd, caddr_t data, int flag,
+ struct proc *p);
+
+int set_mode(scr_stat *scp);
+scr_stat *sc_get_scr_stat(dev_t dev);
+
+void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image);
+#define save_palette(scp, pal) (*biosvidsw.save_palette)((scp)->adp, pal)
+#define load_palette(scp, pal) (*biosvidsw.load_palette)((scp)->adp, pal)
+#define set_border(scp, col) (*biosvidsw.set_border)((scp)->adp, col)
+#define get_adapter(scp) (*biosvidsw.adapter)((scp)->adp)
+
int add_scrn_saver(void (*this)(int));
int remove_scrn_saver(void (*this)(int));
+void sc_clear_screen(scr_stat *scp);
+void sc_move_mouse(scr_stat *scp, int x, int y);
+int sc_clean_up(scr_stat *scp);
+void sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear);
+void sc_alloc_cut_buffer(scr_stat *scp, int wait);
+void sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait);
+
+/* scvidctl.c */
+int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode,
+ int xsize, int ysize, int fontsize);
+int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode);
+int sc_set_pixel_mode(scr_stat *scp, struct tty *tp,
+ int xsize, int ysize, int fontsize);
+int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
+ struct proc *p);
+
#ifdef SC_SPLASH_SCREEN
-void splash(int);
-int splash_load(void);
-int splash_unload(void);
+/* splash.c */
+void scsplash(int);
+int scsplash_load(scr_stat *scp);
+int scsplash_unload(scr_stat *scp);
#endif
#endif /* !_I386_ISA_SYSCONS_H_ */
OpenPOWER on IntegriCloud