https://pdos.csail.mit.edu/6.828/2018/labs/lab1/
note:
32位cpu 内存空间4GB 是怎么算的?为什么单位从b变成了B
处理器最小寻址粒度一般是byte,字节
32位处理器一般理论寻址空间2^32Bytes
2^32=2^10(K)*2^10(M)*2^10(G)*4
CS & IP
Code segment (CS) is a 16-bit register containing address of 64 KB segment with processor instructions. The processor uses CS segment for all accesses to instructions referenced by instruction pointer (IP) register. CS register cannot be changed directly. The CS register is automatically updated during far jump, far call and far return instructions.
Instruction Pointer (IP) is a 16-bit register.
Since the Instruction Pointer (IP) is 16 bit it means you can only have 64k instructions (2^16), which wasn’t much even in the 80s. So to expand the address space you have a second register which addresses 64k blocks. You could consider cs:ip together as one 32 bit register which is then capable of addressing 2^32 bytes…ie 4G which is what you get on a processor which uses 32 bit addresses. The 8086 was using 20 bits of addresses, so you could access 1M of memory.
https://xinqiu.me/2016/10/15/MIT-6.828-1/
MIT 6.828 Lab1 - Booting a PC (The Kernel) https://yangbolong.github.io/2017/02/13/lab1-cont/