Linux 版 (精华区)

发信人: tcpip (偶的昵称改了), 信区: Linux
标  题: holly大虾的内核分析报告(三)(转寄)
发信站: 哈工大紫丁香 (Sat Jan 22 16:30:31 2000), 转信

发信人: stable (xixi), 信区: FreeBSD       

标  题: holly大虾的内核分析报告(三)

发信站: BBS 水木清华站 (Fri Jan 21 21:44:28 2000)

---------------------------------------------------------------------------

--#define PIO_FONT8x8     _IOW('c', 64, fnt8_t)

#define GIO_FONT8x8     _IOR('c', 65, fnt8_t)

#define PIO_FONT8x14    _IOW('c', 66, fnt14_t)

#define GIO_FONT8x14    _IOR('c', 67, fnt14_t)

#define PIO_FONT8x16    _IOW('c', 68, fnt16_t)

#define GIO_FONT8x16    _IOR('c', 69, fnt16_t)

        Font set operations....Put/Get Font set 8x8, 8x14, and 8x16

        fnt8_t:  char fnt8x8[8*256];   // 8 bytes per char, 256 chars

        fnt14_t: char fnt8x14[14*256];

        fnt16_t: char fnt8x16[16*256];

---------------------------------------------------------------------------

---#define CONS_GETINFO    _IOWR('c', 73, vid_info_t)

        Get current virtual console info

        vid_info_t = struct vid_info

struct colors   {

        char    fore;

        char    back;

};

struct vid_info {

        short   size;     // size should be set as sizeof(vid_info)

        short   m_num;    // The virtual console number startingfrom 0

        u_short mv_row, mv_col;  // x, y position

        u_short mv_rsz, mv_csz;  // x, y size

        struct colors   mv_norm, // Normal color

                        mv_rev,  // reverse color

                        mv_grfc; // not supported yet

        u_char  mv_ovscan;  // Overscan = border color

        u_char  mk_keylock; // See LOCK_MASK. The key lock states

};

---------------------------------------------------------------------------

----#define CONS_GETVERS    _IOR('c', 74, int)

        Get version number

        return 0x0200 under FreeBSD 3.2

---------------------------------------------------------------------------

----#define CONS_CURRENTADP _IOR('c', 100, int)

        Get current adapter index.

        int * -> the current adapte index

---------------------------------------------------------------------------

----#define CONS_ADPINFO    _IOWR('c', 101, video_adapter_info_t)

        Get adapter info

        video_adapter_info_t == struct video_adpater_info

struct video_adapter_info {

    int                 va_index;    // Adapter index

    int                 va_type;     // adapter type - See KD_MONO,... etc

    char                va_name[16]; // driver name?

    int                 va_unit;     // unit number

    int                 va_flags;    // See V_ADP_XXXX below

    int                 va_io_base;  // IO base

    int                 va_io_size;  // the range

    int                 va_crtc_addr; // CRTC addr

    int                 va_mem_base;  // Memory base

    int                 va_mem_size;  // Size

    u_int               va_window;      /* virtual address */

    size_t              va_window_size;

    size_t              va_window_gran;

    u_int               va_buffer;      /* virtual address */

    size_t              va_buffer_size;

    int                 va_initial_mode;  // Init mode

    int                 va_initial_bios_mode;

    int                 va_mode;        // Current Mode

    int                 va_line_width;  // bytes?

};

Possible va_flags :

#define V_ADP_COLOR     (1<<0)

#define V_ADP_MODECHANGE (1<<1)

#define V_ADP_STATESAVE (1<<2)

#define V_ADP_STATELOAD (1<<3)

#define V_ADP_FONT      (1<<4)

#define V_ADP_PALETTE   (1<<5)

#define V_ADP_BORDER    (1<<6)

#define V_ADP_VESA      (1<<7)

#define V_ADP_PROBED    (1<<16)

#define V_ADP_INITIALIZED (1<<17)

#define V_ADP_REGISTERED (1<<18)

For modes, See M_XXXXX definitions below.

---------------------------------------------------------------------------

--#define CONS_MODEINFO   _IOWR('c', 102, video_info_t)

        Get mode info

struct video_info {

    int                 vi_mode; // The mode number??? M_XXXXX ??

    int                 vi_flags; // See below

#define V_INFO_COLOR    (1<<0)

#define V_INFO_GRAPHICS (1<<1)

#define V_INFO_LINEAR   (1<<2)

#define V_INFO_VESA     (1<<3)

    int                 vi_width; // pixel width

    int                 vi_height; // pixel height

    int                 vi_cwidth; // char width - font width

    int                 vi_cheight; // char height - font height

    int                 vi_depth; // color depth

    int                 vi_planes;

    u_int               vi_window;      /* physical address */

    size_t              vi_window_size;

    size_t              vi_window_gran;

    u_int               vi_buffer;      /* physical address */

    size_t              vi_buffer_size;

    /* XXX pixel format, memory model,... */

};

see the command output: "vidcontrol -i mode"

        ioctl() call will return 0 if find and ENODEV if failed

---------------------------------------------------------------------------

--#define CONS_FINDMODE   _IOWR('c', 103, video_info_t)

        Find a mode specified by video_info_t parameter.

        ioctl() call will return 0 if find and ENODEV if failed

---------------------------------------------------------------------------

--#define CONS_SETWINORG  _IO('c', 104 /* u_int */)

        Set Window Org. for winorg, see the definition in video_info

---------------------------------------------------------------------------

--#define CONS_SETKBD     _IO('c', 110 /* int */)

        Set the keyboard to the param.

        int param is keyboard index.

        Set it as the current keyboard

---------------------------------------------------------------------------

----#define CONS_RELKBD     _IO('c', 111)

        Release the current keyboard

---------------------------------------------------------------------------

----/* CONS_SAVERMODE */

#define CONS_LKM_SAVER  0

#define CONS_USR_SAVER  1

#ifdef PC98

#define ADJUST_CLOCK            _IO('t',100)            /* for 98note resum

e */#endif

---------------------------------------------------------------------------

----Virtual Console stuffs

---------------------------------------------------------------------------

----#define VT_OPENQRY      _IOR('v', 1, int)

        Return first free virtual console number ( from 1? )

        Not opened by anyone ! i.e. reserved console for X

---------------------------------------------------------------------------

----#define VT_SETMODE      _IOW('v', 2, vtmode_t)

#define VT_GETMODE      _IOR('v', 3, vtmode_t)

        Get / Set Mode.

struct vt_mode {

        char    mode;   // VT_AUTO, VT_PROCESS, VT_KERNEL ...defined below

        char    waitv;                  /* not implemented yet  SOS     */

        short   relsig; // The release signal

        short   acqsig; // The acquire signal

        short   frsig;                  /* not implemented yet  SOS     */

};

--

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


--
☆ 来源:.哈工大紫丁香 bbs.hit.edu.cn.[FROM: bin@mtlab.hit.edu.cn]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:207.275毫秒