Memory initialization: Difference between revisions
(Created page with "==During AMC-OS Loader== To get size and map of memory, AMC-OS Loader now relies mainly on BIOS instead of probing, which was the preferred way in AMC-OS <2.10. AMC-OS Loade...") |
No edit summary |
||
Line 1: | Line 1: | ||
=During AMC-OS Loader= | |||
To get size and map of memory, AMC-OS Loader now relies mainly on BIOS instead of probing, which was the preferred way in AMC-OS <2.10. | To get size and map of memory, AMC-OS Loader now relies mainly on BIOS instead of probing, which was the preferred way in AMC-OS <2.10. | ||
Line 11: | Line 11: | ||
Depending on functions supported by BIOS, map will be more or less precise, and memory might be lost if ISA Hole in the 15-16M area is configured. | Depending on functions supported by BIOS, map will be more or less precise, and memory might be lost if ISA Hole in the 15-16M area is configured. | ||
==Kernel | =Kernel start= | ||
When Kernel starts, AMC-OS uses information discovered by the loader to build memory structures. | |||
==First megabyte== | |||
Kernel starts by calling <code>INIT_MemoryUsableIn1stMeg</code>. The function determines the first address of free memory in the first megabyte, just after kernel relocation code and below EBDA. | |||
The function fills : | |||
* <code>MEMORY_FreePageAddrIn1stMeg</code> | |||
* <code>MEMORY_FreePagesIn1stMeg</code> | |||
==A20 Gate== | |||
Kernel unlocks A20 gate by calling <code>INIT_A20Gate</code>. | |||
A20 gate was controlled by keyboard controller on AT+. To allow compatibility with 8086/8088, the A20 address line was forced to 0 on AT computers, blocking access to memory above 1MB. A20 gate must be enabled to allow A20 address line to be used normally. |
Revision as of 18:39, 18 April 2020
During AMC-OS Loader
To get size and map of memory, AMC-OS Loader now relies mainly on BIOS instead of probing, which was the preferred way in AMC-OS <2.10.
AMC-OS Loader proceed this way :
- Try INT 15H, function E820 to get memory map.
- Try INT 15H, function E801 to get size of memory below 16MB and above 16MB
- Try INT 15H, function 88 to get effective size of extended memory
- Get configured size of extended memory in CMOS
Depending on functions supported by BIOS, map will be more or less precise, and memory might be lost if ISA Hole in the 15-16M area is configured.
Kernel start
When Kernel starts, AMC-OS uses information discovered by the loader to build memory structures.
First megabyte
Kernel starts by calling INIT_MemoryUsableIn1stMeg
. The function determines the first address of free memory in the first megabyte, just after kernel relocation code and below EBDA.
The function fills :
MEMORY_FreePageAddrIn1stMeg
MEMORY_FreePagesIn1stMeg
A20 Gate
Kernel unlocks A20 gate by calling INIT_A20Gate
.
A20 gate was controlled by keyboard controller on AT+. To allow compatibility with 8086/8088, the A20 address line was forced to 0 on AT computers, blocking access to memory above 1MB. A20 gate must be enabled to allow A20 address line to be used normally.