From 06e96d09e55a74db355420b99eb57c87ca24e0fa Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Mon, 16 Jan 2012 04:56:51 +0000 Subject: [PATCH] --- Docs/Kernel/Heap.html | 14 + Docs/Kernel/Startup.htm | 17 + source/Cosmos/Cosmos.Kernel/Heap.cs | 687 +++++++++--------- .../Cosmos.Hardware/BlockDevice/Partition.cs | 4 +- .../System/Hardware/Cosmos.Hardware/Global.cs | 6 +- source2/Users/Kudzu/Kudzu-Notes.html | 10 +- 6 files changed, 381 insertions(+), 357 deletions(-) create mode 100644 Docs/Kernel/Heap.html create mode 100644 Docs/Kernel/Startup.htm diff --git a/Docs/Kernel/Heap.html b/Docs/Kernel/Heap.html new file mode 100644 index 000000000..b54079a3f --- /dev/null +++ b/Docs/Kernel/Heap.html @@ -0,0 +1,14 @@ + + + + + + + + +

+ The heap is initialized on demand. The first time a heap allocation is required, + it initializes itself.

+ + + diff --git a/Docs/Kernel/Startup.htm b/Docs/Kernel/Startup.htm new file mode 100644 index 000000000..f234d3b5a --- /dev/null +++ b/Docs/Kernel/Startup.htm @@ -0,0 +1,17 @@ + + + + + + + + +

+ There is some basic hand coded assembly which is the first entry point of + Cosmos. From there the first C# entry point is Cosmos.System.Kernel.Start().

+

+ Cosmos.System.Kernel is an abstract class that each project creates one + descendant of to create the operating system.

