高手请回答一个关于地址的问题
static void __init probe_roms(void)/*rom空间在内存中的位置是有限制的,它们只能出现在几个特定的区间*/
{
int roms = 1;
unsigned long base;
unsigned char *romstart;
request_resource(&iomem_resource, rom_resources+0);
/* Video ROM is standard at C000:0000 - C7FF:0000, check signature */
问题1:video rom 在这个区间范围内,此时已经是系统初始化的第二阶段,运行在保护模式。实模式下的cs和ip都是16位的,请问保护模式下的cs是否为16位和ip是否为20位?
for (base = 0xC0000; base < 0xE0000; base += 2048) { /*问题2:此处的base是否就是20位的ip?*/
romstart = bus_to_virt(base);
if (!romsignature(romstart))
continue;
request_resource(&iomem_resource, rom_resources + roms);
roms++;
break;
}
/* Extension roms at C800:0000 - DFFF:0000 */
for (base = 0xC8000; base < 0xE0000; base += 2048) {
unsigned long length;
romstart = bus_to_virt(base);
if (!romsignature(romstart))
continue;
length = romstart * 512;
if (length) {
unsigned int i;
unsigned char chksum;
chksum = 0;
for (i = 0; i < length; i++)
chksum += romstart;
/* Good checksum? */
if (!chksum) {
rom_resources.start = base;
rom_resources.end = base + length - 1;
rom_resources.name = "Extension ROM";
rom_resources.flags = IORESOURCE_BUSY;
request_resource(&iomem_resource, rom_resources + roms);
roms++;
if (roms >= MAXROMS)
return;
}
}
}
/* Final check for motherboard extension rom at E000:0000 */
base = 0xE0000;
romstart = bus_to_virt(base);
if (romsignature(romstart)) {
rom_resources.start = base;
rom_resources.end = base + 65535;
rom_resources.name = "Extension ROM";
rom_resources.flags = IORESOURCE_BUSY;
request_resource(&iomem_resource, rom_resources + roms);
}
} 难道就没有高手了吗,请斑竹回答这个问题吧,很纳闷 CS,DS,SS,ES,FS,GS等段寄存器都是16位的,在实模式代表段基址,在保护模式下代表段选择符,是全局(局部)段描述表的偏移量。 我不管你的代码,在保护模式下,EIP是32位的。
页:
[1]