From 2860386c4e8c9a3caa4e7649b669596e0fa5ef7d Mon Sep 17 00:00:00 2001 From: Kudzu Date: Tue, 8 Aug 2017 14:30:52 -0400 Subject: [PATCH] g3 --- .../Kernel-X86/10-CPU/Cosmos.CPU.x86/TempDebug.cs | 11 ++++++----- .../Cosmos.Platform.PC/Devices/Processor.cs | 2 +- Cosmos/source/Kernel-X86/50-Application/Boot.cs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cosmos/source/Kernel-X86/10-CPU/Cosmos.CPU.x86/TempDebug.cs b/Cosmos/source/Kernel-X86/10-CPU/Cosmos.CPU.x86/TempDebug.cs index df6bb4c0f..38a4404a3 100644 --- a/Cosmos/source/Kernel-X86/10-CPU/Cosmos.CPU.x86/TempDebug.cs +++ b/Cosmos/source/Kernel-X86/10-CPU/Cosmos.CPU.x86/TempDebug.cs @@ -2,13 +2,14 @@ namespace Cosmos.CPU.x86 { static public class TempDebug { - static public void ShowText(byte aChar, int aOffset) { + unsafe static byte* mPtr = (byte*)(0xB8000 - 1); + static public void ShowText(char aChar) { unsafe { - byte* xTest = (byte*)0xB8000 + aOffset * 2; - *xTest = aChar; + mPtr++; + *mPtr = (byte)aChar; - xTest++; - *xTest = 0x0A; + mPtr++; + *mPtr = 0x0A; } } } diff --git a/Cosmos/source/Kernel-X86/20-Platform/Cosmos.Platform.PC/Devices/Processor.cs b/Cosmos/source/Kernel-X86/20-Platform/Cosmos.Platform.PC/Devices/Processor.cs index e32143222..a48109478 100644 --- a/Cosmos/source/Kernel-X86/20-Platform/Cosmos.Platform.PC/Devices/Processor.cs +++ b/Cosmos/source/Kernel-X86/20-Platform/Cosmos.Platform.PC/Devices/Processor.cs @@ -6,7 +6,7 @@ namespace Cosmos.Platform.PC.Devices { public class Processor : HAL.Devices.Processor { public override ulong SetOption(uint aID, ulong aValue = 0) { if (aID == 0) { - CPU.x86.TempDebug.ShowText(66, 1); + CPU.x86.TempDebug.ShowText('C'); } return 0; } diff --git a/Cosmos/source/Kernel-X86/50-Application/Boot.cs b/Cosmos/source/Kernel-X86/50-Application/Boot.cs index 45c94c8bc..0c8847562 100644 --- a/Cosmos/source/Kernel-X86/50-Application/Boot.cs +++ b/Cosmos/source/Kernel-X86/50-Application/Boot.cs @@ -6,8 +6,8 @@ namespace KernelGen3 { static public class Boot { [BootEntry] static private void Init() { - Cosmos.CPU.x86.TempDebug.ShowText(65, 0); - Cosmos.CPU.x86.TempDebug.ShowText(66, 1); + Cosmos.CPU.x86.TempDebug.ShowText('A'); + Cosmos.CPU.x86.TempDebug.ShowText('c'); //Cosmos.System.Boot.TempDebugTest(); while (true) {