This commit is contained in:
kudzu_cp 2010-04-11 16:50:29 +00:00
parent 142cb720b2
commit 5dbba72eef
10 changed files with 46 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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
rem Relaunch VS
..\..\source\Cosmos.sln

View file

@ -16,6 +16,9 @@ namespace Cosmos.Debug.Common.CDebugger
public Action<string> 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<byte[]> aCompleted);

View file

@ -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);
}
}
}

View file

@ -21,5 +21,8 @@ namespace Cosmos.Debug.Common.CDebugger
Start(xPipe);
}
public override void WaitConnect() {
throw new NotImplementedException();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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<Cosmos.Compiler.Debug.MsgType, uint>(mDebugEngine_TraceReceived);
mDebugEngine.TextReceived += new Action<string>(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;