summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1997-05-15 05:43:59 +0000
committeryokota <yokota@FreeBSD.org>1997-05-15 05:43:59 +0000
commit3347d1b140b15275bc2bc10c7d432672c4a40ce8 (patch)
tree31268e439a64348629343e8f6cfb9d932bde5ddc /sys/isa
parentea4abe276a6357710cd8f12a7dc1d933f7370f4e (diff)
downloadFreeBSD-src-3347d1b140b15275bc2bc10c7d432672c4a40ce8.zip
FreeBSD-src-3347d1b140b15275bc2bc10c7d432672c4a40ce8.tar.gz
1) font loading (two fixes)
When an ioctl command SW_XXXX is issued, scioctl() checks if the font appropriate for the specified mode is already loaded. The check was correctly done for 8 line and 16 line fonts, but not for 14 line font. The symbols FONT_8, FONT_14 and FONT_16 were defined as numbers but were sometimes treated as bit flags. They are now defined as bit flags. 2) screen blinking (two fixes) Removed a redundant call to timeout() in do_bell(). Don't let blink_screen() write to the video buffer if the screen is in the graphics (UNKNOWN) mode. 3) screen saver timeout The ioctl command CONS_BLANKTIME sets the screen saver's timeout. The value of zero will disable the screen saver. If the screen saver is currently running it should be stopped. 4) border color and destructive cursor (two fixes) The border color and the cursor type can be changed via escape sequences. But only VGA can change the border color and set the cursor type to destructive (CHAR_CURSOR) in the current syscons. scan_esc() failed to check this. Reviewed by: sos
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/syscons.c51
-rw-r--r--sys/isa/syscons.h8
2 files changed, 37 insertions, 22 deletions
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index ae7b432..5d01115 100644
--- a/sys/isa/syscons.c
+++ b/sys/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.214 1997/05/07 10:42:06 yokota Exp $
+ * $Id: syscons.c,v 1.215 1997/05/07 20:02:38 peter Exp $
*/
#include "sc.h"
@@ -759,7 +759,13 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return 0;
case CONS_BLANKTIME: /* set screen saver timeout (0 = no saver) */
+ if (*(int *)data < 0)
+ return EINVAL;
scrn_blank_time = *(int*)data;
+ if ((scrn_blank_time == 0) && scrn_blanked) {
+ (*current_saver)(FALSE);
+ mark_all(cur_console);
+ }
return 0;
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
@@ -958,6 +964,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case SW_ENH_B40x25: case SW_ENH_C40x25:
case SW_ENH_B80x25: case SW_ENH_C80x25:
case SW_ENH_B80x43: case SW_ENH_C80x43:
+ case SW_EGAMONO80x25:
if (!crtc_vga || video_mode_ptr == NULL)
return ENXIO;
@@ -984,6 +991,12 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
scp->xsize = 80;
scp->ysize = 30;
break;
+ case M_ENH_C40x25: case M_ENH_B40x25:
+ case M_ENH_C80x25: case M_ENH_B80x25:
+ case M_EGAMONO80x25:
+ if (!(fonts_loaded & FONT_14))
+ return EINVAL;
+ /* FALL THROUGH */
default:
if ((cmd & 0xff) > M_VGA_CG320)
return EINVAL;
@@ -2176,10 +2189,11 @@ scan_esc(scr_stat *scp, u_char c)
break;
case 'A': /* set display border color */
- if (scp->term.num_param == 1)
+ if ((scp->term.num_param == 1) && crtc_vga) {
scp->border=scp->term.param[0] & 0xff;
if (scp == cur_console)
set_border(scp->border);
+ }
break;
case 'B': /* set bell pitch and duration */
@@ -2195,7 +2209,7 @@ scan_esc(scr_stat *scp, u_char c)
flags |= BLINK_CURSOR;
else
flags &= ~BLINK_CURSOR;
- if (scp->term.param[0] & 0x02) {
+ if ((scp->term.param[0] & 0x02) && crtc_vga) {
flags |= CHAR_CURSOR;
set_destructive_cursor(scp);
} else
@@ -2544,7 +2558,7 @@ init_scp(scr_stat *scp)
else
scp->mode = M_C80x25;
- scp->font_size = FONT_16;
+ scp->font_size = 16;
scp->xsize = COL;
scp->ysize = ROW;
scp->xpos = scp->ypos = 0;
@@ -3253,6 +3267,7 @@ special_80x50:
case M_B80x25: case M_C80x25:
case M_ENH_B40x25: case M_ENH_C40x25:
case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
modetable = video_mode_ptr + (scp->mode * 64);
setup_mode:
@@ -3260,11 +3275,11 @@ setup_mode:
scp->font_size = *(modetable + 2);
/* set font type (size) */
- if (scp->font_size < FONT_14) {
+ if (scp->font_size < 14) {
if (fonts_loaded & FONT_8)
copy_font(LOAD, FONT_8, font_8);
outb(TSIDX, 0x03); outb(TSREG, 0x0A); /* font 2 */
- } else if (scp->font_size >= FONT_16) {
+ } else if (scp->font_size >= 16) {
if (fonts_loaded & FONT_16)
copy_font(LOAD, FONT_16, font_16);
outb(TSIDX, 0x03); outb(TSREG, 0x00); /* font 0 */
@@ -3482,6 +3497,7 @@ set_normal_mode()
case M_B80x25: case M_C80x25:
case M_ENH_B40x25: case M_ENH_C40x25:
case M_ENH_B80x25: case M_ENH_C80x25:
+ case M_EGAMONO80x25:
case M_BG320: case M_CG320: case M_BG640:
case M_CG320_D: case M_CG640_E:
@@ -3576,11 +3592,11 @@ set_destructive_cursor(scr_stat *scp)
char *font_buffer;
- if (scp->font_size < FONT_14) {
+ if (scp->font_size < 14) {
font_buffer = font_8;
address = (caddr_t)VIDEOMEM + 0x8000;
}
- else if (scp->font_size >= FONT_16) {
+ else if (scp->font_size >= 16) {
font_buffer = font_16;
address = (caddr_t)VIDEOMEM;
}
@@ -3724,11 +3740,11 @@ draw_mouse_image(scr_stat *scp)
u_short *crt_pos = Crtat + (scp->mouse_pos - scp->scr_buf);
int font_size = scp->font_size;
- if (font_size < FONT_14) {
+ if (font_size < 14) {
font_buffer = font_8;
address = (caddr_t)VIDEOMEM + 0x8000;
}
- else if (font_size >= FONT_16) {
+ else if (font_size >= 16) {
font_buffer = font_16;
address = (caddr_t)VIDEOMEM;
}
@@ -3873,7 +3889,6 @@ do_bell(scr_stat *scp, int pitch, int duration)
if (scp != cur_console)
blink_in_progress += 2;
blink_screen(cur_console);
- timeout(blink_screen, cur_console, hz / 10);
} else {
if (scp != cur_console)
pitch *= 2;
@@ -3886,7 +3901,13 @@ blink_screen(void *arg)
{
scr_stat *scp = arg;
- if (blink_in_progress > 1) {
+ if ((scp->status & UNKNOWN_MODE) || (blink_in_progress <= 1)) {
+ blink_in_progress = FALSE;
+ mark_all(scp);
+ if (delayed_next_scr)
+ switch_scr(scp, delayed_next_scr - 1);
+ }
+ else {
if (blink_in_progress & 1)
fillw(kernel_default.std_color | scr_map[0x20],
Crtat, scp->xsize * scp->ysize);
@@ -3896,12 +3917,6 @@ blink_screen(void *arg)
blink_in_progress--;
timeout(blink_screen, scp, hz / 10);
}
- else {
- blink_in_progress = FALSE;
- mark_all(scp);
- if (delayed_next_scr)
- switch_scr(scp, delayed_next_scr - 1);
- }
}
#ifdef SC_SPLASH_SCREEN
diff --git a/sys/isa/syscons.h b/sys/isa/syscons.h
index 333fd86..047f5ad 100644
--- a/sys/isa/syscons.h
+++ b/sys/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$
+ * $Id: syscons.h,v 1.28 1997/02/22 09:37:17 peter Exp $
*/
#ifndef _I386_ISA_SYSCONS_H_
@@ -98,9 +98,9 @@
#define CONSOLE_BUFSIZE 1024
#define PCBURST 128
#define FONT_NONE 1
-#define FONT_8 8
-#define FONT_14 14
-#define FONT_16 16
+#define FONT_8 2
+#define FONT_14 4
+#define FONT_16 8
#define HISTORY_SIZE 100*80
/* defines related to hardware addresses */
OpenPOWER on IntegriCloud