Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Nov 1996 17:50:19 +1100
From:      Julian Assange <proff@profane.iq.org>
To:        freebsd-hackers@freebsd.org
Subject:   patches for nice text modes (SVGATextMode-1.4-src)
Message-ID:  <199611071319.AAA01321@profane.iq.org>

next in thread | raw e-mail | index | archive | help

These patches are against:

	ftp://sunsite.unc.edu/pub/Linux/utils/console/SVGATextMode-1.4-src.tar.gz


diff -N -u -r old/SVGATextMode-1.4-src/Makefile SVGATextMode-1.4-src/Makefile
--- old/SVGATextMode-1.4-src/Makefile	Sun Sep 22 20:54:34 1996
+++ SVGATextMode-1.4-src/Makefile	Thu Nov  7 17:41:36 1996
@@ -8,7 +8,7 @@
 #                                  - DJGPP 2.0
 #
 
-ARCH=$(shell arch)
+ARCH=i386
 CFLAGS_alpha =
 CFLAGS_i386  = -pipe
 CFLAGS_i486  = $(CFLAGS_i386) -m486
@@ -138,7 +138,7 @@
 
 PAL_OBJECTS = setpalette.o vga_prg.o string_ops.o messages.o file_ops.o kversion.o
 
-GRAB_OBJECTS = grabmode.o modedata.o probe.o wait_vsync.o vga_prg.o messages.o string_ops.o
+GRAB_OBJECTS = grabmode.o modedata.o probe.o wait_vsync.o vga_prg.o messages.o string_ops.o file_ops.o
 
 #PCLKS_OBJECTS = probeclocks.o messages.o vga_prg.o setclock.o file_ops.o \
 #                run_extprog.o clockchip.o std_clock.o modedata.o probe.o wait_vsync.o
diff -N -u -r old/SVGATextMode-1.4-src/SVGATextMode.c SVGATextMode-1.4-src/SVGATextMode.c
--- old/SVGATextMode-1.4-src/SVGATextMode.c	Fri May 31 04:43:50 1996
+++ SVGATextMode-1.4-src/SVGATextMode.c	Fri Oct 18 01:57:50 1996
@@ -34,7 +34,7 @@
 #include <unistd.h>
 #include <math.h>
 
-#ifndef DOS
+#ifdef linux
 #  include <asm/io.h>
 #  include <linux/fs.h>
 #  include <sys/ioctl.h>
@@ -291,8 +291,10 @@
        * first see if current kernel version supports resizing.
        */
        
+#ifdef linux
        if (!check_kernel_version(1,1,54, "Virtual Terminal resizing"))
          PERROR(("Screen resizing not allowed (kernel version must be >= 1.1.54). Use a non-resizing text mode, or upgrade your kernel.\n"));
+#endif
 
       /*
        * Resize the screen. Still needs LOTS more error checking to avoid dropping out in the middle, leaving
@@ -308,9 +310,11 @@
          * until those kernel programmers make this unambiguous
          */
       
+#ifdef linux
        if (do_VT_RESIZE(curr_textmode->cols, curr_textmode->rows, resize1x1)) sresize=TRUE;
          
        if (check_kernel_version(1,3,3, "VT_RESIZEX"))
+#endif
          {
            /*
             * VDisplay must de divided by 2 for DoubleScan modes,
@@ -332,11 +336,13 @@
        * a call to VT_RESIZE)
        */
           
+#ifdef linux
        if (!check_kernel_version(1,3,3, "Automatic TTY resizing (SIGWINCH)"))
        {
          if (p_terminals) resize_specified_vts(curr_textmode->cols, curr_textmode->rows);
            else resize_active_vts(curr_textmode->cols, curr_textmode->rows);
        }
+#endif
      }
 
 #  else 
@@ -386,8 +392,10 @@
     Set_Textmode;  /* just in case some jerk set us in graphics mode. Or if he's in X-windows: surprise surprise ! */
 
 #ifndef DOS
+#ifndef __FreeBSD__
     /* set console to text mode */
     ioctl(opentty("/dev/console"), KDSETMODE, KD_TEXT);
