⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 2 页
字号:
/*Copyright (c) 1986, 1987 by Hewlett-Packard CompanyCopyright (c) 1986, 1987 by the Massachusetts Institute of TechnologyPermission to use, copy, modify, and distribute thissoftware and its documentation for any purpose and withoutfee is hereby granted, provided that the above copyrightnotice appear in all copies and that both that copyrightnotice and this permission notice appear in supportingdocumentation, and that the name of M.I.T. not be used inadvertising or publicity pertaining to distribution of thesoftware without specific, written prior permission.HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARDTO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Hewlett-Packard shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material.This software is not subject to any license of the AmericanTelephone and Telegraph Company or of the Regents of theUniversity of California.*//********************************************************************************* File:         init.c* RCS:          $Revision: 1.2 $* Description:  Multiple screen initialization* Author:       John Howard Palevich* Created:      April 22, 1987* Modified:     April 29, 1987  17:41:59 (John Howard Palevich)* Language:     C* Package:      USER* Status:       Experimental (Do Not Distribute)** (c) Copyright 1987, Hewlett-Packard, Inc., all rights reserved.********************************************************************************/#include "X.h"#include "Xproto.h"#include <servermd.h>#include "screenint.h"#include "input.h"#include "cursor.h"#include "misc.h"#include "scrnintstr.h"#include "gcstruct.h"#include <stdio.h>#include <ctype.h>#include <signal.h>#include <setjmp.h>#include <sys/types.h>#include <sys/stat.h>#ifdef hpux# include <sys/sysmacros.h>#endif#ifndef hpux# include <sys/ioctl.h># include <grfioctl.h>#else# include <sys/graphics.h>#endif#include "hpDisplays.h"#include <fcntl.h>extern char	*display;		/* display number as a string */static char	xscreens[80];static int	ConfigFile=FALSE;#ifdef hpuxstatic char	DefaultScreen[]="/dev/crt";#elsestatic char	DefaultScreen[]="/dev/grf0";#endif/* * NewRule is an array of replacement rules.  Given a replacement rule, * *   colunm	foreground pixel	background pixel *	0		0			0 *	1		0			1 *	2		1			0 *	3		1			1 *	4		1		      clear *	5		0		      clear */u_char XHP_NewRule [16][6] = {GXclear, GXclear,	GXclear,       GXclear, GXandInverted,GXandInverted,GXclear, GXandInverted, GXand,	       GXnoop,  GXnoop,	      GXandInverted,GXclear, GXnor,	        GXandReverse,  GXinvert,GXxor,	      GXandInverted,GXclear, GXcopyInverted,GXcopy,	       GXset,   GXor,	      GXandInverted,GXnoop,  GXand,		GXandInverted, GXclear, GXandInverted,GXnoop,GXnoop,  GXnoop,	GXnoop,	       GXnoop,  GXnoop,	      GXnoop,GXnoop,  GXequiv,	GXxor,	       GXinvert,GXxor,	      GXnoop,GXnoop,  GXorInverted,	GXor,	       GXset,   GXor,	      GXnoop,GXinvert,GXandReverse,  GXnor,	       GXclear, GXandInverted,GXxor,GXinvert,GXxor,		GXequiv,       GXnoop,  GXnoop,	      GXxor,GXinvert,GXinvert,	GXinvert,      GXinvert,GXxor,	      GXxor,GXinvert,GXnand,	GXorReverse,   GXset,   GXor,	      GXxor,GXset, 	 GXcopy,	GXcopyInverted,GXclear, GXandInverted,GXor,GXset, 	 GXor,		GXorInverted,  GXnoop,  GXnoop,	      GXor,GXset, 	 GXorReverse,	GXnand,	       GXinvert,GXxor,	      GXor,GXset, 	 GXset,		GXset,	       GXset,	GXor,	      GXor};#define IOMAP_BASE 0xb00000static unsigned char *iomapBase;int TopcatBrainDamage = 0;int catseyeMono = 0;static PixmapFormatRec formats[] = {    1, 1, BITMAP_SCANLINE_PAD,	/* 1-bit deep for all */#if 0    4, 4, BITMAP_SCANLINE_PAD,  /* 4-bit deep for Burgundy */#endif    8, 8, BITMAP_SCANLINE_PAD,	/* 8-bit deep for most color displays */#if 0   16,16, BITMAP_SCANLINE_PAD,	/*16-bit deep for most color displays */#endif};#define NUMFORMATS	(sizeof formats)/(sizeof formats[0])/* Pmap represents all 256 combinations of 8 bits of information. *//* For example, if my byte of 8 pixels of information is 01010101 *//* then the bytes that get written in memory are 00ff00ff,00ff00ff*//* The bytes are written using the current write enable and       *//* drawmode value.                                                */   int XHP_pmap[256][2]={0x00000000,0x00000000,                         0x00000000,0x000000ff,                         0x00000000,0x0000ff00,                         0x00000000,0x0000ffff,                         0x00000000,0x00ff0000,                         0x00000000,0x00ff00ff,                         0x00000000,0x00ffff00,                         0x00000000,0x00ffffff,                         0x00000000,0xff000000,                         0x00000000,0xff0000ff,                         0x00000000,0xff00ff00,                         0x00000000,0xff00ffff,                         0x00000000,0xffff0000,                         0x00000000,0xffff00ff,                         0x00000000,0xffffff00,                         0x00000000,0xffffffff,                         0x000000ff,0x00000000,                         0x000000ff,0x000000ff,                         0x000000ff,0x0000ff00,                         0x000000ff,0x0000ffff,                         0x000000ff,0x00ff0000,                         0x000000ff,0x00ff00ff,                         0x000000ff,0x00ffff00,                         0x000000ff,0x00ffffff,                         0x000000ff,0xff000000,                         0x000000ff,0xff0000ff,                         0x000000ff,0xff00ff00,                         0x000000ff,0xff00ffff,                         0x000000ff,0xffff0000,                         0x000000ff,0xffff00ff,                         0x000000ff,0xffffff00,                         0x000000ff,0xffffffff,                         0x0000ff00,0x00000000,                         0x0000ff00,0x000000ff,                         0x0000ff00,0x0000ff00,                         0x0000ff00,0x0000ffff,                         0x0000ff00,0x00ff0000,                         0x0000ff00,0x00ff00ff,                         0x0000ff00,0x00ffff00,                         0x0000ff00,0x00ffffff,                         0x0000ff00,0xff000000,                         0x0000ff00,0xff0000ff,                         0x0000ff00,0xff00ff00,                         0x0000ff00,0xff00ffff,                         0x0000ff00,0xffff0000,                         0x0000ff00,0xffff00ff,                         0x0000ff00,0xffffff00,                         0x0000ff00,0xffffffff,                         0x0000ffff,0x00000000,                         0x0000ffff,0x000000ff,                         0x0000ffff,0x0000ff00,                         0x0000ffff,0x0000ffff,                         0x0000ffff,0x00ff0000,                         0x0000ffff,0x00ff00ff,                         0x0000ffff,0x00ffff00,                         0x0000ffff,0x00ffffff,                         0x0000ffff,0xff000000,                         0x0000ffff,0xff0000ff,                         0x0000ffff,0xff00ff00,                         0x0000ffff,0xff00ffff,                         0x0000ffff,0xffff0000,                         0x0000ffff,0xffff00ff,                         0x0000ffff,0xffffff00,                         0x0000ffff,0xffffffff,                         0x00ff0000,0x00000000,                         0x00ff0000,0x000000ff,                         0x00ff0000,0x0000ff00,                         0x00ff0000,0x0000ffff,                         0x00ff0000,0x00ff0000,                         0x00ff0000,0x00ff00ff,                         0x00ff0000,0x00ffff00,                         0x00ff0000,0x00ffffff,                         0x00ff0000,0xff000000,                         0x00ff0000,0xff0000ff,                         0x00ff0000,0xff00ff00,                         0x00ff0000,0xff00ffff,                         0x00ff0000,0xffff0000,                         0x00ff0000,0xffff00ff,                         0x00ff0000,0xffffff00,                         0x00ff0000,0xffffffff,                         0x00ff00ff,0x00000000,                         0x00ff00ff,0x000000ff,                         0x00ff00ff,0x0000ff00,                         0x00ff00ff,0x0000ffff,                         0x00ff00ff,0x00ff0000,                         0x00ff00ff,0x00ff00ff,                         0x00ff00ff,0x00ffff00,                         0x00ff00ff,0x00ffffff,                         0x00ff00ff,0xff000000,                         0x00ff00ff,0xff0000ff,                         0x00ff00ff,0xff00ff00,                         0x00ff00ff,0xff00ffff,                         0x00ff00ff,0xffff0000,                         0x00ff00ff,0xffff00ff,                         0x00ff00ff,0xffffff00,                         0x00ff00ff,0xffffffff,                         0x00ffff00,0x00000000,                         0x00ffff00,0x000000ff,                         0x00ffff00,0x0000ff00,                         0x00ffff00,0x0000ffff,                         0x00ffff00,0x00ff0000,                         0x00ffff00,0x00ff00ff,                         0x00ffff00,0x00ffff00,                         0x00ffff00,0x00ffffff,                         0x00ffff00,0xff000000,                         0x00ffff00,0xff0000ff,                         0x00ffff00,0xff00ff00,                         0x00ffff00,0xff00ffff,                         0x00ffff00,0xffff0000,                         0x00ffff00,0xffff00ff,                         0x00ffff00,0xffffff00,                         0x00ffff00,0xffffffff,                         0x00ffffff,0x00000000,                         0x00ffffff,0x000000ff,                         0x00ffffff,0x0000ff00,                         0x00ffffff,0x0000ffff,                         0x00ffffff,0x00ff0000,                         0x00ffffff,0x00ff00ff,                         0x00ffffff,0x00ffff00,                         0x00ffffff,0x00ffffff,                         0x00ffffff,0xff000000,                         0x00ffffff,0xff0000ff,                         0x00ffffff,0xff00ff00,                         0x00ffffff,0xff00ffff,                         0x00ffffff,0xffff0000,                         0x00ffffff,0xffff00ff,                         0x00ffffff,0xffffff00,                         0x00ffffff,0xffffffff,                         0xff000000,0x00000000,                         0xff000000,0x000000ff,                         0xff000000,0x0000ff00,                         0xff000000,0x0000ffff,                         0xff000000,0x00ff0000,                         0xff000000,0x00ff00ff,                         0xff000000,0x00ffff00,                         0xff000000,0x00ffffff,                         0xff000000,0xff000000,                         0xff000000,0xff0000ff,                         0xff000000,0xff00ff00,                         0xff000000,0xff00ffff,                         0xff000000,0xffff0000,                         0xff000000,0xffff00ff,                         0xff000000,0xffffff00,                         0xff000000,0xffffffff,                         0xff0000ff,0x00000000,                         0xff0000ff,0x000000ff,                         0xff0000ff,0x0000ff00,                         0xff0000ff,0x0000ffff,                         0xff0000ff,0x00ff0000,                         0xff0000ff,0x00ff00ff,                         0xff0000ff,0x00ffff00,                         0xff0000ff,0x00ffffff,                         0xff0000ff,0xff000000,                         0xff0000ff,0xff0000ff,                         0xff0000ff,0xff00ff00,                         0xff0000ff,0xff00ffff,                         0xff0000ff,0xffff0000,                         0xff0000ff,0xffff00ff,                         0xff0000ff,0xffffff00,                         0xff0000ff,0xffffffff,                         0xff00ff00,0x00000000,                         0xff00ff00,0x000000ff,                         0xff00ff00,0x0000ff00,                         0xff00ff00,0x0000ffff,                         0xff00ff00,0x00ff0000,                         0xff00ff00,0x00ff00ff,                         0xff00ff00,0x00ffff00,                         0xff00ff00,0x00ffffff,                         0xff00ff00,0xff000000,                         0xff00ff00,0xff0000ff,                         0xff00ff00,0xff00ff00,                         0xff00ff00,0xff00ffff,                         0xff00ff00,0xffff0000,                         0xff00ff00,0xffff00ff,                         0xff00ff00,0xffffff00,                         0xff00ff00,0xffffffff,                         0xff00ffff,0x00000000,                         0xff00ffff,0x000000ff,                         0xff00ffff,0x0000ff00,                         0xff00ffff,0x0000ffff,                         0xff00ffff,0x00ff0000,                         0xff00ffff,0x00ff00ff,                         0xff00ffff,0x00ffff00,                         0xff00ffff,0x00ffffff,                         0xff00ffff,0xff000000,                         0xff00ffff,0xff0000ff,                         0xff00ffff,0xff00ff00,                         0xff00ffff,0xff00ffff,                         0xff00ffff,0xffff0000,                         0xff00ffff,0xffff00ff,                         0xff00ffff,0xffffff00,                         0xff00ffff,0xffffffff,                         0xffff0000,0x00000000,                         0xffff0000,0x000000ff,                         0xffff0000,0x0000ff00,                         0xffff0000,0x0000ffff,                         0xffff0000,0x00ff0000,                         0xffff0000,0x00ff00ff,                         0xffff0000,0x00ffff00,                         0xffff0000,0x00ffffff,                         0xffff0000,0xff000000,                         0xffff0000,0xff0000ff,                         0xffff0000,0xff00ff00,                         0xffff0000,0xff00ffff,                         0xffff0000,0xffff0000,                         0xffff0000,0xffff00ff,                         0xffff0000,0xffffff00,                         0xffff0000,0xffffffff,                         0xffff00ff,0x00000000,                         0xffff00ff,0x000000ff,                         0xffff00ff,0x0000ff00,                         0xffff00ff,0x0000ffff,                         0xffff00ff,0x00ff0000,                         0xffff00ff,0x00ff00ff,                         0xffff00ff,0x00ffff00,                         0xffff00ff,0x00ffffff,                         0xffff00ff,0xff000000,                         0xffff00ff,0xff0000ff,                         0xffff00ff,0xff00ff00,                         0xffff00ff,0xff00ffff,                         0xffff00ff,0xffff0000,                         0xffff00ff,0xffff00ff,                         0xffff00ff,0xffffff00,                         0xffff00ff,0xffffffff,                         0xffffff00,0x00000000,                         0xffffff00,0x000000ff,                         0xffffff00,0x0000ff00,                         0xffffff00,0x0000ffff,                         0xffffff00,0x00ff0000,                         0xffffff00,0x00ff00ff,                         0xffffff00,0x00ffff00,                         0xffffff00,0x00ffffff,                         0xffffff00,0xff000000,                         0xffffff00,0xff0000ff,                         0xffffff00,0xff00ff00,                         0xffffff00,0xff00ffff,                         0xffffff00,0xffff0000,                         0xffffff00,0xffff00ff,                         0xffffff00,0xffffff00,                         0xffffff00,0xffffffff,                         0xffffffff,0x00000000,                         0xffffffff,0x000000ff,                         0xffffffff,0x0000ff00,                         0xffffffff,0x0000ffff,                         0xffffffff,0x00ff0000,                         0xffffffff,0x00ff00ff,                         0xffffffff,0x00ffff00,                         0xffffffff,0x00ffffff,                         0xffffffff,0xff000000,                         0xffffffff,0xff0000ff,                         0xffffffff,0xff00ff00,                         0xffffffff,0xff00ffff,                         0xffffffff,0xffff0000,                         0xffffffff,0xffff00ff,                         0xffffffff,0xffffff00,                         0xffffffff,0xffffffff}; /*XHP_pmap end*/int XHP_QUADALIGN;static jmp_buf env;/* * routine to handle the bus error we might get in testing for the alignment * restrictions of this cpu. */static int sigbusHandler(){    XHP_QUADALIGN = 1;    longjmp(env, 1);}static int ReadLine();typedef struct {    char *productNumber;    char *productNickname;    Bool (*InfoScreen)();    Bool (*InitScreen)();} ScreenTableRec;static ScreenTableRec *FindScreen();#define MAXARG 10#define MAXSTRING 120/*- *----------------------------------------------------------------------- * InitOutput -- *	Initialize screenInfo for all actually accessible framebuffers. *	The * * Results: *	screenInfo init proc field set * * Side Effects: *	None * *-----------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -