Linux内核参数vga=是怎样影响显示模式(3)

哪没有输出vesafb信息,是在那一步中断的呢?逐步跟踪,终于眼前一亮:
if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
return -ENODEV;
据我所知,screen_info是与“vga=”参数有密切关系的!查看VIDEO_TYPE_VLFB定义
#define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */
正是想要的。

进一步验证,screen_info的元素orig_video_isVGA位于距起点“0x0f”处。继续往回找,
有screen_info = SCREEN_INFO;

#define PARAM (boot_params)
#define SCREEN_INFO (*(struct screen_info *) (PARAM+0))
在/arch/i386/kernel/head.s文件中找到这么一段
/*
* Copy bootup parameters out of the way.
* Note: %esi still has the pointer to the real-mode data.
* With the kexec as boot loader, parameter segment might be loaded beyond
* kernel image and might not even be addressable by early boot page tables.
* (kexec on panic case). Hence copy out the parameters before initializing
* page tables.
*/
movl $(boot_params - __PAGE_OFFSET),%edi
movl $(PARAM_SIZE/4),%ecx
cld
rep
movsl
注释意思说,将启动参数拷贝到boot_params指向的地方。在vedio.s中,有相关代码处理vesa驱动。
mopar_gr:
leaw modelist+1024, %di
movb $0x23, %fs:(PARAM_HAVE_VGA)
。。。。。。
而PARAM_HAVE_VGA定义为
#define PARAM_HAVE_VGA 0x0f

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzwxyx.html