+#endif
 #endif
 
     if (set_charwidth(curr_textmode->FontWidth)) PERROR(("Illegal character width: %d\n",curr_textmode->FontWidth));
diff -N -u -r old/SVGATextMode-1.4-src/TextConfig SVGATextMode-1.4-src/TextConfig
--- old/SVGATextMode-1.4-src/TextConfig	Sun Sep 15 21:27:06 1996
+++ SVGATextMode-1.4-src/TextConfig	Fri Oct 18 03:00:56 1996
@@ -60,8 +60,8 @@
 # This is for a "generic" VGA card. It should work on ANY VGA card, but can
 # only use the first 4 clocks
 
-Chipset "VGA"
-Clocks  25.175 28.322
+#Chipset "VGA"
+#Clocks  25.175 28.322
 
 echo "The SVGATextMode config file is configured as `standard VGA' by default."
 echo "This is highly sub-optimal on modern VGA cards."
@@ -74,7 +74,7 @@
 #
 # Now come the SVGA chipsets
 
-#ChipSet	"S3"
+ChipSet	"S3"
 
 #Clocks   25.175  28.322  40.00   0.00   50.00  77.00  36.00  44.90
 #Clocks   130.00  120.00  80.00  31.50  110.00  65.00  75.00  94.50
@@ -87,7 +87,7 @@
 #ClockChip "sc11412"
 #ClockChip "s3gendac"
 #ClockChip "s3_sdac"
-#ClockChip "S3Trio"
+ClockChip "S3Trio"
 #ClockChip "S3Virge"
 #ClockChip "ti3025"
 #ClockChip "ics2595"
@@ -108,7 +108,7 @@
 #Option "SLOW_DRAM"
 #Option "MED_DRAM"
 #Option "FAST_DRAM"
-#Option "XFAST_DRAM"
+Option "XFAST_DRAM"
 
 # This option enables S3 high-speed text modes for pixel clocks > 36 MHz.
 # USE WITH CAUTION! This needs a different font format in VGA memory. Read
@@ -118,7 +118,7 @@
 # before strange effects appear. Older S3 cards (911, 924, 928, ...) need
 # this option for modes with >36 MHz pixel clocks
 
-#Option "S3_HSText"
+Option "S3_HSText"
 
 # IBM RGB RAMDAC's absolutely _need_ this. You will have to copy this value
 # from the output of the XFree86 server startup messages. MAKE SURE THIS
@@ -283,7 +283,7 @@
 # cards, and is useless on cards with a programmable clock chip.
 # Cirrus cards seem not to like this feature!
 #
-Option "ClockDiv2"
+#Option "ClockDiv2"
 
 #############################################################################
 #
@@ -388,13 +388,21 @@
 #
 
 Option "LoadFont"
-FontProg "/usr/bin/setfont"
-FontPath "/usr/lib/kbd/consolefonts"
-FontSelect "Cyr_a8x16"   8x16 9x16 8x15 9x15 
-FontSelect "Cyr_a8x14"   8x14 9x14 8x13 9x13
-FontSelect "8x12alt.psf" 8x12 9x12 8x11 9x11
-FontSelect "Cyr_a8x8"    8x8  9x8  8x7  9x7
-FontSelect "Cyr_a8x32"   8x32 9x32 8x31 9x31
+#FontProg "./setfont"
+#FontPath "."
+#FontSelect "Cyr_a8x16"   8x16 9x16 8x15 9x15 
+#FontSelect "Cyr_a8x14"   8x14 9x14 8x13 9x13
+#FontSelect "8x12alt.psf" 8x12 9x12 8x11 9x11
+#FontSelect "Cyr_a8x8"    8x8  9x8  8x7  9x7
+#FontSelect "Cyr_a8x32"   8x32 9x32 8x31 9x31
+
+FontProg "./vidcontrol-setfont"
+FontPath "/usr/share/syscons/fonts"
+FontSelect "iso-8x16.fnt"   8x16 9x16 8x15 9x15 
+#FontSelect "Cyr_a8x14"   8x14 9x14 8x13 9x13
+#FontSelect "8x12alt.psf" 8x12 9x12 8x11 9x11
+#FontSelect "Cyr_a8x8"    8x8  9x8  8x7  9x7
+#FontSelect "Cyr_a8x32"   8x32 9x32 8x31 9x31
 
 #
 # using the following FontProg line will avoid losing high-ascii characters
