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

Unix/Linux
查看linux 下已经安装的软件包信息
linux 系统中软件raid 配置方法
linux 下MySQL服务器的启动与停止
linux 系统下FTP服务器配置方法
Linux系统下如何挂载U盘,硬盘,光驱
linux 系统下DHCP服务器 配置方法
Linux系统下软件的安装与卸载
在Fedora 9中启用ext4文件系统的方法
linux下挂载(mount)光盘镜像文件、移动硬盘、U盘、Windows网络共享和NFS网络共享
Linux查看文件夹大小的命令
LINUX系统grub常见错误分析
llinux fdisk分区工具 使用方法
linux 系统telnet乱码
rhythmbox 乱码的解决方法
linux单网卡绑定多ip
tar.gz 和tar.bz2 详细解释
linux学习笔记
linux系统rpm安装包详解
linux 服务器常用维护命令
出现The file /boot/grub/stage1 not read cor 解决办法

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 157 ::
收藏到网摘: 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, "