LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1495|回复: 1

启动过程的vga=788

[复制链接]
发表于 2007-3-27 10:29:56 | 显示全部楼层 |阅读模式
各位,我想知道控制台下传给内核的参数vga=788,是怎么传给内核的,一个大致路线就行,我在fb下面没找到相关的参数。
谢谢!
发表于 2007-4-15 20:22:47 | 显示全部楼层
/Documentation/kernel-parameters.txt
......
vga=                [BOOT,IA-32] Select a particular video mode
                See Documentation/i386/boot.txt and
                Documentation/svga.txt.
                Use vga=ask for menu.
                This is actually a boot loader parameter; the value is
                passed to the kernel using a special protocol.
.......

这个参数由grub处理,处理结果存入装载的内核文件的头部的vid_mode处

内核文件头部是这样一个数据结构:

/* For the Linux/i386 boot protocol version 2.03. */
struct linux_kernel_header
{
char code1[0x0020];
unsigned short cl_magic; /* Magic number 0xA33F */
unsigned short cl_offset; /* The offset of command line */
char code2[0x01F1 - 0x0020 - 2 - 2];
unsigned char setup_sects; /* The size of the setup in sectors */
unsigned short root_flags; /* If the root is mounted readonly */
unsigned short syssize; /* obsolete */
unsigned short swap_dev; /* obsolete */
unsigned short ram_size; /* obsolete */
unsigned short vid_mode; /* Video mode control */
unsigned short root_dev; /* Default root device number */
unsigned short boot_flag; /* 0xAA55 magic number */
unsigned short jump; /* Jump instruction */
unsigned long header; /* Magic signature "HdrS" */
unsigned short version; /* Boot protocol version supported */
unsigned long realmode_swtch; /* Boot loader hook */
unsigned long start_sys; /* Points to kernel version string */
unsigned char type_of_loader; /* Boot loader identifier */
unsigned char loadflags; /* Boot protocol option flags */
unsigned short setup_move_size; /* Move to high memory size */
unsigned long code32_start; /* Boot loader hook */
unsigned long ramdisk_image; /* initrd load address */
unsigned long ramdisk_size; /* initrd size */
unsigned long bootsect_kludge; /* obsolete */
unsigned short heap_end_ptr; /* Free memory after setup end */
unsigned short pad1; /* Unused */
char *cmd_line_ptr; /* Points to the kernel command line */
unsigned long initrd_addr_max; /* The highest address of initrd */
} __attribute__ ((packed));
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表