@@ -425,8 +433,8 @@
 # to the monitor! See your monitor's user's manual for details.
 #
 
-#HorizSync 30-32
-#VertRefresh 50-80
+HorizSync 30-82
+VertRefresh 40-110
 
 
 #############################################################################
@@ -450,7 +458,7 @@
 # hardware.
 #
 
-#DacSpeed 45
+DacSpeed 155.50
 
 #############################################################################
 #
@@ -935,3 +943,4 @@
 # newer TextConfig file is just a matter of cutting and pasting this bottom
 # part into your new TextConfig file.
 #
+"ETbig"      80.0     1360 1368 1488 1656     767 767 773 795 font 8x16
diff -N -u -r old/SVGATextMode-1.4-src/XFREE/Makefile SVGATextMode-1.4-src/XFREE/Makefile
--- old/SVGATextMode-1.4-src/XFREE/Makefile	Thu Jun 13 05:11:56 1996
+++ SVGATextMode-1.4-src/XFREE/Makefile	Fri Oct 18 01:57:50 1996
@@ -26,7 +26,7 @@
 
 
 libxf86_hw.a: $(OBJECTS) $(ASMOBJS)
-	ar rcs libxf86_hw.a $(OBJECTS) $(ASMOBJS)
+	ar rc libxf86_hw.a $(OBJECTS) $(ASMOBJS)
 
 $(OBJECTS): %.o: %.c
 	$(CC) -c $(CFLAGS) $(XFREEINC) $(XFREECOMPAT) $< -o $@
diff -N -u -r old/SVGATextMode-1.4-src/XFREE/common/compiler.h SVGATextMode-1.4-src/XFREE/common/compiler.h
--- old/SVGATextMode-1.4-src/XFREE/common/compiler.h	Mon Oct 30 03:31:14 1995
+++ SVGATextMode-1.4-src/XFREE/common/compiler.h	Fri Oct 18 01:57:50 1996
@@ -75,6 +75,9 @@
 #ifdef __GNUC__
 
 #if defined(__i386__)
+#if defined(__FreeBSD__)
+#  define GCCUSESGAS
+#endif
 
 #ifndef FAKEIT
 #ifdef GCCUSESGAS
diff -N -u -r old/SVGATextMode-1.4-src/clockchip.c SVGATextMode-1.4-src/clockchip.c
--- old/SVGATextMode-1.4-src/clockchip.c	Sun Sep 15 21:19:32 1996
+++ SVGATextMode-1.4-src/clockchip.c	Fri Oct 18 01:57:50 1996
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #ifndef DOS
-#  include <asm/io.h>
+#  include "io.h"
 #endif
 #include "misc.h"
 #include "vga_prg.h"
diff -N -u -r old/SVGATextMode-1.4-src/contrib/vgaset/Makefile SVGATextMode-1.4-src/contrib/vgaset/Makefile
--- old/SVGATextMode-1.4-src/contrib/vgaset/Makefile	Thu Jun 13 05:03:22 1996
+++ SVGATextMode-1.4-src/contrib/vgaset/Makefile	Fri Oct 18 01:57:50 1996
@@ -5,11 +5,11 @@
 
 # set COMMON to the pathname of the x386/common/compile.h header file
 CC=gcc
-CFLAGS= -O3 -s $(HAS_USL_VTS)
+CFLAGS= -g -O3  $(HAS_USL_VTS) -DGCCUSESGAS
 
 vgaset: vgaset.c svga.h
 	$(CC) $(CFLAGS) vgaset.c -o vgaset
 
 clean:
 	rm -f vgaset *~ *.bak *.o
