Hello,
I am reading the xv6 teaching kernel book from MIT website alongside the code. In the book there is a section on page 88 which says "A virtual segment:offset can yield a 21-bit physical address, but the Intel 8088 could only address 20 bits of memory..".
Now my question is, If the segment register is 16 bits (2 ^ 4) and offset width is 16 bits then together they can refer up to
2 ^ 4 * 2 ^ 16 which is 2 ^ 20 memory region so in effect they would yield only 20-bit physical address right ? where am i going wrong in this ?
Thanks,
Arun
doubt on a specific section in xv6 kernel pdf
Re: doubt on a specific section in xv6 kernel pdf
i80286 and later CPUs have more than 20 address bits.
If you do the math, the maximum possible address using this seg:ofs scheme is greater than 1MB (IOW, needs more than 20 bits):
0xFFFF:0xFFFF -> 0xFFFF * 0x10 + 0xFFFF = 0x10FFEF.
For compatibility with the i8086/i80186 the address bit 20 (AKA A20) can be optionally enabled or disabled (that is, tied to 0).
I think you should be able to find answers to such questions in various documentation from intel/AMD/Microsoft (e.g. MSDOS had options to use those nearly 64KB after the 1MB point to load drivers and parts of itself there).
If you do the math, the maximum possible address using this seg:ofs scheme is greater than 1MB (IOW, needs more than 20 bits):
0xFFFF:0xFFFF -> 0xFFFF * 0x10 + 0xFFFF = 0x10FFEF.
For compatibility with the i8086/i80186 the address bit 20 (AKA A20) can be optionally enabled or disabled (that is, tied to 0).
I think you should be able to find answers to such questions in various documentation from intel/AMD/Microsoft (e.g. MSDOS had options to use those nearly 64KB after the 1MB point to load drivers and parts of itself there).