Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/sommerfeld_i386mp_1]: src/sys/arch/i386/bios get some more info out of t...



details:   https://anonhg.NetBSD.org/src/rev/d3df60c13d43
branches:  sommerfeld_i386mp_1
changeset: 482564:d3df60c13d43
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed Jul 10 19:15:44 2002 +0000

description:
get some more info out of the VESA BIOS and attach subdevices for
8-bit pseudo color and text modes
still doesn't do anything useful
(It would be easy to attach a wsdisplay, but we have to cooperate with the
PCI or ISA attached VGA drivers. There are open issues.)

diffstat:

 sys/arch/i386/bios/vesa_text.c   |  57 ++++++++++++++++++++++++++++++++++++++++
 sys/arch/i386/bios/vesabios.h    |  13 +++++++++
 sys/arch/i386/bios/vesabiosreg.h |  27 ++++++++++++++++++
 3 files changed, 97 insertions(+), 0 deletions(-)

diffs (109 lines):

diff -r 5019459efe64 -r d3df60c13d43 sys/arch/i386/bios/vesa_text.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/bios/vesa_text.c    Wed Jul 10 19:15:44 2002 +0000
@@ -0,0 +1,57 @@
+/* $NetBSD: vesa_text.c,v 1.1.4.2 2002/07/10 19:15:44 drochner Exp $ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <machine/frame.h>
+#include <machine/kvm86.h>
+#include <machine/bus.h>
+
+#include <arch/i386/bios/vesabios.h>
+#include <arch/i386/bios/vesabiosreg.h>
+
+static int vesatext_match(struct device *, struct cfdata *, void *);
+static void vesatext_attach(struct device *, struct device *, void *);
+
+struct vesatextsc {
+       struct device sc_dev;
+       int *sc_modes;
+       int sc_nmodes;
+};
+
+struct cfattach vesatext_ca = {
+       sizeof(struct vesatextsc), vesatext_match, vesatext_attach
+};
+
+static int
+vesatext_match(parent, match, aux)
+       struct device *parent;
+       struct cfdata *match;
+       void *aux;
+{
+       struct vesabiosdev_attach_args *vaa = aux;
+
+       if (strcmp(vaa->vbaa_type, "text"))
+               return (0);
+
+       return (1);
+}
+
+static void
+vesatext_attach(parent, dev, aux)
+       struct device *parent, *dev;
+       void *aux;
+{
+       struct vesatextsc *sc = (struct vesatextsc *)dev;
+       struct vesabiosdev_attach_args *vaa = aux;
+       int i;
+
+       sc->sc_modes = malloc(vaa->vbaa_nmodes * sizeof(int),
+                             M_DEVBUF, M_NOWAIT);
+       sc->sc_nmodes = vaa->vbaa_nmodes;
+       for (i = 0; i < vaa->vbaa_nmodes; i++)
+               sc->sc_modes[i] = vaa->vbaa_modes[i];
+
+       printf("\n");
+}
diff -r 5019459efe64 -r d3df60c13d43 sys/arch/i386/bios/vesabios.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/bios/vesabios.h     Wed Jul 10 19:15:44 2002 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: vesabios.h,v 1.2.4.2 2002/07/10 19:15:44 drochner Exp $ */
+
+int vbeprobe __P((void));
+
+struct vesabios_attach_args {
+       char *vaa_busname;
+};
+
+struct vesabiosdev_attach_args {
+       char *vbaa_type;
+       int *vbaa_modes;
+       int vbaa_nmodes;
+};
diff -r 5019459efe64 -r d3df60c13d43 sys/arch/i386/bios/vesabiosreg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/bios/vesabiosreg.h  Wed Jul 10 19:15:44 2002 +0000
@@ -0,0 +1,27 @@
+/* $NetBSD: vesabiosreg.h,v 1.1.4.2 2002/07/10 19:15:44 drochner Exp $ */
+
+struct modeinfoblock {
+       /* Mandatory information for all VBE revisions */
+       u_int16_t ModeAttributes;
+       u_int8_t WinAAttributes, WinBAttributes;
+       u_int16_t WinGranularity, WinSize, WinASegment, WinBSegment;
+       u_int32_t WinFuncPtr;
+       u_int16_t BytesPerScanLine;
+       /* Mandatory information for VBE 1.2 and above */
+       u_int16_t XResolution, YResolution;
+       u_int8_t XCharSize, YCharSize, NumberOfPlanes, BitsPerPixel;
+       u_int8_t NumberOfBanks, MemoryModel, BankSize, NumberOfImagePages;
+       u_int8_t Reserved1;
+       /* Direct Color fields
+          (required for direct/6 and YUV/7 memory models) */
+       u_int8_t RedMaskSize, RedFieldPosition;
+       u_int8_t GreenMaskSize, GreenFieldPosition;
+       u_int8_t BlueMaskSize, BlueFieldPosition;
+       u_int8_t RsvdMaskSize, RsvdFieldPosition;
+       u_int8_t DirectColorModeInfo;
+       /* Mandatory information for VBE 2.0 and above */
+       u_int32_t PhysBasePtr;
+       u_int32_t OffScreenMemOffset;
+       u_int16_t OffScreenMemSize;
+       u_int8_t Reserved2[206];
+} __attribute__ ((packed));



Home | Main Index | Thread Index | Old Index