Exemplo n.º 1
0
        public static void ImportMultibootV1MemoryMap()
        {
            if (!Multiboot.IsAvailable)
            {
                return;
            }

            if (Multiboot.MultibootV1.MemoryMapStart.IsNull)
            {
                return;
            }

            AvailableMemory = new Pointer((Multiboot.MultibootV1.MemoryUpper * 1024) + (1024 * 1024));              // assuming all of lower memory

            var memoryMapEnd = Multiboot.MultibootV1.MemoryMapStart + Multiboot.MultibootV1.MemoryMapLength;

            var entry = new MultibootV1MemoryMapEntry(Multiboot.MultibootV1.MemoryMapStart);

            while (entry.Entry < memoryMapEnd)
            {
                SetMemoryMap(entry.BaseAddr, entry.Length, entry.Type == 1 ? BootMemoryType.Available : BootMemoryType.Reserved);

                entry = entry.GetNext();
            }
        }
Exemplo n.º 2
0
        private static void ImportMultibootMemoryMap()
        {
            if (!Multiboot.IsAvailable)
            {
                return;
            }

            if (Multiboot.MultibootV1.MemoryMapStart.IsNull())
            {
                return;
            }

            var memoryMapEnd = Multiboot.MultibootV1.MemoryMapStart + (int)Multiboot.MultibootV1.MemoryMapLength;

            var entry = new MultibootV1MemoryMapEntry(Multiboot.MultibootV1.MemoryMapStart);

            while (entry.IsAvailable)
            {
                BootMemoryMap.SetMemoryMap(entry.BaseAddr, entry.Length, entry.Type == 1 ? BootMemoryMapType.Available : BootMemoryMapType.Reserved);

                entry = entry.GetNext(memoryMapEnd);
            }
        }