-	
\ No newline at end of file
+	
diff -N -u -r old/SVGATextMode-1.4-src/contrib/vgaset/vgaset.c SVGATextMode-1.4-src/contrib/vgaset/vgaset.c
--- old/SVGATextMode-1.4-src/contrib/vgaset/vgaset.c	Wed Jan 25 07:28:43 1995
+++ SVGATextMode-1.4-src/contrib/vgaset/vgaset.c	Fri Oct 18 01:57:50 1996
@@ -31,7 +31,11 @@
 #include "compiler.h"					    /* this should be the x386/common/compiler.h */
 #endif
 #ifdef HAS_USL_VTS
+#ifdef __FreeBSD__
+#include <machine/console.h>
+#else
 #include <sys/kd.h>
+#endif
 
 #define CONSOLE "/dev/console"				    /* name of console */
 int console;						    /* file descriptor for console */
@@ -119,12 +123,14 @@
     perror ("Can't disable IO ports");
     exit (status + 1);
     }
+#ifndef __FreeBSD__
   if (ioctl (console, KDDELIO, 0x3BF) < 0)		    /* delete port number */
     {
     perror ("Can't delete IO ports");
     exit (status + 1);
     }
 #endif
+#endif
   if (tcsetattr (0, TCSAFLUSH, &prior_term_status))
     {
     printf ("Can't set terminal attributes for stdin: %s\n", strerror (errno));
@@ -448,11 +454,13 @@
     perror ("Can't open /dev/console");
     exit (1);
     }
+#ifndef __FreeBSD__
   if (ioctl (console, KDADDIO, 0x3BF) < 0)		    /* add port to list */
     {
     perror ("Can't add I/O port 0x3bf");
     exit (1);
     }
