diff --git a/Build/Run QEMU no pipes no GDB.bat b/Build/Run QEMU no pipes no GDB.bat new file mode 100644 index 000000000..e66eea952 --- /dev/null +++ b/Build/Run QEMU no pipes no GDB.bat @@ -0,0 +1,4 @@ +cd tools\qemu +qemu -L \source\Cosmos\Build\Tools\qemu\ -cdrom \source\Cosmos\source2\Users\Kudzu\Breakpoints\bin\Debug\CosmosKernel.iso + +pause diff --git a/Build/Run QEMU to test pipes.bat b/Build/Run QEMU to test pipes.bat new file mode 100644 index 000000000..d743ca97b --- /dev/null +++ b/Build/Run QEMU to test pipes.bat @@ -0,0 +1,4 @@ +cd tools\qemu +qemu -serial pipe:CosmosDebug -L \source\Cosmos\Build\Tools\qemu\ -cdrom \source\Cosmos\source2\Users\Kudzu\Breakpoints\bin\Debug\CosmosKernel.iso + +pause diff --git a/Build/VSIP/install.bat b/Build/VSIP/install.bat index fbd193493..676a9cb2c 100644 --- a/Build/VSIP/install.bat +++ b/Build/VSIP/install.bat @@ -30,12 +30,16 @@ xcopy /Y ..\..\source\Cosmos.Kernel.FileSystems\bin\debug\Cosmos.Sys.FileSystem. xcopy /Y ..\..\source2\VSIP\Cosmos.VS.Package\bin\debug\Cosmos.VS.Package.* . xcopy /Y ..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosProject.zip . +echo . +echo . +echo . echo Creating setup.exe +echo You will see an error about an invalid path. This is normal. REM Try one, then if not there the other for x64 "C:\Program Files\Inno Setup 5\ISCC" /Q ..\..\Setup2\Cosmos.iss "C:\Program Files (x86)\Inno Setup 5\ISCC" /Q ..\..\Setup2\Cosmos.iss ..\..\Setup2\Output\CosmosUserKit5.exe /SILENT - -pause \ No newline at end of file +rem Relaunch VS +..\..\source\Cosmos.sln diff --git a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnector.cs b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnector.cs index fce2a4fc4..b2171152f 100644 --- a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnector.cs +++ b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnector.cs @@ -16,6 +16,9 @@ namespace Cosmos.Debug.Common.CDebugger public Action CmdText; protected MsgType mCurrentMsgType; + + //TODO: Change all servers and clients to use this. Servers can start earlier, but this will wait for an inbound connection + public abstract void WaitConnect(); protected abstract void SendData(byte[] aBytes); protected abstract void Next(int aPacketSize, Action aCompleted); diff --git a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeClient.cs b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeClient.cs index eb7d44b48..9abf82c0b 100644 --- a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeClient.cs +++ b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeClient.cs @@ -10,10 +10,13 @@ namespace Cosmos.Debug.Common.CDebugger public class DebugConnectorPipeClient : DebugConnectorStream { public DebugConnectorPipeClient() { + } + + public override void WaitConnect() { NamedPipeClientStream xPipe = new NamedPipeClientStream("CosmosDebug"); + // No need to loop, this waits infinitely and can be called before server side is ready xPipe.Connect(); Start(xPipe); } - } } diff --git a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeServer.cs b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeServer.cs index d6587ffe9..ebe833de6 100644 --- a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeServer.cs +++ b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorPipeServer.cs @@ -21,5 +21,8 @@ namespace Cosmos.Debug.Common.CDebugger Start(xPipe); } + public override void WaitConnect() { + throw new NotImplementedException(); + } } } diff --git a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorSerial.cs b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorSerial.cs index 9631b7d00..10a66bdba 100644 --- a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorSerial.cs +++ b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorSerial.cs @@ -8,6 +8,7 @@ namespace Cosmos.Debug.Common.CDebugger { public class DebugConnectorSerial : DebugConnectorStream { private SerialPort mPort; + public DebugConnectorSerial(byte aPort) { // TODO: MtW - Make COM port configurable mPort = new SerialPort("COM" + aPort, 9600, Parity.None, 8, StopBits.One); @@ -15,5 +16,10 @@ namespace Cosmos.Debug.Common.CDebugger mPort.Open(); Start(mPort.BaseStream); } + + public override void WaitConnect() { + //TODO: Serial we cant detect connection, but we can wait for first byte... + throw new NotImplementedException(); + } } } diff --git a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPClient.cs b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPClient.cs index 5ab2ff4f4..ebc487513 100644 --- a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPClient.cs +++ b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPClient.cs @@ -14,5 +14,9 @@ namespace Cosmos.Debug.Common.CDebugger var xTCPClient = new TcpClient("localhost", 4444); Start(xTCPClient.GetStream()); } + + public override void WaitConnect() { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPServer.cs b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPServer.cs index c38af70b1..a76a740a6 100644 --- a/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPServer.cs +++ b/source2/Debug/Cosmos.Debug.Common/CDebugger/DebugConnectorTCPServer.cs @@ -21,8 +21,11 @@ namespace Cosmos.Debug.Common.CDebugger var xClient = xListener.EndAcceptTcpClient(aResult); Console.WriteLine("TcpClient accepted"); Start(xClient.GetStream()); - } - + + public override void WaitConnect() { + throw new NotImplementedException(); + } + } } diff --git a/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs b/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs index fa2a6eab2..db5c02aac 100644 --- a/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs +++ b/source2/Debug/Cosmos.Debug.VSDebugEngine/AD7.Impl/AD7Process.cs @@ -2,8 +2,8 @@ // In fact also eliminate TCP server and keep only Pipes // Keep a note about servers.. we want to use servers and not clients, because we dont always know when the other side is ready // and with a server, we are ready and its ready whenever... but sometime after us for sure. -#define DEBUG_CONNECTOR_TCP_SERVER -//#define DEBUG_CONNECTOR_PIPE_SERVER +//#define DEBUG_CONNECTOR_TCP_SERVER +#define DEBUG_CONNECTOR_PIPE_CLIENT // #define VM_QEMU //#define VM_VMWare @@ -45,7 +45,7 @@ namespace Cosmos.Debug.VSDebugEngine #if DEBUG_CONNECTOR_TCP_SERVER var xDebugConnectorStr = "-serial tcp:127.0.0.1:4444"; #endif -#if DEBUG_CONNECTOR_PIPE_SERVER +#if DEBUG_CONNECTOR_PIPE_CLIENT var xDebugConnectorStr = @"-serial pipe:CosmosDebug"; #endif // Start QEMU @@ -75,8 +75,8 @@ namespace Cosmos.Debug.VSDebugEngine #if DEBUG_CONNECTOR_TCP_SERVER mDebugEngine.DebugConnector = new Cosmos.Debug.Common.CDebugger.DebugConnectorTCPServer(); #endif -#if DEBUG_CONNECTOR_PIPE_SERVER - mDebugEngine.DebugConnector = new Cosmos.Debug.Common.CDebugger.DebugConnectorPipeServer(); +#if DEBUG_CONNECTOR_PIPE_CLIENT + mDebugEngine.DebugConnector = new Cosmos.Debug.Common.CDebugger.DebugConnectorPipeClient(); #endif mDebugEngine.TraceReceived += new Action(mDebugEngine_TraceReceived); mDebugEngine.TextReceived += new Action(mDebugEngine_TextReceived); @@ -103,8 +103,8 @@ namespace Cosmos.Debug.VSDebugEngine throw new Exception("Error while starting application"); } - //TODO: Change to pipe client only - // then we have to connect, wait, try again... then we know that the other side is ready... + // QEMU and Pipes - QEMU will stop and wait till we connect. It will not even show until we do. + mDebugEngine.DebugConnector.WaitConnect(); mCallback = aCallback; mEngine = aEngine;