This commit is contained in:
ralfkronemeyer_cp 2008-06-25 09:19:22 +00:00
parent 96e8f57339
commit 39a5c67a47
7 changed files with 48 additions and 1 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.Kernel;
namespace Cosmos.Hardware {
public class Global {
@ -42,7 +43,7 @@ namespace Cosmos.Hardware {
uint xEnd = xStart + aMSec;
Cosmos.Hardware.DebugUtil.SendNumber("PC", "Sleep", aMSec, 32);
while (TickCount < xEnd) {
;
CPU.Halt();
}
Cosmos.Hardware.DebugUtil.SendMessage("PC", "Sleeping done");
}

View file

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Indy.IL2CPU.Plugs;
using Indy.IL2CPU.Assembler;
using Assembler = Indy.IL2CPU.Assembler.Assembler;
using CPUAll = Indy.IL2CPU.Assembler;
using CPUx86 = Indy.IL2CPU.Assembler.X86;
namespace Cosmos.Kernel.Plugs.Assemblers
{
public class Halt : AssemblerMethod
{
public override void Assemble(Assembler aAssembler)
{
new CPUx86.Hlt();
}
}
}

View file

@ -73,5 +73,12 @@ namespace Cosmos.Kernel.Plugs {
b = 0;
a = 0;
}
[PlugMethod(MethodAssembler = typeof(Assemblers.Halt))]
public static void Halt()
{
}
}
}

View file

@ -54,6 +54,7 @@
<Compile Include="Assemblers\GetCurrentESP.cs" />
<Compile Include="Assemblers\GetEndOfKernel.cs" />
<Compile Include="Assemblers\GetEndOfStack.cs" />
<Compile Include="Assemblers\Halt.cs" />
<Compile Include="Assemblers\IORead16.cs" />
<Compile Include="Assemblers\IORead32.cs" />
<Compile Include="Assemblers\IOWrite16.cs" />

View file

@ -114,5 +114,11 @@ namespace Cosmos.Kernel {
b = 0;
a = 0;
}
//Plugged
public static void Halt()
{
}
}
}

View file

@ -0,0 +1,10 @@
using System;
using System.Linq;
namespace Indy.IL2CPU.Assembler.X86
{
[OpCode(0xF4, "hlt")]
public class Hlt : Instruction
{
}
}

View file

@ -64,6 +64,7 @@
<Compile Include="ConditionalMove.cs" />
<Compile Include="Condition.cs" />
<Compile Include="CpuId.cs" />
<Compile Include="Hlt.cs" />
<Compile Include="Popfd.cs" />
<Compile Include="RotateThroughCarryRight.cs" />
<Compile Include="DebugStub.cs" />