+#endif
   if (ioctl (console, KDENABIO, 0) < 0)
     {
     perror ("Can't enable port I/O");
diff -N -u -r old/SVGATextMode-1.4-src/grabmode.c SVGATextMode-1.4-src/grabmode.c
--- old/SVGATextMode-1.4-src/grabmode.c	Thu Feb 22 06:50:36 1996
+++ SVGATextMode-1.4-src/grabmode.c	Fri Oct 18 02:20:29 1996
@@ -162,7 +162,7 @@
 
  PWARNING(("Please be patient. This may take a while (up to 1 minute)\n"));
 
- getmode(&m, probe_clock, raw_mode, initial_x, initial_y);
+ vgagetmode(&m, probe_clock, raw_mode, initial_x, initial_y);
 
  if (func == CLOCKPROBE)
  {
diff -N -u -r old/SVGATextMode-1.4-src/io.h SVGATextMode-1.4-src/io.h
--- old/SVGATextMode-1.4-src/io.h	Thu Jan  1 10:00:00 1970
+++ SVGATextMode-1.4-src/io.h	Fri Oct 18 02:06:49 1996
@@ -0,0 +1,28 @@
+/* $Id:$ */
+#ifndef IO_H
+#define IO_H
+
+#ifndef DOS
+#ifdef linux
+#  include <asm/io.h>
+#else
+#  include "XFREE/common/compiler.h"
+#  define outb(x,y) outb((y),(x))
+#  define outw(x,y) outw((y),(x))
+#endif
+#else /* DOS */
+# ifdef DJGPP
+#    include <pc.h>
+#    define outb(data,port) outportb(port,data)
+#    define outw(data,port) outportw(port,data)
+#    define inb(port) inportb(port)
+#    define inw(port) inportw(port)
+#  else /* Borland C */
+#    define outb(data,port) outp(port,data)
+#    define outw(data,port) outpw(port,data)
+#    define inb(port) inp(port)
+#    define inw(port) inpw(port)
+#  endif
+#endif
+
+#endif /* IO_H */
diff -N -u -r old/SVGATextMode-1.4-src/modedata.c SVGATextMode-1.4-src/modedata.c
--- old/SVGATextMode-1.4-src/modedata.c	Thu Mar  7 06:53:04 1996
+++ SVGATextMode-1.4-src/modedata.c	Fri Oct 18 01:57:50 1996
@@ -28,7 +28,7 @@
 
 #ifndef DOS
 #include <unistd.h>
-#include <asm/io.h>
+#include "io.h"
 #endif
 
 #include "misc.h"
@@ -373,7 +373,7 @@
 }
 
 
-void getmode(modestruct* m, bool probe_clock, bool raw_mode, int initial_x, int initial_y)
+void vgagetmode(modestruct* m, bool probe_clock, bool raw_mode, int initial_x, int initial_y)
 
 /* get mode parameters. When initial_x and/or initial_y are specified, less guessing is done */
 
diff -N -u -r old/SVGATextMode-1.4-src/modedata.h SVGATextMode-1.4-src/modedata.h
--- old/SVGATextMode-1.4-src/modedata.h	Thu Mar  7 06:56:16 1996
+++ SVGATextMode-1.4-src/modedata.h	Fri Oct 18 01:57:50 1996
@@ -90,7 +90,7 @@
 #define GMOFLG_SET(m,opt)    ((m).mode_flags |= (opt))
 #define GMOFLG_ISSET(m,opt)  ( ((m).mode_flags & (opt)) != 0 )
 
-void getmode(modestruct* m, bool probe_clock, bool raw_mode, int initial_x, int initial_y);
+void vgagetmode(modestruct* m, bool probe_clock, bool raw_mode, int initial_x, int initial_y);
 
 #endif
 
diff -N -u -r old/SVGATextMode-1.4-src/probe.c SVGATextMode-1.4-src/probe.c
--- old/SVGATextMode-1.4-src/probe.c	Sun Sep 15 22:32:44 1996
+++ SVGATextMode-1.4-src/probe.c	Fri Oct 18 02:20:54 1996
@@ -53,9 +53,7 @@
 #endif
 #define URATIO (1000000.0/(float)UCLOCKS_PER_SEC)
 
-#ifndef DOS
-#  include <asm/io.h>
-#endif
+#include "io.h"
 
 #include "misc.h"
 #include "vga_prg.h"
diff -N -u -r old/SVGATextMode-1.4-src/probeclocks.c SVGATextMode-1.4-src/probeclocks.c
--- old/SVGATextMode-1.4-src/probeclocks.c	Thu Mar  7 07:30:10 1996
+++ SVGATextMode-1.4-src/probeclocks.c	Fri Oct 18 01:57:50 1996
@@ -182,7 +182,7 @@
 
     unlock(chipset);
 
-    getmode(&m, TRUE); /* get the current pixel clock so we can restore it */
+    vgagetmode(&m, TRUE); /* get the current pixel clock so we can restore it */
     
     PDEBUG(("pixel clock before tests = %1.2f\n", m.pclock));
     for (n=0; n<ck.num_clocks; n++)
@@ -192,7 +192,7 @@
       else
       {
         do_clock(chipset, &ck, ck.clocks[n], n, optionmask);
-        getmode(&probe_m, TRUE);
+        vgagetmode(&probe_m, TRUE);
         PMESSAGE(("pixel clock %d = %1.2f\n", n, probe_m.pclock));
       }
     }
diff -N -u -r old/SVGATextMode-1.4-src/setclock.c SVGATextMode-1.4-src/setclock.c
--- old/SVGATextMode-1.4-src/setclock.c	Thu Sep 12 04:25:08 1996
+++ SVGATextMode-1.4-src/setclock.c	Fri Oct 18 01:57:50 1996
@@ -24,9 +24,6 @@
 
 #include <stdio.h>
 #include <unistd.h>
-#ifndef DOS
-#  include <asm/io.h>
-#endif
 #include <math.h>
 #include "misc.h"
 #include "vga_prg.h"
@@ -36,6 +33,7 @@
 #include "clockchip.h"
 #include "messages.h"  
 #include "run_extprog.h"  
+#include "io.h"
 
 
 /*****************************************************************************************************************************/
@@ -230,7 +228,9 @@
   /* program clocks in V-blanking only, avoiding video memory corruption and system hangs (?) */
 
   safe_wait_vsync(); /* wait for VSYNC... if there is one */
