From c0309afb117ac76bc272ca5efaef3a39e7ff3f29 Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Sat, 26 Feb 2011 13:33:26 +0000 Subject: [PATCH] --- .../Users/Kudzu/Breakpoints/BreakpointsOS.cs | 69 ++++++++++--------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/source2/Users/Kudzu/Breakpoints/BreakpointsOS.cs b/source2/Users/Kudzu/Breakpoints/BreakpointsOS.cs index 2afe17d2c..4cf69b600 100644 --- a/source2/Users/Kudzu/Breakpoints/BreakpointsOS.cs +++ b/source2/Users/Kudzu/Breakpoints/BreakpointsOS.cs @@ -47,45 +47,48 @@ namespace BreakpointsKernel { } protected override void Run() { - // This first line causes both Cosmos and VS to lock up - //var x = BlockDevice.Devices[0]; - //var v = BlockDevice.Devices.Count; - // Next line barfs. No reflection? - //string y = x.GetType().ToString(); - // Next line cause Run to restart? Inteferes with loop? - //var z = (AtaPio)x; - // Next line barfs too - //var xATA = (AtaPio)BlockDevice.Devices[0]; + try { + //Trace1(); - Trace1(); + //var x = BlockDevice.Devices[0]; + //var v = BlockDevice.Devices.Count; + // Next line barfs. No reflection? + // Next line cause Run to restart? Inteferes with loop? + //var z = (AtaPio)x; + // Next line barfs too - Console.WriteLine("Block devices found: " + BlockDevice.Devices.Count); + Console.WriteLine("Block devices found: " + BlockDevice.Devices.Count); - var xATA = new AtaPio(Cosmos.Core.Global.BaseIOGroups.ATA1, Ata.ControllerIdEnum.Primary, Ata.BusPositionEnum.Master); - Console.WriteLine("--------------------------"); - Console.WriteLine("Type: " + (xATA.DriveType == AtaPio.SpecLevel.ATA ? "ATA" : "ATAPI")); - Console.WriteLine("Serial No: " + xATA.SerialNo); - Console.WriteLine("Firmware Rev: " + xATA.FirmwareRev); - Console.WriteLine("Model No: " + xATA.ModelNo); - Console.WriteLine("Size: " + xATA.BlockCount * xATA.BlockSize / 1024 / 1024 + " MB"); + var xATA = (AtaPio)BlockDevice.Devices[0]; + //var xATA = new AtaPio(Cosmos.Core.Global.BaseIOGroups.ATA1, Ata.ControllerIdEnum.Primary, Ata.BusPositionEnum.Master); + Console.WriteLine("--------------------------"); + Console.WriteLine("Type: " + (xATA.DriveType == AtaPio.SpecLevel.ATA ? "ATA" : "ATAPI")); + Console.WriteLine("Serial No: " + xATA.SerialNo); + Console.WriteLine("Firmware Rev: " + xATA.FirmwareRev); + Console.WriteLine("Model No: " + xATA.ModelNo); + Console.WriteLine("Size: " + xATA.BlockCount * xATA.BlockSize / 1024 / 1024 + " MB"); - var xFS = new Cosmos.System.Filesystem.FAT(BlockDevice.Devices[1]); - xFS.GetDir(); + var xFS = new Cosmos.System.Filesystem.FAT(BlockDevice.Devices[1]); + xFS.GetDir(); - //var xWrite = new byte[512]; - //for (int i = 0; i < 512; i++) { - // xWrite[i] = (byte)i; - //} - //xATA.WriteBlock(0, xWrite); + //var xWrite = new byte[512]; + //for (int i = 0; i < 512; i++) { + // xWrite[i] = (byte)i; + //} + //xATA.WriteBlock(0, xWrite); - //var xRead = new byte[512]; - //xATA.ReadBlock(0, xRead); - //string xDisplay = ""; - //for (int i = 0; i < 512; i++) { - // xDisplay = xDisplay + xRead[i].ToHex(); - //} - //Console.WriteLine(xDisplay); - Stop(); + //var xRead = new byte[512]; + //xATA.ReadBlock(0, xRead); + //string xDisplay = ""; + //for (int i = 0; i < 512; i++) { + // xDisplay = xDisplay + xRead[i].ToHex(); + //} + //Console.WriteLine(xDisplay); + Stop(); + } catch (Exception e) { + Console.WriteLine("Exception: " + e.Message); + Stop(); + } } protected override void AfterRun() {