写一个操作系统:第十天

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32862515/article/details/84647417

计划

今天终于写到了内核,可以使用c语言了。
打算复习一下前面的内容,加深理解。

笔记

  • overlay
  • 虚拟内存(Virtual Memory)
    虚拟内存的基本思想是程序、数据、堆栈的总的大小可以超过物理存储器的大小。
  • Accessing more than 64k requires the use of segment register that are difficult to work with.
    这类似在汇编课上学过的段超越
  • 实模式下默认的CPU操作数长度是16位。
  • GDT是基于硬件的内存保护
  • 实模式下可以使用bios中断,保护模式下不可以。
  • Programmers often think that since Real Mode defaults to 16 bits, that the 32 bit registers are not accessible. This is not true.
    All of the 32-bit registers (EAX, …) are still usable, by simply adding the “Operand Size Override Prefix” (0x66) to the beginning of any instruction. Your assembler is likely to do this for you, if you simply try to use a 32-bit register.
  • If you set DS (or any segment register) to a value of 0xFFFF, it points to an address that is 16 bytes below 1 MB. If you then use that segment register as a base, with an offset of 0x10 to 0xFFFF, you can access physical memory addresses from 0x100000 to 0x10FFEF. This (almost 64 kB) area above 1 MB is called the “High Memory Area” in Real Mode. Note that you have to have the A20 address line activated for this to work.
  • The physical address space is the direct memory address used to access a real location in RAM.
  • A virtual address can be mapped to any physical address.

参考链接

问题

  • 地址对齐的概念一直不理解
  • 什么是opcode?
  • PIC(Position Independent Code)

猜你喜欢

转载自blog.csdn.net/qq_32862515/article/details/84647417