GetMemoryMapType() public static method

Gets the type of the memory map.
public static GetMemoryMapType ( uint index ) : byte
index uint The index.
return byte
Ejemplo n.º 1
0
        /// <summary>
        /// Setups the free memory.
        /// </summary>
        private static void SetupFreeMemory()
        {
            if (!Multiboot.IsMultibootAvailable)
            {
                return;
            }

            for (uint index = 0; index < Multiboot.MemoryMapCount; index++)
            {
                byte value = Multiboot.GetMemoryMapType(index);

                if (value == 1)
                {
                    uint start = Multiboot.GetMemoryMapBase(index);
                    uint size  = Multiboot.GetMemoryMapLength(index);

                    AddFreeMemory(start, size);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Setups the free memory.
        /// </summary>
        private static void SetupFreeMemory()
        {
            if (!Multiboot.IsMultibootEnabled)
            {
                return;
            }

            uint cnt = 0;

            for (uint index = 0; index < Multiboot.MemoryMapCount; index++)
            {
                byte value = Multiboot.GetMemoryMapType(index);

                ulong start = Multiboot.GetMemoryMapBase(index);
                ulong size  = Multiboot.GetMemoryMapLength(index);

                if (value == 1)
                {
                    AddFreeMemory(cnt++, (uint)start, (uint)size);
                }
            }
        }