+ + + diff --git a/source/Cosmos/Cosmos.Kernel/Heap.cs b/source/Cosmos/Cosmos.Kernel/Heap.cs index 2d1e735c7..8adbc1654 100644 --- a/source/Cosmos/Cosmos.Kernel/Heap.cs +++ b/source/Cosmos/Cosmos.Kernel/Heap.cs @@ -1,356 +1,343 @@ using System; -namespace Cosmos.Kernel -{ - public static class Heap - { - public static bool EnableDebug = true; - private static uint mStart; - private static uint mStartAddress; - private static uint mLength; - private static uint mEndOfRam; - - private static void Initialize(uint aStartAddress, uint aEndOfRam) - { - mStart = mStartAddress = aStartAddress + (4 - (aStartAddress % 4)); - mLength = aEndOfRam - aStartAddress; - mLength = (mLength / 4) * 4; - mStartAddress += 1024; - mEndOfRam = aEndOfRam; - mStartAddress = (mStartAddress / 4) * 4; - mLength -= 1024; - ClearMemory(aStartAddress, mLength); - UpdateDebugDisplay(); - } - - private static void WriteNumber(uint aNumber, byte aBits) - { - uint xValue = aNumber; - byte xCurrentBits = aBits; - Console.Write("0x"); - while (xCurrentBits >= 4) { - xCurrentBits -= 4; - byte xCurrentDigit = (byte)((xValue >> xCurrentBits) & 0xF); - string xDigitString = null; - switch (xCurrentDigit) { - case 0: - xDigitString = "0"; - goto default; - case 1: - xDigitString = "1"; - goto default; - case 2: - xDigitString = "2"; - goto default; - case 3: - xDigitString = "3"; - goto default; - case 4: - xDigitString = "4"; - goto default; - case 5: - xDigitString = "5"; - goto default; - case 6: - xDigitString = "6"; - goto default; - case 7: - xDigitString = "7"; - goto default; - case 8: - xDigitString = "8"; - goto default; - case 9: - xDigitString = "9"; - goto default; - case 10: - xDigitString = "A"; - goto default; - case 11: - xDigitString = "B"; - goto default; - case 12: - xDigitString = "C"; - goto default; - case 13: - xDigitString = "D"; - goto default; - case 14: - xDigitString = "E"; - goto default; - case 15: - xDigitString = "F"; - goto default; - default: - if (xDigitString == null) { - System.Diagnostics.Debugger.Break(); - } - Console.Write(xDigitString); - break; - } - } - } - - private static bool mDebugDisplayInitialized = false; - - // this method displays the used/total memory of the heap on the first line of the text screen - private static void UpdateDebugDisplay() - { - //if (EnableDebug) - //{ - // if (!mDebugDisplayInitialized) - // { - // mDebugDisplayInitialized = true; - // int xOldPositionLeft = Console.CursorLeft; - // int xOldPositionTop = Console.CursorTop; - // Console.CursorLeft = 0; - // Console.CursorTop = 0; - // Console.Write("[Heap Usage: "); - // WriteNumber(mStartAddress, - // 32); - // Console.Write("/"); - // WriteNumber(mEndOfRam, - // 32); - // Console.Write("] bytes"); - // while (Console.CursorLeft < (Console.WindowWidth-1)) - // { - // Console.Write(" "); - // } - // Console.CursorLeft = xOldPositionLeft; - // Console.CursorTop = xOldPositionTop; - // } - // else - // { - // int xOldPositionLeft = Console.CursorLeft; - // int xOldPositionTop = Console.CursorTop; - // Console.CursorLeft = 13; - // Console.CursorTop = 0; - // WriteNumber(mStartAddress, - // 32); - // Console.CursorLeft = xOldPositionLeft; - // Console.CursorTop = xOldPositionTop; - // } - //} - } - - private static bool mInited; - public static void Init() - { - if (!mInited) - { - mInited = true; - Initialize(CPU.EndOfKernel, (CPU.AmountOfMemory * 1024 * 1024) - 1024); - } - } - private static void ClearMemory(uint aStartAddress, uint aLength) - { - CPU.ZeroFill(aStartAddress, aLength); - } - - public static uint MemAlloc(uint aLength) - { - Init(); - uint xTemp = mStartAddress; - - if ((xTemp + aLength) > (mStart + mLength)) - { -Console.WriteLine("Too large memory block allocated!"); -WriteNumber(aLength, 32); - while (true) - ; - } - mStartAddress += aLength; - UpdateDebugDisplay(); - return xTemp; - } - - public static void MemFree(uint aPointer) - { - } +namespace Cosmos.Kernel { + public static class Heap { + public static bool EnableDebug = true; + private static uint mStart; + private static uint mStartAddress; + private static uint mLength; + private static uint mEndOfRam; + private static void Initialize(uint aStartAddress, uint aEndOfRam) { + mStart = mStartAddress = aStartAddress + (4 - (aStartAddress % 4)); + mLength = aEndOfRam - aStartAddress; + mLength = (mLength / 4) * 4; + mStartAddress += 1024; + mEndOfRam = aEndOfRam; + mStartAddress = (mStartAddress / 4) * 4; + mLength -= 1024; + ClearMemory(aStartAddress, mLength); + UpdateDebugDisplay(); } - #region old - // public unsafe static class Heap { -// private enum MemoryBlockState: byte { -// Free, -// Used, -// EndOfMemory -// } -// private unsafe struct MemoryBlock { -// public MemoryBlockState State; -// public MemoryBlock* Next; -// public byte FirstByte; -// } -// private static uint mStart; -// private static uint mStartAddress; -// // private static uint mCurrentAddress = mStartAddress; -// private static uint mLength; -// private static MemoryBlock* mFirstBlock; -// //private const uint DefaultStartAddress = 4 * 1024 * 1024; -// //private const uint DefaultMaxMemory = 32 * 1024 * 1024; -// -// private static void ClearMemory(uint aStartAddress, uint aLength) { -// //int xStart = (RTC.GetMinutes() * 60) + RTC.GetSeconds(); -// CPU.ZeroFill(aStartAddress, aLength); -// //int xEnd = (RTC.GetMinutes() * 60) + RTC.GetSeconds(); -// //int xDiff = xEnd - xStart; -// //Console.Write("Time to clear "); -// //Hardware.Storage.ATAOld.WriteNumber((uint)xDiff, 32); -// //Console.WriteLine(""); -// } -// -// private static void Initialize(uint aStartAddress, uint aEndOfRam) { -// mStart = mStartAddress = aStartAddress + (4 - (aStartAddress % 4)); -// mLength = aEndOfRam - aStartAddress; -// mLength = (mLength / 4) * 4; -// mStartAddress += 1024; -// mStartAddress = (mStartAddress / 4) * 4; -// mLength -= 1024; -// //Console.Write("Clearing Memory at "); -// int xCursorLeft = Console.CursorLeft; -// // hack: try to get this working with the full chunk or chunks of 1MB -// //const int xBlockSize = 1024 * 1024; -// //for (uint i = 0; i < (mLength / xBlockSize); i++) { -// // Console.CursorLeft = xCursorLeft; -// // Hardware.Storage.ATAOld.WriteNumber(mStartAddress + (i * xBlockSize), 32); -// // ClearMemory(mStartAddress + (i * xBlockSize), xBlockSize); -// //} -// //Console.Write("Clearing Memory...."); -// ClearMemory(aStartAddress, mLength); -// //Console.WriteLine("Done"); -// //mFirstBlock = (MemoryBlock*)aStartAddress; -// //mFirstBlock->State = MemoryBlockState.Free; -// //mFirstBlock->Next = (MemoryBlock*)(aStartAddress + mLength); -// //mFirstBlock->Next->State = MemoryBlockState.EndOfMemory; -// DebugUtil.SendMM_Init(mStartAddress, mLength); -// } -// private static bool mInited; -// public static void Init() { -// if (!mInited) { -// mInited = true; -// Initialize(CPU.EndOfKernel, (CPU.AmountOfMemory * 1024 * 1024) - 1024); -// } -// } -// -// public static uint MemAlloc(uint aLength) { -// Init(); -// uint xTemp = mStartAddress; -// if ((xTemp + aLength) > (mStart + mLength)) { -// Console.WriteLine("Too large memory block allocated!"); -// Console.Write(" BlockSize = "); -// // dont use .ToString here, as it uses heap... -// WriteNumber(aLength, 32); -// Console.WriteLine(""); -// System.Diagnostics.Debugger.Break(); -// } -// mStartAddress += aLength; -// DebugUtil.SendMM_Alloc(xTemp, aLength); -// return xTemp; -// //CheckInit(); -// //MemoryBlock* xCurrentBlock = mFirstBlock; -// //bool xFound = false; -// //while (!xFound) { -// // if (xCurrentBlock->State == MemoryBlockState.EndOfMemory) { -// // DebugUtil.SendError("MM", "Reached maximum memory"); -// // return 0; -// // } -// // if (xCurrentBlock->Next == null) { -// // DebugUtil.SendError("MM", "No next block found, but not yet at EOM", (uint)xCurrentBlock, 32); -// // return 0; -// // } -// // if (((((uint)xCurrentBlock->Next) - ((uint)xCurrentBlock)) >= (aLength + 5)) && (xCurrentBlock->State == MemoryBlockState.Free)) { -// // xFound = true; -// // break; -// // } -// // xCurrentBlock = xCurrentBlock->Next; -// //} -// //uint xFoundBlockSize = (((uint)xCurrentBlock->Next) - ((uint)xCurrentBlock)); -// //if (xFoundBlockSize > (aLength + 37)) { -// // MemoryBlock* xOldNextBlock = xCurrentBlock->Next; -// // xCurrentBlock->Next = (MemoryBlock*)(((uint)xCurrentBlock) + aLength + 5); -// // xCurrentBlock->Next->Next = xOldNextBlock; -// // xCurrentBlock->Next->State = MemoryBlockState.Free; -// //} -// //xCurrentBlock->State = MemoryBlockState.Used; -// //DebugUtil.SendMM_Alloc((uint)xCurrentBlock, aLength); -// //return ((uint)xCurrentBlock) + 5; -// } -// -// public static void MemFree(uint aPointer) { -// //MemoryBlock* xBlock = (MemoryBlock*)(aPointer - 5); -// //DebugUtil.SendMM_Free(aPointer - 5, (((uint)xBlock->Next) - ((uint)xBlock))); -// //xBlock->State = MemoryBlockState.Free; -// //uint xLength = ((uint)xBlock->Next) - aPointer; -// //ClearMemory(aPointer, xLength); -// } -// -// public static void WriteNumber(uint aNumber, byte aBits) -// { -// uint xValue = aNumber; -// byte xCurrentBits = aBits; -// Console.Write("0x"); -// while (xCurrentBits >= 4) -// { -// xCurrentBits -= 4; -// byte xCurrentDigit = (byte)((xValue >> xCurrentBits) & 0xF); -// string xDigitString = null; -// switch (xCurrentDigit) -// { -// case 0: -// xDigitString = "0"; -// goto default; -// case 1: -// xDigitString = "1"; -// goto default; -// case 2: -// xDigitString = "2"; -// goto default; -// case 3: -// xDigitString = "3"; -// goto default; -// case 4: -// xDigitString = "4"; -// goto default; -// case 5: -// xDigitString = "5"; -// goto default; -// case 6: -// xDigitString = "6"; -// goto default; -// case 7: -// xDigitString = "7"; -// goto default; -// case 8: -// xDigitString = "8"; -// goto default; -// case 9: -// xDigitString = "9"; -// goto default; -// case 10: -// xDigitString = "A"; -// goto default; -// case 11: -// xDigitString = "B"; -// goto default; -// case 12: -// xDigitString = "C"; -// goto default; -// case 13: -// xDigitString = "D"; -// goto default; -// case 14: -// xDigitString = "E"; -// goto default; -// case 15: -// xDigitString = "F"; -// goto default; -// default: -// Console.Write(xDigitString); -// break; -// } -// } -// } - // } - #endregion old + private static void WriteNumber(uint aNumber, byte aBits) { + uint xValue = aNumber; + byte xCurrentBits = aBits; + Console.Write("0x"); + while (xCurrentBits >= 4) { + xCurrentBits -= 4; + byte xCurrentDigit = (byte)((xValue >> xCurrentBits) & 0xF); + string xDigitString = null; + switch (xCurrentDigit) { + case 0: + xDigitString = "0"; + goto default; + case 1: + xDigitString = "1"; + goto default; + case 2: + xDigitString = "2"; + goto default; + case 3: + xDigitString = "3"; + goto default; + case 4: + xDigitString = "4"; + goto default; + case 5: + xDigitString = "5"; + goto default; + case 6: + xDigitString = "6"; + goto default; + case 7: + xDigitString = "7"; + goto default; + case 8: + xDigitString = "8"; + goto default; + case 9: + xDigitString = "9"; + goto default; + case 10: + xDigitString = "A"; + goto default; + case 11: + xDigitString = "B"; + goto default; + case 12: + xDigitString = "C"; + goto default; + case 13: + xDigitString = "D"; + goto default; + case 14: + xDigitString = "E"; + goto default; + case 15: + xDigitString = "F"; + goto default; + default: + if (xDigitString == null) { + System.Diagnostics.Debugger.Break(); + } + Console.Write(xDigitString); + break; + } + } + } + + private static bool mDebugDisplayInitialized = false; + + // this method displays the used/total memory of the heap on the first line of the text screen + private static void UpdateDebugDisplay() { + //if (EnableDebug) + //{ + // if (!mDebugDisplayInitialized) + // { + // mDebugDisplayInitialized = true; + // int xOldPositionLeft = Console.CursorLeft; + // int xOldPositionTop = Console.CursorTop; + // Console.CursorLeft = 0; + // Console.CursorTop = 0; + // Console.Write("[Heap Usage: "); + // WriteNumber(mStartAddress, + // 32); + // Console.Write("/"); + // WriteNumber(mEndOfRam, + // 32); + // Console.Write("] bytes"); + // while (Console.CursorLeft < (Console.WindowWidth-1)) + // { + // Console.Write(" "); + // } + // Console.CursorLeft = xOldPositionLeft; + // Console.CursorTop = xOldPositionTop; + // } + // else + // { + // int xOldPositionLeft = Console.CursorLeft; + // int xOldPositionTop = Console.CursorTop; + // Console.CursorLeft = 13; + // Console.CursorTop = 0; + // WriteNumber(mStartAddress, + // 32); + // Console.CursorLeft = xOldPositionLeft; + // Console.CursorTop = xOldPositionTop; + // } + //} + } + + private static void ClearMemory(uint aStartAddress, uint aLength) { + CPU.ZeroFill(aStartAddress, aLength); + } + + private static bool mInited; + public static uint MemAlloc(uint aLength) { + if (!mInited) { + mInited = true; + Initialize(CPU.EndOfKernel, (CPU.AmountOfMemory * 1024 * 1024) - 1024); + } + + uint xTemp = mStartAddress; + + if ((xTemp + aLength) > (mStart + mLength)) { + Console.WriteLine("Too large memory block allocated!"); + WriteNumber(aLength, 32); + while (true) + ; + } + mStartAddress += aLength; + UpdateDebugDisplay(); + return xTemp; + } + + public static void MemFree(uint aPointer) { + } + + } + + #region old + // public unsafe static class Heap { + // private enum MemoryBlockState: byte { + // Free, + // Used, + // EndOfMemory + // } + // private unsafe struct MemoryBlock { + // public MemoryBlockState State; + // public MemoryBlock* Next; + // public byte FirstByte; + // } + // private static uint mStart; + // private static uint mStartAddress; + // // private static uint mCurrentAddress = mStartAddress; + // private static uint mLength; + // private static MemoryBlock* mFirstBlock; + // //private const uint DefaultStartAddress = 4 * 1024 * 1024; + // //private const uint DefaultMaxMemory = 32 * 1024 * 1024; + // + // private static void ClearMemory(uint aStartAddress, uint aLength) { + // //int xStart = (RTC.GetMinutes() * 60) + RTC.GetSeconds(); + // CPU.ZeroFill(aStartAddress, aLength); + // //int xEnd = (RTC.GetMinutes() * 60) + RTC.GetSeconds(); + // //int xDiff = xEnd - xStart; + // //Console.Write("Time to clear "); + // //Hardware.Storage.ATAOld.WriteNumber((uint)xDiff, 32); + // //Console.WriteLine(""); + // } + // + // private static void Initialize(uint aStartAddress, uint aEndOfRam) { + // mStart = mStartAddress = aStartAddress + (4 - (aStartAddress % 4)); + // mLength = aEndOfRam - aStartAddress; + // mLength = (mLength / 4) * 4; + // mStartAddress += 1024; + // mStartAddress = (mStartAddress / 4) * 4; + // mLength -= 1024; + // //Console.Write("Clearing Memory at "); + // int xCursorLeft = Console.CursorLeft; + // // hack: try to get this working with the full chunk or chunks of 1MB + // //const int xBlockSize = 1024 * 1024; + // //for (uint i = 0; i < (mLength / xBlockSize); i++) { + // // Console.CursorLeft = xCursorLeft; + // // Hardware.Storage.ATAOld.WriteNumber(mStartAddress + (i * xBlockSize), 32); + // // ClearMemory(mStartAddress + (i * xBlockSize), xBlockSize); + // //} + // //Console.Write("Clearing Memory...."); + // ClearMemory(aStartAddress, mLength); + // //Console.WriteLine("Done"); + // //mFirstBlock = (MemoryBlock*)aStartAddress; + // //mFirstBlock->State = MemoryBlockState.Free; + // //mFirstBlock->Next = (MemoryBlock*)(aStartAddress + mLength); + // //mFirstBlock->Next->State = MemoryBlockState.EndOfMemory; + // DebugUtil.SendMM_Init(mStartAddress, mLength); + // } + // private static bool mInited; + // public static void Init() { + // if (!mInited) { + // mInited = true; + // Initialize(CPU.EndOfKernel, (CPU.AmountOfMemory * 1024 * 1024) - 1024); + // } + // } + // + // public static uint MemAlloc(uint aLength) { + // Init(); + // uint xTemp = mStartAddress; + // if ((xTemp + aLength) > (mStart + mLength)) { + // Console.WriteLine("Too large memory block allocated!"); + // Console.Write(" BlockSize = "); + // // dont use .ToString here, as it uses heap... + // WriteNumber(aLength, 32); + // Console.WriteLine(""); + // System.Diagnostics.Debugger.Break(); + // } + // mStartAddress += aLength; + // DebugUtil.SendMM_Alloc(xTemp, aLength); + // return xTemp; + // //CheckInit(); + // //MemoryBlock* xCurrentBlock = mFirstBlock; + // //bool xFound = false; + // //while (!xFound) { + // // if (xCurrentBlock->State == MemoryBlockState.EndOfMemory) { + // // DebugUtil.SendError("MM", "Reached maximum memory"); + // // return 0; + // // } + // // if (xCurrentBlock->Next == null) { + // // DebugUtil.SendError("MM", "No next block found, but not yet at EOM", (uint)xCurrentBlock, 32); + // // return 0; + // // } + // // if (((((uint)xCurrentBlock->Next) - ((uint)xCurrentBlock)) >= (aLength + 5)) && (xCurrentBlock->State == MemoryBlockState.Free)) { + // // xFound = true; + // // break; + // // } + // // xCurrentBlock = xCurrentBlock->Next; + // //} + // //uint xFoundBlockSize = (((uint)xCurrentBlock->Next) - ((uint)xCurrentBlock)); + // //if (xFoundBlockSize > (aLength + 37)) { + // // MemoryBlock* xOldNextBlock = xCurrentBlock->Next; + // // xCurrentBlock->Next = (MemoryBlock*)(((uint)xCurrentBlock) + aLength + 5); + // // xCurrentBlock->Next->Next = xOldNextBlock; + // // xCurrentBlock->Next->State = MemoryBlockState.Free; + // //} + // //xCurrentBlock->State = MemoryBlockState.Used; + // //DebugUtil.SendMM_Alloc((uint)xCurrentBlock, aLength); + // //return ((uint)xCurrentBlock) + 5; + // } + // + // public static void MemFree(uint aPointer) { + // //MemoryBlock* xBlock = (MemoryBlock*)(aPointer - 5); + // //DebugUtil.SendMM_Free(aPointer - 5, (((uint)xBlock->Next) - ((uint)xBlock))); + // //xBlock->State = MemoryBlockState.Free; + // //uint xLength = ((uint)xBlock->Next) - aPointer; + // //ClearMemory(aPointer, xLength); + // } + // + // public static void WriteNumber(uint aNumber, byte aBits) + // { + // uint xValue = aNumber; + // byte xCurrentBits = aBits; + // Console.Write("0x"); + // while (xCurrentBits >= 4) + // { + // xCurrentBits -= 4; + // byte xCurrentDigit = (byte)((xValue >> xCurrentBits) & 0xF); + // string xDigitString = null; + // switch (xCurrentDigit) + // { + // case 0: + // xDigitString = "0"; + // goto default; + // case 1: + // xDigitString = "1"; + // goto default; + // case 2: + // xDigitString = "2"; + // goto default; + // case 3: + // xDigitString = "3"; + // goto default; + // case 4: + // xDigitString = "4"; + // goto default; + // case 5: + // xDigitString = "5"; + // goto default; + // case 6: + // xDigitString = "6"; + // goto default; + // case 7: + // xDigitString = "7"; + // goto default; + // case 8: + // xDigitString = "8"; + // goto default; + // case 9: + // xDigitString = "9"; + // goto default; + // case 10: + // xDigitString = "A"; + // goto default; + // case 11: + // xDigitString = "B"; + // goto default; + // case 12: + // xDigitString = "C"; + // goto default; + // case 13: + // xDigitString = "D"; + // goto default; + // case 14: + // xDigitString = "E"; + // goto default; + // case 15: + // xDigitString = "F"; + // goto default; + // default: + // Console.Write(xDigitString); + // break; + // } + // } + // } + // } + #endregion old } diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/BlockDevice/Partition.cs b/source2/Kernel/System/Hardware/Cosmos.Hardware/BlockDevice/Partition.cs index b6fa78083..5ab4d147f 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/BlockDevice/Partition.cs +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/BlockDevice/Partition.cs @@ -12,7 +12,9 @@ namespace Cosmos.Hardware.BlockDevice { mHost = aHost; mStartingSector = aStartingSector; mBlockCount = aSectorCount; - mBlockSize = mHost.BlockSize; + var xSize1 = aHost.BlockSize; + var xSize2 = mHost.BlockSize; + mBlockSize = aHost.BlockSize; } public override void ReadBlock(UInt64 aBlockNo, UInt32 aBlockCount, byte[] aData) { diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs b/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs index e089de832..87a19e457 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs @@ -42,6 +42,7 @@ namespace Cosmos.Hardware { // Find hardcoded ATA controllers InitAta(BlockDevice.Ata.ControllerIdEnum.Primary, BlockDevice.Ata.BusPositionEnum.Master); InitAta(BlockDevice.Ata.ControllerIdEnum.Primary, BlockDevice.Ata.BusPositionEnum.Slave); + //TODO Need to change code to detect if ATA controllers are present or not. How to do this? via PCI enum? // They do show up in PCI space as well as the fixed space. // Or is it always here, and was our compiler stack corruption issue? @@ -59,11 +60,6 @@ namespace Cosmos.Hardware { } static public void Init() { - // DANGER! This is before heap? Yet somehow its working currently... - // Leaving it for now because Core.Init outputs to Console, but we need - // to change this... - // Heap seems to self init on demand? But even before IDT/GDT etc? - InitStaticDevices(); InitPciDevices(); } diff --git a/source2/Users/Kudzu/Kudzu-Notes.html b/source2/Users/Kudzu/Kudzu-Notes.html index 8fbe33a64..762e51f7a 100644 --- a/source2/Users/Kudzu/Kudzu-Notes.html +++ b/source2/Users/Kudzu/Kudzu-Notes.html @@ -4,7 +4,15 @@ Kudzu To Do