mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-04 23:31:37 +00:00
This commit is contained in:
parent
96e8f57339
commit
39a5c67a47
7 changed files with 48 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Cosmos.Kernel;
|
||||||
|
|
||||||
namespace Cosmos.Hardware {
|
namespace Cosmos.Hardware {
|
||||||
public class Global {
|
public class Global {
|
||||||
|
|
@ -42,7 +43,7 @@ namespace Cosmos.Hardware {
|
||||||
uint xEnd = xStart + aMSec;
|
uint xEnd = xStart + aMSec;
|
||||||
Cosmos.Hardware.DebugUtil.SendNumber("PC", "Sleep", aMSec, 32);
|
Cosmos.Hardware.DebugUtil.SendNumber("PC", "Sleep", aMSec, 32);
|
||||||
while (TickCount < xEnd) {
|
while (TickCount < xEnd) {
|
||||||
;
|
CPU.Halt();
|
||||||
}
|
}
|
||||||
Cosmos.Hardware.DebugUtil.SendMessage("PC", "Sleeping done");
|
Cosmos.Hardware.DebugUtil.SendMessage("PC", "Sleeping done");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
source/Cosmos/Cosmos.Kernel.Plugs/Assemblers/Halt.cs
Normal file
21
source/Cosmos/Cosmos.Kernel.Plugs/Assemblers/Halt.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -73,5 +73,12 @@ namespace Cosmos.Kernel.Plugs {
|
||||||
b = 0;
|
b = 0;
|
||||||
a = 0;
|
a = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[PlugMethod(MethodAssembler = typeof(Assemblers.Halt))]
|
||||||
|
public static void Halt()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@
|
||||||
<Compile Include="Assemblers\GetCurrentESP.cs" />
|
<Compile Include="Assemblers\GetCurrentESP.cs" />
|
||||||
<Compile Include="Assemblers\GetEndOfKernel.cs" />
|
<Compile Include="Assemblers\GetEndOfKernel.cs" />
|
||||||
<Compile Include="Assemblers\GetEndOfStack.cs" />
|
<Compile Include="Assemblers\GetEndOfStack.cs" />
|
||||||
|
<Compile Include="Assemblers\Halt.cs" />
|
||||||
<Compile Include="Assemblers\IORead16.cs" />
|
<Compile Include="Assemblers\IORead16.cs" />
|
||||||
<Compile Include="Assemblers\IORead32.cs" />
|
<Compile Include="Assemblers\IORead32.cs" />
|
||||||
<Compile Include="Assemblers\IOWrite16.cs" />
|
<Compile Include="Assemblers\IOWrite16.cs" />
|
||||||
|
|
|
||||||
|
|
@ -114,5 +114,11 @@ namespace Cosmos.Kernel {
|
||||||
b = 0;
|
b = 0;
|
||||||
a = 0;
|
a = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Plugged
|
||||||
|
public static void Halt()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
10
source/Indy.IL2CPU.Assembler.X86/Hlt.cs
Normal file
10
source/Indy.IL2CPU.Assembler.X86/Hlt.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Indy.IL2CPU.Assembler.X86
|
||||||
|
{
|
||||||
|
[OpCode(0xF4, "hlt")]
|
||||||
|
public class Hlt : Instruction
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
<Compile Include="ConditionalMove.cs" />
|
<Compile Include="ConditionalMove.cs" />
|
||||||
<Compile Include="Condition.cs" />
|
<Compile Include="Condition.cs" />
|
||||||
<Compile Include="CpuId.cs" />
|
<Compile Include="CpuId.cs" />
|
||||||
|
<Compile Include="Hlt.cs" />
|
||||||
<Compile Include="Popfd.cs" />
|
<Compile Include="Popfd.cs" />
|
||||||
<Compile Include="RotateThroughCarryRight.cs" />
|
<Compile Include="RotateThroughCarryRight.cs" />
|
||||||
<Compile Include="DebugStub.cs" />
|
<Compile Include="DebugStub.cs" />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue