diff options
author | yokota <yokota@FreeBSD.org> | 1998-10-01 11:39:18 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1998-10-01 11:39:18 +0000 |
commit | 3d34bf047babbcd0a199d4a7bc2464a62066bc78 (patch) | |
tree | f7fcb33db5f1af78f7a852d912e39a8b0ff77fd5 /sys | |
parent | 5b11e527361dc6279982c78cd72f2438aad9696e (diff) | |
download | FreeBSD-src-3d34bf047babbcd0a199d4a7bc2464a62066bc78.zip FreeBSD-src-3d34bf047babbcd0a199d4a7bc2464a62066bc78.tar.gz |
Yet another round of fixes for the VESA support code.
- Express various sizes in bytes, rather than Kbytes, in the video
mode and adapter information structures.
- Fill 0 in the linear buffer size field if the linear frame buffer
is not available.
- Remove SW_VESA_USER ioctl. It is still experimetal and was not meant
to be released.
- Fix missing cast operator.
- Correctly handle pointers returned by the VESA BIOS. The pointers
may point to the area either in the BIOS ROM or in the buffer supplied
by the caller.
- Set the destructive cursor at the right moment.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/syscons/scvesactl.c | 11 | ||||
-rw-r--r-- | sys/dev/syscons/scvidctl.c | 9 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 7 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.h | 3 | ||||
-rw-r--r-- | sys/i386/include/console.h | 4 | ||||
-rw-r--r-- | sys/i386/isa/scvesactl.c | 11 | ||||
-rw-r--r-- | sys/i386/isa/scvidctl.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/syscons.c | 7 | ||||
-rw-r--r-- | sys/i386/isa/syscons.h | 3 | ||||
-rw-r--r-- | sys/i386/isa/vesa.c | 81 | ||||
-rw-r--r-- | sys/i386/isa/videoio.c | 84 |
11 files changed, 120 insertions, 109 deletions
diff --git a/sys/dev/syscons/scvesactl.c b/sys/dev/syscons/scvesactl.c index 47b1862..aabfe19 100644 --- a/sys/dev/syscons/scvesactl.c +++ b/sys/dev/syscons/scvesactl.c @@ -23,7 +23,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: scvesactl.c,v 1.4 1998/09/26 03:34:10 yokota Exp $ + * $Id: scvesactl.c,v 1.5 1998/09/26 03:38:40 yokota Exp $ */ #include "sc.h" @@ -64,15 +64,6 @@ vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) scp = sc_get_scr_stat(tp->t_dev); switch (cmd) { - case SW_VESA_USER: - - mode = (int)data; - if ((*biosvidsw.get_info)(scp->adp, mode, &info)) - return ENODEV; - if (info.vi_flags & V_INFO_GRAPHICS) - goto vesa_graphics; - else - goto vesa_text; /* generic text modes */ case SW_TEXT_132x25: case SW_TEXT_132x30: diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c index e29c209..065dee2 100644 --- a/sys/dev/syscons/scvidctl.c +++ b/sys/dev/syscons/scvidctl.c @@ -23,7 +23,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: scvidctl.c,v 1.3 1998/09/25 11:55:46 yokota Exp $ + * $Id: scvidctl.c,v 1.4 1998/09/29 02:00:56 ache Exp $ */ #include "sc.h" @@ -49,7 +49,6 @@ extern scr_stat *cur_console; extern int fonts_loaded; extern int sc_history_size; extern u_char palette[]; -extern int sc_flags; int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, @@ -122,8 +121,6 @@ sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, if (scp == cur_console) set_mode(scp); scp->status &= ~UNKNOWN_MODE; - if (ISTEXTSC(scp) && (sc_flags & CHAR_CURSOR)) - set_destructive_cursor(scp); if (tp == NULL) return 0; @@ -251,7 +248,7 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, * memory size is larger than 64K. Because such modes require * bank switching to access the entire screen. XXX */ - if (info.vi_width*info.vi_height/8 > info.vi_window_size*1024) + if (info.vi_width*info.vi_height/8 > info.vi_window_size) return ENODEV; /* stop screen saver, etc */ @@ -383,7 +380,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) return sc_set_graphics_mode(scp, tp, cmd & 0xff); case KDSETMODE: /* set current mode of this (virtual) console */ - switch (*data) { + switch (*(int *)data) { case KD_TEXT: /* switch to TEXT (known) mode */ /* * If scp->mode is of graphics modes, we don't know which diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 095bbbd..479b544 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -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.c,v 1.281 1998/09/26 03:38:38 yokota Exp $ + * $Id: syscons.c,v 1.282 1998/09/29 02:00:56 ache Exp $ */ #include "sc.h" @@ -4068,7 +4068,7 @@ copy_font(scr_stat *scp, int operation, int font_size, u_char *buf) font_loading_in_progress = FALSE; } -void +static void set_destructive_cursor(scr_stat *scp) { u_char cursor[32]; @@ -4076,7 +4076,8 @@ set_destructive_cursor(scr_stat *scp) int font_size; int i; - if (!ISFONTAVAIL(get_adapter(scp)->va_flags) || !ISTEXTSC(scp)) + if (!ISFONTAVAIL(get_adapter(scp)->va_flags) + || (scp->status & (GRAPHICS_MODE | PIXEL_MODE))) return; if (scp->font_size < 14) { diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 7c263f6..0298cbb 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -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.42 1998/09/26 03:34:10 yokota Exp $ + * $Id: syscons.h,v 1.43 1998/09/29 02:00:57 ache Exp $ */ #ifndef _I386_ISA_SYSCONS_H_ @@ -219,7 +219,6 @@ int add_scrn_saver(void (*this)(int)); int remove_scrn_saver(void (*this)(int)); void sc_clear_screen(scr_stat *scp); -void set_destructive_cursor(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); diff --git a/sys/i386/include/console.h b/sys/i386/include/console.h index 638b74b..7f70bca 100644 --- a/sys/i386/include/console.h +++ b/sys/i386/include/console.h @@ -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: console.h,v 1.39 1998/09/15 18:16:37 sos Exp $ + * $Id: console.h,v 1.40 1998/09/23 09:58:45 yokota Exp $ */ #ifndef _MACHINE_CONSOLE_H_ @@ -531,7 +531,6 @@ typedef struct {int scr_size[3];} scr_size_t; #define M_VESA_64K_1280 0x11a /* 1280x1024, 5:6:5 */ #define M_VESA_FULL_1280 0x11b /* 1280x1024, 8:8:8 */ #define M_VESA_MODE_MAX 0x1ff -#define M_VESA_USER 0x1ff #define SW_VESA_CG640x400 _IO('V', M_VESA_CG640x400 - M_VESA_BASE) #define SW_VESA_CG640x480 _IO('V', M_VESA_CG640x480 - M_VESA_BASE) @@ -561,7 +560,6 @@ typedef struct {int scr_size[3];} scr_size_t; #define SW_VESA_32K_1280 _IO('V', M_VESA_32K_1280 - M_VESA_BASE) #define SW_VESA_64K_1280 _IO('V', M_VESA_64K_1280 - M_VESA_BASE) #define SW_VESA_FULL_1280 _IO('V', M_VESA_FULL_1280 - M_VESA_BASE) -#define SW_VESA_USER _IO('V', M_VESA_USER - M_VESA_BASE) #endif /* !_MACHINE_CONSOLE_H_ */ diff --git a/sys/i386/isa/scvesactl.c b/sys/i386/isa/scvesactl.c index 47b1862..aabfe19 100644 --- a/sys/i386/isa/scvesactl.c +++ b/sys/i386/isa/scvesactl.c @@ -23,7 +23,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: scvesactl.c,v 1.4 1998/09/26 03:34:10 yokota Exp $ + * $Id: scvesactl.c,v 1.5 1998/09/26 03:38:40 yokota Exp $ */ #include "sc.h" @@ -64,15 +64,6 @@ vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) scp = sc_get_scr_stat(tp->t_dev); switch (cmd) { - case SW_VESA_USER: - - mode = (int)data; - if ((*biosvidsw.get_info)(scp->adp, mode, &info)) - return ENODEV; - if (info.vi_flags & V_INFO_GRAPHICS) - goto vesa_graphics; - else - goto vesa_text; /* generic text modes */ case SW_TEXT_132x25: case SW_TEXT_132x30: diff --git a/sys/i386/isa/scvidctl.c b/sys/i386/isa/scvidctl.c index e29c209..065dee2 100644 --- a/sys/i386/isa/scvidctl.c +++ b/sys/i386/isa/scvidctl.c @@ -23,7 +23,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: scvidctl.c,v 1.3 1998/09/25 11:55:46 yokota Exp $ + * $Id: scvidctl.c,v 1.4 1998/09/29 02:00:56 ache Exp $ */ #include "sc.h" @@ -49,7 +49,6 @@ extern scr_stat *cur_console; extern int fonts_loaded; extern int sc_history_size; extern u_char palette[]; -extern int sc_flags; int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, @@ -122,8 +121,6 @@ sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, if (scp == cur_console) set_mode(scp); scp->status &= ~UNKNOWN_MODE; - if (ISTEXTSC(scp) && (sc_flags & CHAR_CURSOR)) - set_destructive_cursor(scp); if (tp == NULL) return 0; @@ -251,7 +248,7 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, * memory size is larger than 64K. Because such modes require * bank switching to access the entire screen. XXX */ - if (info.vi_width*info.vi_height/8 > info.vi_window_size*1024) + if (info.vi_width*info.vi_height/8 > info.vi_window_size) return ENODEV; /* stop screen saver, etc */ @@ -383,7 +380,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) return sc_set_graphics_mode(scp, tp, cmd & 0xff); case KDSETMODE: /* set current mode of this (virtual) console */ - switch (*data) { + switch (*(int *)data) { case KD_TEXT: /* switch to TEXT (known) mode */ /* * If scp->mode is of graphics modes, we don't know which diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index 095bbbd..479b544 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/isa/syscons.c @@ -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.c,v 1.281 1998/09/26 03:38:38 yokota Exp $ + * $Id: syscons.c,v 1.282 1998/09/29 02:00:56 ache Exp $ */ #include "sc.h" @@ -4068,7 +4068,7 @@ copy_font(scr_stat *scp, int operation, int font_size, u_char *buf) font_loading_in_progress = FALSE; } -void +static void set_destructive_cursor(scr_stat *scp) { u_char cursor[32]; @@ -4076,7 +4076,8 @@ set_destructive_cursor(scr_stat *scp) int font_size; int i; - if (!ISFONTAVAIL(get_adapter(scp)->va_flags) || !ISTEXTSC(scp)) + if (!ISFONTAVAIL(get_adapter(scp)->va_flags) + || (scp->status & (GRAPHICS_MODE | PIXEL_MODE))) return; if (scp->font_size < 14) { diff --git a/sys/i386/isa/syscons.h b/sys/i386/isa/syscons.h index 7c263f6..0298cbb 100644 --- a/sys/i386/isa/syscons.h +++ b/sys/i386/isa/syscons.h @@ -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.42 1998/09/26 03:34:10 yokota Exp $ + * $Id: syscons.h,v 1.43 1998/09/29 02:00:57 ache Exp $ */ #ifndef _I386_ISA_SYSCONS_H_ @@ -219,7 +219,6 @@ int add_scrn_saver(void (*this)(int)); int remove_scrn_saver(void (*this)(int)); void sc_clear_screen(scr_stat *scp); -void set_destructive_cursor(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); diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c index 2f7c126..3006d5a 100644 --- a/sys/i386/isa/vesa.c +++ b/sys/i386/isa/vesa.c @@ -23,7 +23,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: vesa.c,v 1.3 1998/09/25 11:55:46 yokota Exp $ + * $Id: vesa.c,v 1.6 1998/09/29 20:38:54 ache Exp $ */ #include "sc.h" @@ -110,6 +110,10 @@ static int vesa_init_done = FALSE; static int has_vesa_bios = FALSE; static struct vesa_info *vesa_adp_info = NULL; static u_int16_t *vesa_vmodetab = NULL; +static char *vesa_oemstr = NULL; +static char *vesa_venderstr = NULL; +static char *vesa_prodstr = NULL; +static char *vesa_revstr = NULL; /* local macros and functions */ #define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff)) @@ -132,6 +136,8 @@ static int vesa_bios_state_buf_size(void); static int vesa_bios_save_restore(int code, void *p, size_t size); static int vesa_map_gen_mode_num(int type, int color, int mode); static int vesa_translate_flags(u_int16_t vflags); +static void *vesa_fix_ptr(u_int32_t p, u_int16_t seg, u_int16_t off, + u_char *buf); static int vesa_bios_init(void); static void vesa_clear_modes(video_info_t *info, int color); @@ -324,6 +330,19 @@ vesa_translate_flags(u_int16_t vflags) return flags; } +static void +*vesa_fix_ptr(u_int32_t p, u_int16_t seg, u_int16_t off, u_char *buf) +{ + if (p == 0) + return NULL; + if (((p >> 16) == seg) && ((p & 0xffff) >= off)) + return (void *)(buf + ((p & 0xffff) - off)); + else { + p = BIOS_SADDRTOLADDR(p); + return (void *)BIOS_PADDRTOVADDR(p); + } +} + static int vesa_bios_init(void) { @@ -356,10 +375,30 @@ vesa_bios_init(void) if (vesa_adp_info->v_flags & V_NONVGA) return 1; + /* fix string ptrs */ + vesa_oemstr = (char *)vesa_fix_ptr(vesa_adp_info->v_oemstr, + vmf.vmf_es, vmf.vmf_di, buf); + if (vesa_adp_info->v_version >= 0x0200) { + vesa_venderstr = + (char *)vesa_fix_ptr(vesa_adp_info->v_venderstr, + vmf.vmf_es, vmf.vmf_di, buf); + vesa_prodstr = + (char *)vesa_fix_ptr(vesa_adp_info->v_prodstr, + vmf.vmf_es, vmf.vmf_di, buf); + vesa_revstr = + (char *)vesa_fix_ptr(vesa_adp_info->v_revstr, + vmf.vmf_es, vmf.vmf_di, buf); + } + /* obtain video mode information */ - p = BIOS_SADDRTOLADDR(vesa_adp_info->v_modetable); - vesa_vmodetab = (u_int16_t *)BIOS_PADDRTOVADDR(p); - for (i = 0, modes = 0; vesa_vmodetab[i] != 0xffff; ++i) { + vesa_vmode[0].vi_mode = EOT; + vesa_vmodetab = (u_int16_t *)vesa_fix_ptr(vesa_adp_info->v_modetable, + vmf.vmf_es, vmf.vmf_di, buf); + if (vesa_vmodetab == NULL) + return 1; + for (i = 0, modes = 0; + (i < (M_VESA_MODE_MAX - M_VESA_BASE + 1)) + && (vesa_vmodetab[i] != 0xffff); ++i) { if (modes >= VESA_MAXMODES) break; if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode)) @@ -388,10 +427,10 @@ vesa_bios_init(void) vesa_vmode[modes].vi_cheight = vmode.v_cheight; vesa_vmode[modes].vi_window = (u_int)vmode.v_waseg << 4; /* XXX window B */ - vesa_vmode[modes].vi_window_size = vmode.v_wsize; - vesa_vmode[modes].vi_window_gran = vmode.v_wgran; + vesa_vmode[modes].vi_window_size = vmode.v_wsize*1024; + vesa_vmode[modes].vi_window_gran = vmode.v_wgran*1024; vesa_vmode[modes].vi_buffer = vmode.v_lfb; - vesa_vmode[modes].vi_buffer_size = vmode.v_offscreen; + vesa_vmode[modes].vi_buffer_size = vmode.v_offscreen*1024; /* pixel format, memory model... */ vesa_vmode[modes].vi_flags = vesa_translate_flags(vmode.v_modeattr) | V_INFO_VESA; @@ -401,8 +440,8 @@ vesa_bios_init(void) if (bootverbose) printf("VESA: %d mode(s) found\n", modes); - has_vesa_bios = TRUE; - return 0; + has_vesa_bios = (modes > 0); + return (has_vesa_bios ? 0 : 1); } static void @@ -736,30 +775,28 @@ vesa_diag(int level) vesa_adp_info->v_memsize * 64, vesa_adp_info->v_flags, vesa_vmodetab, vesa_adp_info->v_modetable); /* OEM string */ - p = BIOS_SADDRTOLADDR(vesa_adp_info->v_oemstr); - if (p != 0) - printf("VESA: %s\n", (char *)BIOS_PADDRTOVADDR(p)); + if (vesa_oemstr != NULL) + printf("VESA: %s\n", vesa_oemstr); if (level <= 0) return 0; if (vesa_adp_info->v_version >= 0x0200) { /* vendor name */ - p = BIOS_SADDRTOLADDR(vesa_adp_info->v_venderstr); - if (p != 0) - printf("VESA: %s, ", (char *)BIOS_PADDRTOVADDR(p)); + if (vesa_venderstr != NULL) + printf("VESA: %s\n", vesa_venderstr); /* product name */ - p = BIOS_SADDRTOLADDR(vesa_adp_info->v_prodstr); - if (p != 0) - printf("%s, ", (char *)BIOS_PADDRTOVADDR(p)); + if (vesa_prodstr != NULL) + printf("VESA: %s\n", vesa_prodstr); /* product revision */ - p = BIOS_SADDRTOLADDR(vesa_adp_info->v_revstr); - if (p != 0) - printf("%s\n", (char *)BIOS_PADDRTOVADDR(p)); + if (vesa_revstr != NULL) + printf("VESA: %s\n", vesa_revstr); } /* mode information */ - for (i = 0; vesa_vmodetab[i] != 0xffff; ++i) { + for (i = 0; + (i < (M_VESA_MODE_MAX - M_VESA_BASE + 1)) + && (vesa_vmodetab[i] != 0xffff); ++i) { if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode)) continue; diff --git a/sys/i386/isa/videoio.c b/sys/i386/isa/videoio.c index d4da9c8..5710080 100644 --- a/sys/i386/isa/videoio.c +++ b/sys/i386/isa/videoio.c @@ -26,7 +26,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: videoio.c,v 1.4 1998/09/25 11:55:46 yokota Exp $ + * $Id: videoio.c,v 1.5 1998/09/26 03:38:40 yokota Exp $ */ #include "sc.h" @@ -73,12 +73,12 @@ typedef struct adp_state adp_state_t; * will perform address conversion at run-time. */ static video_adapter_t adapter_init_value[] = { - { 0, KD_MONO, 0, MONO_BASE, 0xb0000, 32, 32, 0, 0, 0, 7, 0 }, - { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32, 32, 0, 0, 0, 3, 0 }, - { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32, 32, 0, 0, 0, 3, 0 }, - { 0, KD_EGA, 0, MONO_BASE, 0xb0000, 32, 32, 0, 0, 0, 7, 0 }, - { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32, 32, 0, 0, 0, 3, 0 }, - { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32, 32, 0, 0, 0, 3, 0 }, + { 0, KD_MONO, 0, MONO_BASE, 0xb0000, 32*1024, 32*1024, 0, 0, 0, 7, 0 }, + { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 }, + { 0, KD_CGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 }, + { 0, KD_EGA, 0, MONO_BASE, 0xb0000, 32*1024, 32*1024, 0, 0, 0, 7, 0 }, + { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 }, + { 0, KD_EGA, V_ADP_COLOR, COLOR_BASE, 0xb8000, 32*1024, 32*1024, 0, 0, 0, 3, 0 }, }; static video_adapter_t adapter[V_MAX_ADAPTERS]; @@ -117,60 +117,60 @@ struct vidsw biosvidsw = { static video_info_t bios_vmode[] = { /* CGA */ - { M_B40x25, V_INFO_COLOR, 40, 25, 8, 8, 2, 1, 0xb8000, 32, 32, 0, 32 }, - { M_C40x25, V_INFO_COLOR, 40, 25, 8, 8, 4, 1, 0xb8000, 32, 32, 0, 32 }, - { M_B80x25, V_INFO_COLOR, 80, 25, 8, 8, 2, 1, 0xb8000, 32, 32, 0, 32 }, - { M_C80x25, V_INFO_COLOR, 80, 25, 8, 8, 4, 1, 0xb8000, 32, 32, 0, 32 }, + { M_B40x25, V_INFO_COLOR, 40, 25, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_C40x25, V_INFO_COLOR, 40, 25, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_B80x25, V_INFO_COLOR, 80, 25, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_C80x25, V_INFO_COLOR, 80, 25, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, /* EGA */ - { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1, 0xb8000, 32, 32, 0, 32 }, - { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1, 0xb8000, 32, 32, 0, 32 }, - { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1, 0xb8000, 32, 32, 0, 32 }, - { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1, 0xb8000, 32, 32, 0, 32 }, + { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, /* VGA */ - { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1, 0xb8000, 32, 32, 0, 32 }, - { M_VGA_M80x25, 0, 80, 25, 8, 16, 2, 1, 0xb0000, 32, 32, 0, 32 }, - { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1, 0xb8000, 32, 32, 0, 32 }, + { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_M80x25, 0, 80, 25, 8, 16, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, /* MDA */ - { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1, 0xb0000, 32, 32, 0, 32 }, + { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 }, /* EGA */ - { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1, 0xb8000, 32, 32, 0, 32 }, - { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1, 0xb8000, 32, 32, 0, 32 }, + { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, /* VGA */ - { M_VGA_M80x30, 0, 80, 30, 8, 16, 2, 1, 0xb0000, 32, 32, 0, 32 }, - { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1, 0xb8000, 32, 32, 0, 32 }, - { M_VGA_M80x50, 0, 80, 50, 8, 8, 2, 1, 0xb0000, 32, 32, 0, 32 }, - { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8, 8, 4, 1, 0xb8000, 32, 32, 0, 32 }, - { M_VGA_M80x60, 0, 80, 60, 8, 8, 2, 1, 0xb0000, 32, 32, 0, 32 }, - { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8, 8, 4, 1, 0xb8000, 32, 32, 0, 32 }, + { M_VGA_M80x30, 0, 80, 30, 8, 16, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_M80x50, 0, 80, 50, 8, 8, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_M80x60, 0, 80, 60, 8, 8, 2, 1, 0xb0000, 32*1024, 32*1024, 0, 0 }, + { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8, 8, 4, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, /* CGA */ { M_BG320, V_INFO_COLOR | V_INFO_GRAPHICS, - 320, 200, 8, 8, 2, 1, 0xb8000, 32, 32, 0, 32 }, + 320, 200, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, { M_CG320, V_INFO_COLOR | V_INFO_GRAPHICS, - 320, 200, 8, 8, 2, 1, 0xb8000, 32, 32, 0, 32 }, + 320, 200, 8, 8, 2, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, { M_BG640, V_INFO_COLOR | V_INFO_GRAPHICS, - 640, 200, 8, 8, 1, 1, 0xb8000, 32, 32, 0, 32 }, + 640, 200, 8, 8, 1, 1, 0xb8000, 32*1024, 32*1024, 0, 0 }, /* EGA */ { M_CG320_D, V_INFO_COLOR | V_INFO_GRAPHICS, - 320, 200, 8, 8, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 320, 200, 8, 8, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_CG640_E, V_INFO_COLOR | V_INFO_GRAPHICS, - 640, 200, 8, 8, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 640, 200, 8, 8, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_EGAMONOAPA, V_INFO_GRAPHICS, - 640, 350, 8, 14, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_ENHMONOAPA2,V_INFO_GRAPHICS, - 640, 350, 8, 14, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_CG640x350, V_INFO_COLOR | V_INFO_GRAPHICS, - 640, 350, 8, 14, 2, 2, 0xa0000, 64, 64, 0, 64 }, + 640, 350, 8, 14, 2, 2, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_ENH_CG640, V_INFO_COLOR | V_INFO_GRAPHICS, - 640, 350, 8, 14, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 640, 350, 8, 14, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, /* VGA */ { M_BG640x480, V_INFO_COLOR | V_INFO_GRAPHICS, - 640, 480, 8, 16, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 640, 480, 8, 16, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_CG640x480, V_INFO_COLOR | V_INFO_GRAPHICS, - 640, 480, 8, 16, 4, 4, 0xa0000, 64, 64, 0, 64 }, + 640, 480, 8, 16, 4, 4, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_VGA_CG320, V_INFO_COLOR | V_INFO_GRAPHICS, - 320, 200, 8, 8, 8, 1, 0xa0000, 64, 64, 0, 64 }, + 320, 200, 8, 8, 8, 1, 0xa0000, 64*1024, 64*1024, 0, 0 }, { M_VGA_MODEX, V_INFO_COLOR | V_INFO_GRAPHICS, - 320, 240, 8, 8, 8, 1, 0xa0000, 64, 64, 0, 64 }, + 320, 240, 8, 8, 8, 1, 0xa0000, 64*1024, 64*1024, 0, 0 }, { EOT }, }; @@ -1659,8 +1659,8 @@ dump_adp_info(int ad, video_adapter_t *adp, int level) ad, adp->va_initial_mode, adp->va_initial_bios_mode, adp->va_mode); printf("video#%d: window:0x%x size:%dk gran:%dk, buf:0x%x size:%dk\n", ad, - adp->va_window, adp->va_window_size, adp->va_window_gran, - adp->va_buffer, adp->va_buffer_size); + adp->va_window, adp->va_window_size/1024, adp->va_window_gran/1024, + adp->va_buffer, adp->va_buffer_size/1024); } static void |