+/*
   SCREEN_OFF;
+*/
 
   /* mclk programming */
   if (clock_data.mclk != MCLK_NOT_DEFINED)
diff -N -u -r old/SVGATextMode-1.4-src/std_clock.c SVGATextMode-1.4-src/std_clock.c
--- old/SVGATextMode-1.4-src/std_clock.c	Sun Sep  8 21:11:58 1996
+++ SVGATextMode-1.4-src/std_clock.c	Fri Oct 18 01:57:50 1996
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #ifndef DOS
-#  include <asm/io.h>
+#  include "io.h"
 #endif
 #include <math.h>
 #include "misc.h"
diff -N -u -r old/SVGATextMode-1.4-src/tty.h SVGATextMode-1.4-src/tty.h
--- old/SVGATextMode-1.4-src/tty.h	Thu Jan  1 10:00:00 1970
+++ SVGATextMode-1.4-src/tty.h	Fri Oct 18 02:08:55 1996
@@ -0,0 +1,27 @@
+/* $Id:$ */
+#ifndef TTY_H
+#define TTY_H
+
+#ifdef linux
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < 66382
+#  define __KERNEL__
+#  include <linux/tty.h>	/* for MAX_NR_CONSOLES  -- __KERNEL__ is defined to get access to this parameter */
+#  undef __KERNEL__
+#else
+#  include <linux/tty.h>	/* for MAX_NR_CONSOLES */
+#endif
+#else
+#  include <machine/console.h>
+#endif
+
+#ifdef linux
+#include <asm/page.h>	/* for PAGE_SIZE */
+#include <linux/vt.h>   /* for VT_RESIZE */
+#endif
+#include <sys/utsname.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <fcntl.h>
+
+#endif /* TTY_H */
diff -N -u -r old/SVGATextMode-1.4-src/ttyresize.c SVGATextMode-1.4-src/ttyresize.c
--- old/SVGATextMode-1.4-src/ttyresize.c	Sat Jun  1 06:12:37 1996
+++ SVGATextMode-1.4-src/ttyresize.c	Fri Oct 18 02:18:45 1996
@@ -25,28 +25,18 @@
  ***    (c) 1995 Stephen Lee
  ***/
 
-#define USE_MMAP  0   /* 1: use mmap() ; 0: use malloc() */
-
 #ifndef DOS
-
-#include <linux/version.h>      /* the <linux/config.h> file states we should NOT use <linux/version.h>... */
-#if LINUX_VERSION_CODE < 66382
-#  define __KERNEL__
-#  include <linux/tty.h>	/* for MAX_NR_CONSOLES  -- __KERNEL__ is defined to get access to this parameter */
-#  undef __KERNEL__
-#else
-#  include <linux/tty.h>	/* for MAX_NR_CONSOLES */
+#ifdef linux
+#  define USE_MMAP  0   /* 1: use mmap() ; 0: use malloc() */
 #endif
 
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <asm/page.h>	/* for PAGE_SIZE */
-#include <linux/vt.h>   /* for VT_RESIZE */
-#include <sys/ioctl.h>
 #include <sys/wait.h>
-#include <termios.h>
+#include <sys/param.h>
+#include <errno.h>
 
 #include "misc.h"
 #include "messages.h"
@@ -57,7 +47,9 @@
 
 #if USE_MMAP
 #  include <sys/types.h>
-#  include <linux/fs.h>
+#  ifdef linux
+#    include <linux/fs.h>
+#  endif
 #  include <sys/mman.h>
 #endif
 
@@ -103,6 +95,7 @@
  * Make real RAM free, by allocating and then releasing it.
  */
 
