We mentioned in the previous article, how to make bootsect, of course, people are always greedy, production finished bootsect and think about doing setup, Setup main work is to open A20, enter the protection mode, and so on.
I. Introduction of A20
This is a historic issue, in Intel processor 8086, "segment: Offset" Maximum can represent the memory address is ffff:ffff, that is, 10FFEFh, but 8,086 only 20-bit addressing address bus, only addressed to 1MB, if you try to access more than 1MB memory address, There is no error, but back to the volume, that is, back to the 0000:0000 address, and from the zero start addressing, but to 80286, can really access to more than 1MB of memory, if encountered the same situation, the system will not be back to the volume addressing, which caused upward incompatibility, in order to ensure 100% compatibility, IBM came up with a way to use a 8042 keyboard controller to control the 20th address bit, which is the A20 address line.
Second, practical operation
Directly affixed to the code, but also intimidate readers hehe:
Open the A20 address line inal,0x92; Enter the South bridge chip oral,00000010b; Open the 2nd bit of the South Bridge chip (A20 control bit) out 0x92,al; Send the modified configuration back to the South bridge chip
Here's another way, not using the 8042 keyboard controller, the note has been said, and, this code to run under the privilege level of RING0, if you want to continue to operate later, require JMP instructions and enter the protection mode, we will introduce in the next article into the protection mode.
If you have any questions, you can contact me: email:[email protected]
If the reader friend also has the idea of developing the operating system, you can contact me.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Operating system development--open A20