荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: bstone (Live my life!), 信区: Linux
标  题: holly大虾的内核分析报告(六)
发信站: BBS 荔园晨风站 (Sat Jan 22 08:57:33 2000), 站内信件

发信人: stable (xixi), 信区: FreeBSD
标  题: holly大虾的内核分析报告(六)
发信站: BBS 水木清华站 (Fri Jan 21 21:49:08 2000)

#define F(x)            ((x)+F_FN-1)
#define S(x)            ((x)+F_SCR-1)
#define ACC(x)          ((x)+F_ACC)
#define NOKEY           0x100           /* no key pressed marker        */
#define FKEY            0x200           /* function key marker          */
#define MKEY            0x400           /* meta key marker (prepend ESC)*/
#define BKEY            0x800           /* backtab (ESC [ Z)            */
#define SPCLKEY         0x8000          /* special key */
#define RELKEY          0x4000          /* key released */
#define ERRKEY          0x2000          /* error */
#define KEYCHAR(c)      ((c) & 0x00ff)
#define KEYFLAGS(c)     ((c) & ~0x00ff)
-----------------------------------------------------------------------------
/* video mode definitions */
#define M_B40x25        0       /* black & white 40 columns */
#define M_C40x25        1       /* color 40 columns */
#define M_B80x25        2       /* black & white 80 columns */
#define M_C80x25        3       /* color 80 columns */
#define M_BG320         4       /* black & white graphics 320x200 */
#define M_BG320         4       /* black & white graphics 320x200 */
#define M_CG320         5       /* color graphics 320x200 */
#define M_BG640         6       /* black & white graphics 640x200 hi-res */
#define M_EGAMONO80x25  7       /* ega-mono 80x25 */
#define M_CG320_D       13      /* ega mode D */
#define M_CG640_E       14      /* ega mode E */
#define M_EGAMONOAPA    15      /* ega mode F */
#define M_CG640x350     16      /* ega mode 10 */
#define M_ENHMONOAPA2   17      /* ega mode F with extended memory */
#define M_ENH_CG640     18      /* ega mode 10* */
#define M_ENH_B40x25    19      /* ega enhanced black & white 40 columns */
#define M_ENH_C40x25    20      /* ega enhanced color 40 columns */
#define M_ENH_B80x25    21      /* ega enhanced black & white 80 columns */
#define M_ENH_C80x25    22      /* ega enhanced color 80 columns */
#define M_VGA_C40x25    23      /* vga 8x16 font on color */
#define M_VGA_C80x25    24      /* vga 8x16 font on color */
#define M_VGA_M80x25    25      /* vga 8x16 font on mono */
#define M_VGA11         26      /* vga 640x480 2 colors */
#define M_BG640x480     26
#define M_VGA12         27      /* vga 640x480 16 colors */
#define M_CG640x480     27
#define M_VGA13         28      /* vga 640x200 256 colors */
#define M_VGA_CG320     28
#define M_VGA_CG320     28
#define M_VGA_C80x50    30      /* vga 8x8 font on color */
#define M_VGA_M80x50    31      /* vga 8x8 font on color */
#define M_VGA_C80x30    32      /* vga 8x16 font on color */
#define M_VGA_M80x30    33      /* vga 8x16 font on color */
#define M_VGA_C80x60    34      /* vga 8x8 font on color */
#define M_VGA_M80x60    35      /* vga 8x8 font on color */
#define M_VGA_CG640     36      /* vga 640x400 256 color */
#define M_VGA_MODEX     37      /* vga 320x240 256 color */
#define M_ENH_B80x43    0x70    /* ega black & white 80x43 */
#define M_ENH_C80x43    0x71    /* ega color 80x43 */
#define M_PC98_80x25    98      /* PC98 80x25 */
#define M_PC98_80x30    99      /* PC98 80x30 */
#define M_HGC_P0        0xe0    /* hercules graphics - page 0 @ B0000 */
#define M_HGC_P1        0xe1    /* hercules graphics - page 1 @ B8000 */
#define M_MCA_MODE      0xff    /* monochrome adapter mode */
#define M_TEXT_80x25    200     /* generic text modes */
#define M_TEXT_80x30    201
#define M_TEXT_80x43    202
#define M_TEXT_80x50    203
#define M_TEXT_80x60    204
#define M_TEXT_132x25   205
#define M_TEXT_132x30   206
#define M_TEXT_132x30   206
#define M_TEXT_132x43   207
#define M_TEXT_132x50   208
#define M_TEXT_132x60   209
----------------------------------------------------------------------------
Video mode ioctl() codes
----------------------------------------------------------------------------
#define SW_PC98_80x25   _IO('S', M_PC98_80x25)
#define SW_PC98_80x30   _IO('S', M_PC98_80x30)
#define SW_B40x25       _IO('S', M_B40x25)
#define SW_C40x25       _IO('S', M_C40x25)
#define SW_B80x25       _IO('S', M_B80x25)
#define SW_C80x25       _IO('S', M_C80x25)
#define SW_BG320        _IO('S', M_BG320)
#define SW_CG320        _IO('S', M_CG320)
#define SW_BG640        _IO('S', M_BG640)
#define SW_EGAMONO80x25 _IO('S', M_EGAMONO80x25)
#define SW_CG320_D      _IO('S', M_CG320_D)
#define SW_CG640_E      _IO('S', M_CG640_E)
#define SW_EGAMONOAPA   _IO('S', M_EGAMONOAPA)
#define SW_CG640x350    _IO('S', M_CG640x350)
#define SW_ENH_MONOAPA2 _IO('S', M_ENHMONOAPA2)
#define SW_ENH_CG640    _IO('S', M_ENH_CG640)
#define SW_ENH_CG640    _IO('S', M_ENH_CG640)
#define SW_ENH_B40x25   _IO('S', M_ENH_B40x25)
#define SW_ENH_C40x25   _IO('S', M_ENH_C40x25)
#define SW_ENH_B80x25   _IO('S', M_ENH_B80x25)
#define SW_ENH_C80x25   _IO('S', M_ENH_C80x25)
#define SW_ENH_B80x43   _IO('S', M_ENH_B80x43)
#define SW_ENH_C80x43   _IO('S', M_ENH_C80x43)
#define SW_MCAMODE      _IO('S', M_MCA_MODE)
#define SW_VGA_C40x25   _IO('S', M_VGA_C40x25)
#define SW_VGA_C80x25   _IO('S', M_VGA_C80x25)
#define SW_VGA_C80x30   _IO('S', M_VGA_C80x30)
#define SW_VGA_C80x50   _IO('S', M_VGA_C80x50)
#define SW_VGA_C80x60   _IO('S', M_VGA_C80x60)
#define SW_VGA_M80x25   _IO('S', M_VGA_M80x25)
#define SW_VGA_M80x30   _IO('S', M_VGA_M80x30)
#define SW_VGA_M80x50   _IO('S', M_VGA_M80x50)
#define SW_VGA_M80x60   _IO('S', M_VGA_M80x60)
#define SW_VGA11        _IO('S', M_VGA11)
#define SW_BG640x480    _IO('S', M_VGA11)
#define SW_VGA12        _IO('S', M_VGA12)
#define SW_CG640x480    _IO('S', M_VGA12)
#define SW_VGA13        _IO('S', M_VGA13)
#define SW_VGA_CG320    _IO('S', M_VGA13)
#define SW_VGA_CG320    _IO('S', M_VGA13)
#define SW_VGA_CG640    _IO('S', M_VGA_CG640)
#define SW_VGA_MODEX    _IO('S', M_VGA_MODEX)
#define SW_TEXT_80x25   _IO('S', M_TEXT_80x25)
#define SW_TEXT_80x30   _IO('S', M_TEXT_80x30)
#define SW_TEXT_80x43   _IO('S', M_TEXT_80x43)
#define SW_TEXT_80x50   _IO('S', M_TEXT_80x50)
#define SW_TEXT_80x60   _IO('S', M_TEXT_80x60)
#define SW_TEXT_132x25  _IO('S', M_TEXT_132x25)
#define SW_TEXT_132x30  _IO('S', M_TEXT_132x30)
#define SW_TEXT_132x43  _IO('S', M_TEXT_132x43)
#define SW_TEXT_132x50  _IO('S', M_TEXT_132x50)
#define SW_TEXT_132x60  _IO('S', M_TEXT_132x60)
---------------------------------------------------------------------------
VESA Modes
---------------------------------------------------------------------------
#define M_VESA_BASE             0x100   /* VESA mode number base */
#define M_VESA_CG640x400        0x100   /* 640x400, 256 color */
#define M_VESA_CG640x480        0x101   /* 640x480, 256 color */
#define M_VESA_800x600          0x102   /* 800x600, 16 color */
#define M_VESA_CG800x600        0x103   /* 800x600, 256 color */
#define M_VESA_1024x768         0x104   /* 1024x768, 16 color */
#define M_VESA_CG1024x768       0x105   /* 1024x768, 256 color */
#define M_VESA_CG1024x768       0x105   /* 1024x768, 256 color */
#define M_VESA_1280x1024        0x106   /* 1280x1024, 16 color */
#define M_VESA_CG1280x1024      0x107   /* 1280x1024, 256 color */
#define M_VESA_C80x60           0x108   /* 8x8 font */
#define M_VESA_C132x25          0x109   /* 8x16 font */
#define M_VESA_C132x43          0x10a   /* 8x14 font */
#define M_VESA_C132x50          0x10b   /* 8x8 font */
#define M_VESA_C132x60          0x10c   /* 8x8 font */
#define M_VESA_32K_320          0x10d   /* 320x200, 5:5:5 */
#define M_VESA_64K_320          0x10e   /* 320x200, 5:6:5 */
#define M_VESA_FULL_320         0x10f   /* 320x200, 8:8:8 */
#define M_VESA_32K_640          0x110   /* 640x480, 5:5:5 */
#define M_VESA_64K_640          0x111   /* 640x480, 5:6:5 */
#define M_VESA_FULL_640         0x112   /* 640x480, 8:8:8 */
#define M_VESA_32K_800          0x113   /* 800x600, 5:5:5 */
#define M_VESA_64K_800          0x114   /* 800x600, 5:6:5 */
#define M_VESA_FULL_800         0x115   /* 800x600, 8:8:8 */
#define M_VESA_32K_1024         0x116   /* 1024x768, 5:5:5 */
#define M_VESA_64K_1024         0x117   /* 1024x768, 5:6:5 */
#define M_VESA_FULL_1024        0x118   /* 1024x768, 8:8:8 */
#define M_VESA_32K_1280         0x119   /* 1280x1024, 5:5:5 */
#define M_VESA_64K_1280         0x11a   /* 1280x1024, 5:6:5 */
#define M_VESA_FULL_1280        0x11b   /* 1280x1024, 8:8:8 */
#define M_VESA_CG1024x768       0x105   /* 1024x768, 256 color */
#define M_VESA_1280x1024        0x106   /* 1280x1024, 16 color */
#define M_VESA_CG1280x1024      0x107   /* 1280x1024, 256 color */
#define M_VESA_C80x60           0x108   /* 8x8 font */
#define M_VESA_C132x25          0x109   /* 8x16 font */
#define M_VESA_C132x43          0x10a   /* 8x14 font */
#define M_VESA_C132x50          0x10b   /* 8x8 font */
#define M_VESA_C132x60          0x10c   /* 8x8 font */
#define M_VESA_32K_320          0x10d   /* 320x200, 5:5:5 */
#define M_VESA_64K_320          0x10e   /* 320x200, 5:6:5 */
#define M_VESA_FULL_320         0x10f   /* 320x200, 8:8:8 */
#define M_VESA_32K_640          0x110   /* 640x480, 5:5:5 */
#define M_VESA_64K_640          0x111   /* 640x480, 5:6:5 */
#define M_VESA_FULL_640         0x112   /* 640x480, 8:8:8 */
#define M_VESA_32K_800          0x113   /* 800x600, 5:5:5 */
#define M_VESA_64K_800          0x114   /* 800x600, 5:6:5 */
#define M_VESA_FULL_800         0x115   /* 800x600, 8:8:8 */
#define M_VESA_32K_1024         0x116   /* 1024x768, 5:5:5 */
#define M_VESA_64K_1024         0x117   /* 1024x768, 5:6:5 */
#define M_VESA_FULL_1024        0x118   /* 1024x768, 8:8:8 */
#define M_VESA_32K_1280         0x119   /* 1280x1024, 5:5:5 */
#define M_VESA_64K_1280         0x11a   /* 1280x1024, 5:6:5 */
#define M_VESA_FULL_1280        0x11b   /* 1280x1024, 8:8:8 */
#define SW_VESA_C132x50         _IO('V', M_VESA_C132x50 - M_VESA_BASE)
#define SW_VESA_C132x60         _IO('V', M_VESA_C132x60 - M_VESA_BASE)
#define SW_VESA_32K_320         _IO('V', M_VESA_32K_320 - M_VESA_BASE)
#define SW_VESA_64K_320         _IO('V', M_VESA_64K_320 - M_VESA_BASE)
#define SW_VESA_FULL_320        _IO('V', M_VESA_FULL_320 - M_VESA_BASE)
#define SW_VESA_32K_640         _IO('V', M_VESA_32K_640 - M_VESA_BASE)
#define SW_VESA_64K_640         _IO('V', M_VESA_64K_640 - M_VESA_BASE)
#define SW_VESA_FULL_640        _IO('V', M_VESA_FULL_640 - M_VESA_BASE)
#define SW_VESA_32K_800         _IO('V', M_VESA_32K_800 - M_VESA_BASE)
#define SW_VESA_64K_800         _IO('V', M_VESA_64K_800 - M_VESA_BASE)
#define SW_VESA_FULL_800        _IO('V', M_VESA_FULL_800 - M_VESA_BASE)
#define SW_VESA_32K_1024        _IO('V', M_VESA_32K_1024 - M_VESA_BASE)
#define SW_VESA_64K_1024        _IO('V', M_VESA_64K_1024 - M_VESA_BASE)
#define SW_VESA_FULL_1024       _IO('V', M_VESA_FULL_1024 - M_VESA_BASE)
#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)
   Use these codes to change the video mode
------------------------------------------------------------------------------
 Analyzed by Holly Lee 2000 lee@mail.lib.sjtu.edu.cn

--
※ 来源:·BBS 水木清华站 smth.org·[FROM: ox2.ios.ac.cn]

--
☆ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: bbs@192.168.28.28]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店