+#ifdef linux
 int make_ram_free(size_t bytes)
 {
   /*
@@ -171,6 +164,7 @@
   }
 #endif  
 }
+#endif
 
 
 /*
@@ -195,6 +189,7 @@
   if (!ioctl(fd, cmd, p_struct_size)) return(TRUE);   /* everything went OK */
 
   /* do a few attempts to get enough memory for VT_RESIZE, each time more, hoping we'll get it in the end */
+#ifdef linux
   for (cnt=1; cnt<=4; cnt++)
   {
     PDEBUG(("VT_RESIZE: Could not get memory. Trying to free some (%d), and attempting again...\n", memsize*cnt));
@@ -205,6 +200,7 @@
     /* The Real Thing (TM) ... */
     if (!ioctl(fd, cmd, p_struct_size)) return(TRUE);   /* everything went OK */
   }
+#endif
   return(FALSE);
 }
 
@@ -220,6 +216,7 @@
   /* still no luck... if the error is not "out of memory", we don't know what to do and abort. */
   perror(descr); if (errno!=ENOMEM) PERROR(("VT_RESIZE returned error %d\n", errno));
 
+#ifdef linux
   /* if we are not allowed to resize to a 1x1 screen, we have no more options but to abort */
   if (!allow1x1)
   {
@@ -255,8 +252,10 @@
 
   return(TRUE);
 
+#endif
 }
 
+#ifdef linux
 int do_VT_RESIZE(int cols, int rows, int allow1x1)
 {
   struct vt_sizes my_vt_size, dummy_vt_size;      /* passes the new screen size on to the kernel */
@@ -274,25 +273,28 @@
 
   return(generic_VT_RESIZE(&my_vt_size, &dummy_vt_size, allow1x1, ram_needed, VT_RESIZE, "VT_RESIZE"));
 }
-
+#endif
 /*
  * if VT_RESIZEX not supported (i.e. when compiling on < 1.3.3 kernels), define it.
  * this is just te keep the compiler happy
  */
  
+#ifdef linux
 #ifndef VT_RESIZEX
 #  define VT_RESIZEX  0x560A
    typedef struct vt_consize { 
       ushort v_rows; ushort v_cols; ushort v_vlin; ushort v_clin; ushort v_vcol; ushort v_ccol;
     } vt_consize;
 #endif
-
+#endif
 
 int do_VT_RESIZEX(int cols, int rows, int vlin, int clin, int vcol, int ccol, int allow1x1)
 {
   struct vt_consize my_vt_size;      /* passes the new screen size on to the kernel */
+#ifdef linux
   struct vt_consize dummy_vt_size = { 1 , 1 , 1 , 1 , 1 , 1 };
   int ram_needed = cols * rows * 2 * MAX_NR_CONSOLES;
+#endif
 
   my_vt_size.v_rows = rows;
   my_vt_size.v_cols = cols;
@@ -303,7 +305,11 @@
 
   PDEBUG(("VT_RESIZEX(cols=%d,rows=%d,vlin=%d,clin=%d,vcol=%d,ccol=%d)\n",cols, rows, vlin, clin, vcol, ccol));
   
+#ifdef linux
   return(generic_VT_RESIZE(&my_vt_size, &dummy_vt_size, allow1x1, ram_needed, VT_RESIZEX, "VT_RESIZEX"));
+#else
+  return(generic_VT_RESIZE(&my_vt_size, 0, allow1x1, 0, VT_RESIZE, "VT_RESIZE"));
+#endif
 }
 
 /*
@@ -317,15 +323,18 @@
   
 void resize_specified_vts(int cols, int rows)
 {
+#ifdef linux
   t_terminals *curr_term;
 
   PDEBUG(("Resizing all terminals specified in 'Terminals' line (when needed)\n"));
   
   curr_term = p_terminals;
   while (curr_term) resizetty(curr_term->name, cols, rows);
+#endif
 }
 
 
+#ifdef linux
 /*
  * Resize the VT's reported active from VT_GETSTATE, unfortunately
  * the return param is a short so we can only hope to know about the
@@ -372,6 +381,7 @@
       }
    }
 }
+#endif
 
 #endif /* NO_RESIZE */
 
@@ -389,9 +399,7 @@
   return((my_winsize.ws_col != cols) || (my_winsize.ws_row != rows));
 }
 
