当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 桌面应用:宽屏笔记本,915GM芯片组,Linux的设置

Unix/Linux
linux查看内存的大小
在linux下写的代码,用的是utf-8,结果拿到XP下运行的时候,所有的中文都成乱码
linux su和sudo命令的区别
linux cron 下的定时执行工具使用技巧
linux 查找进程及终止进程操作的相关命令
redhat linux 安装 gcc编译器
Linux Mplayer播放各种格式的电影
一起回顾一下linux常用命令
Linux 网站项目发布要做哪些配置
linux SSH配合SecureCRT的密匙完美使用方法
GD 编译出错解决方法
Facebook Open Platform编译FAQ
Linux 系统硬盘 优化
linux 挂载详解
linux crontab定时命令
Linux 系统中确保访问三级域名畅通的方法
Linux 特权帐号VS普通帐号
确保Linux系统安全的前提条件 漏洞防护
Linux 监视系统资源使用率
Red Hat Linux上使用BIND建立DNS服务器

Unix/Linux 中的 桌面应用:宽屏笔记本,915GM芯片组,Linux的设置


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 58 ::
收藏到网摘: n/a


为宽屏的分辩率率一和普通屏的不一样,如:1280*768,一些厂家的linux还不支持这些非传统标准的分辨率! 这几天天天在老外的论坛里转,终于第一时间看到for 915GM的video BIOS修改程序,可以直接修改内存里有mode line叁数,让系统支持宽屏显示! 另也找到了,最新的915GM的驱动,经过第三方修改的(奇怪的是Intel提供的不能正常工作,第三方的倒是可以,有了它才能真正发挥915GM的显示能力啊,那个vesa的驱动,太慢了,呵呵) 因这里不好上传附件,只能把原码贴上来了,是那个支持宽屏的修正程序,自己编译一下,如下: #gcc 915resolution.c -o 915resolution 然后运行 915resolution 5c 1280*768 然后写一脚本,让系统每次启动自动运行!呵呵! 915GM的驱动,大了点,不好贴上来,需要的朋友加我QQ,传给你! #include #include #include #define __USE_GNU #include #include #include #include #include #include #define NEW(a) ((a *)(calloc(1, sizeof(a)))) #define FREE(a) (free(a)) #define VBIOS_START 0xc0000 #define VBIOS_SIZE 0x10000 #define VBIOS_FILE "/dev/mem" #define VBIOS_OFFSET_IN_FILE VBIOS_START #define CFG_SIGNATURE "BIOS_DATA_BLOCK " #define FALSE 0 #define TRUE 1 typedef unsigned char * address; typedef unsigned char boolean;
typedef struct { unsigned char mode; unsigned char bits_per_pixel; unsigned short resolution; unsigned char unknown; } __attribute__((packed)) vbios_mode; typedef struct { unsigned char unknow1[2]; unsigned char x1; unsigned char unknow2; unsigned char x2; unsigned char y1; unsigned char unknow3; unsigned char y2; } __attribute__((packed)) vbios_resolution; typedef struct { int bios_fd; address bios_ptr; address cnfg_ptr; vbios_mode * mode_table; int mode_table_size; boolean unlocked; } vbios_map; void initialize_system(); char * get_chipset(void); vbios_map * open_vbios(); void close_vbios(vbios_map * map); void unlock_vbios(vbios_map * map); void relock_vbios(vbios_map * map); void initialize_system(void) { if (iopl(3) < 0) { perror( Unable to obtain the proper IO permissions"); exit(2); } } static unsigned int get_chipset_id(void) { outl(0x80000000, 0xcf8); return inl(0xcfc); } static char chipset_buffer[256]; char * get_chipset(void) { unsigned int id; char * name; id = get_chipset_id(); switch (id) { case 0x25608086: name = "845G"; break; case 0x35808086: name = "855GM"; break; case 0x25708086: name = "865G"; break; case 0x25908086: name = "915GM"; break; default: sprintf(chipset_buffer, "Unknown (0x%08x)", id); name = chipset_buffer; break; } return name; } vbios_map * open_vbios() { vbios_map * map = NEW(vbios_map); /* * Map the video bios to memory */ map->bios_fd = open(VBIOS_FILE, O_RDWR); if(map->bios_fd < 0) { perror( Unable to open the BIOS file"); exit(2); } map->bios_ptr = mmap((void *)VBIOS_START, VBIOS_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, map->bios_fd, VBIOS_OFFSET_IN_FILE); if (map->bios_ptr == NULL) { fprintf(stderr, "Cannot mmap() the video BIOS\n"); close(map->bios_fd); exit(2); } /* * figure out where the configuration information is */ map->cnfg_ptr = memmem(map->bios_ptr, VBIOS_SIZE, CFG_SIGNATURE, strlen(CFG_SIGNATURE)); if (map->cnfg_ptr == NULL) { fprintf(stderr, "Couldn't find the configuration area in the VBIOS!\n"); close_vbios(map); exit(2); } /* * Figure out where the mode table is and which type of bios we have */ { address p = map->bios_ptr; address limit = map->bios_ptr + VBIOS_SIZE - (3 * sizeof(vbios_mode)); while (p < limit && map->mode_table == 0) { vbios_mode * mode_ptr = (vbios_mode *) p; if (((mode_ptr[0].mode & 0xf0) == 0x30) && ((mode_ptr[1].mode & 0xf0) == 0x30) && ((mode_ptr[2].mode & 0xf0) == 0x30) && ((mode_ptr[3].mode & 0xf0) == 0x30)) { map->mode_table = mode_ptr; } p++; } if (map->mode_table == 0) { fprintf(stderr, "Unable to locate mode table!\n"); close_vbios(map); exit(2); } } /* * Determine size of mode table */ { vbios_mode * mode_ptr = map->mode_table; while (mode_ptr->mode != 0xff) { map->mode_table_size++; mode_ptr++; } } return map; } void close_vbios(vbios_map * map) { assert(!map->unlocked); if(map->bios_ptr == NULL) { fprintf(stderr, "