-
-#else
-
+#else /* dos */
 /***
  *** DOS resizing code for SVGATextMode.
  *** (c) 1995 Stephen Lee
diff -N -u -r old/SVGATextMode-1.4-src/ttyresize.h SVGATextMode-1.4-src/ttyresize.h
--- old/SVGATextMode-1.4-src/ttyresize.h	Fri May 31 04:39:17 1996
+++ SVGATextMode-1.4-src/ttyresize.h	Fri Oct 18 01:57:51 1996
@@ -24,10 +24,11 @@
 #ifndef _TTYRESIZE_H
 #define _TTYRESIZE_H
 
+#include "io.h"
+#include "tty.h"
+
 #ifndef DOS
 #  include <sys/types.h>
-
-#  include <linux/vt.h> 
 
 #  ifndef NO_RESIZE
 
diff -N -u -r old/SVGATextMode-1.4-src/vga_prg.c SVGATextMode-1.4-src/vga_prg.c
--- old/SVGATextMode-1.4-src/vga_prg.c	Sat Sep 21 21:12:22 1996
+++ SVGATextMode-1.4-src/vga_prg.c	Fri Oct 18 02:06:04 1996
@@ -74,6 +74,7 @@
 void get_IO_range(long start, long len)
 {
   PDEBUG(("Getting VGA IO permissions for addr. range 0x%x-0x%x\n", start, start+len-1));
+#ifdef linux
   if (start>=0x400)
   {
     if (iopl(3) != 0)
@@ -92,6 +93,17 @@
                You must be superuser, or the program must be setuid root!\n", start, start+len-1));
     }
   }
+#else
+  {
+    int fd = opentty("/dev/console");
+    if (ioctl (fd, KDENABIO, 0) < 0)
+    {
+      perror ("Can't enable port I/O");
+      exit (1);
+    }
+    close (fd);
+  }
+#endif
 }
 
 /*
diff -N -u -r old/SVGATextMode-1.4-src/vga_prg.h SVGATextMode-1.4-src/vga_prg.h
--- old/SVGATextMode-1.4-src/vga_prg.h	Tue Jul 16 05:30:59 1996
+++ SVGATextMode-1.4-src/vga_prg.h	Fri Oct 18 01:57:51 1996
@@ -33,22 +33,9 @@
 
 #include "chipset.h"
 
-#ifndef DOS
-# include <asm/io.h>
-#else
-# ifdef DJGPP
-#    include <pc.h>
-#    define outb(data,port) outportb(port,data)
-#    define outw(data,port) outportw(port,data)
-#    define inb(port) inportb(port)
-#    define inw(port) inportw(port)
-#  else /* Borland C */
-#    define outb(data,port) outp(port,data)
-#    define outw(data,port) outpw(port,data)
-#    define inb(port) inp(port)
-#    define inw(port) inpw(port)
-#  endif
-#  define ioperm(x,y,z) (0)
+#include "io.h"
+#ifdef __FreeBSD__
+#  include <machine/console.h>
 #endif
 
 /*
diff -N -u -r old/SVGATextMode-1.4-src/vidcontrol-setfont SVGATextMode-1.4-src/vidcontrol-setfont
--- old/SVGATextMode-1.4-src/vidcontrol-setfont	Thu Jan  1 10:00:00 1970
+++ SVGATextMode-1.4-src/vidcontrol-setfont	Fri Oct 18 02:45:15 1996
@@ -0,0 +1,2 @@
+#!/bin/sh
+vidcontrol -f 8x16 $*
diff -N -u -r old/SVGATextMode-1.4-src/wait_vsync.c SVGATextMode-1.4-src/wait_vsync.c
--- old/SVGATextMode-1.4-src/wait_vsync.c	Thu Mar  7 06:43:28 1996
+++ SVGATextMode-1.4-src/wait_vsync.c	Fri Oct 18 04:46:50 1996
@@ -31,7 +31,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #ifndef DOS
-#  include <asm/io.h>
+#  include "io.h"
 #endif
 
 #include "misc.h"
@@ -63,6 +63,3 @@
   signal(SIGALRM, SIG_DFL);
   return(!vtimeout);
 }
-
-
-                   
\ No newline at end of file



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611071319.AAA01321>