Author: janderwald
Date: Sat Jan 13 15:19:56 2007
New Revision: 25437
URL:
http://svn.reactos.org/svn/reactos?rev=25437&view=rev
Log:
- make sysreg compilable under Linux
- sysreg is now able to start the emulator but it cannot get any debug data yet. But this
might be due that i tested sysreg in linux under vmware which then ran qemu....
Modified:
trunk/reactos/tools/sysreg/os_support.cpp
trunk/reactos/tools/sysreg/os_support.h
trunk/reactos/tools/sysreg/pipe_reader.cpp
trunk/reactos/tools/sysreg/rosboot_test.cpp
trunk/reactos/tools/sysreg/sysreg.cpp
trunk/reactos/tools/sysreg/sysreg.mak
trunk/reactos/tools/sysreg/txtmode.cfg
Modified: trunk/reactos/tools/sysreg/os_support.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/os_support.cp…
==============================================================================
--- trunk/reactos/tools/sysreg/os_support.cpp (original)
+++ trunk/reactos/tools/sysreg/os_support.cpp Sat Jan 13 15:19:56 2007
@@ -57,7 +57,7 @@
free(command);
return pid;
}
-#elif defined (__LINUX__)
+#else
/********************************************************************************************************************/
OsSupport::ProcessID OsSupport::createProcess(TCHAR *procname, int procargsnum,
TCHAR **procargs)
{
@@ -66,10 +66,23 @@
if ((pid = fork()) < 0)
{
cerr << "OsSupport::createProcess> fork failed"
<< endl;
- return pid;
+ return 0;
}
+ if (pid == 0)
+ {
+ execv(procname, procargs);
+ return 0;
+ }
+
+ return pid;
+ }
+ bool OsSupport::terminateProcess(OsSupport::ProcessID pid)
+ {
+ kill(pid, SIGKILL);
+ return true;
}
+
#endif
Modified: trunk/reactos/tools/sysreg/os_support.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/os_support.h?…
==============================================================================
--- trunk/reactos/tools/sysreg/os_support.h (original)
+++ trunk/reactos/tools/sysreg/os_support.h Sat Jan 13 15:19:56 2007
@@ -10,10 +10,12 @@
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at)
*/
-#ifdef WIN32
+#if 0
#include <windows.h>
-#elif defined(__LINUX__)
+#else
#include <unistd.h>
+#include <sys/types.h>
+#include <signal.h>
#endif
#include "user_types.h"
@@ -34,14 +36,10 @@
#ifdef WIN32
typedef DWORD ProcessID;
-
-#elif defined(__LINUX__)
+#else
typedef pid_t ProcessID;
-
-#else
-#error you need to define pid handle type for your platform
-#endif
+ #endif
//---------------------------------------------------------------------------------------
///
Modified: trunk/reactos/tools/sysreg/pipe_reader.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/pipe_reader.c…
==============================================================================
--- trunk/reactos/tools/sysreg/pipe_reader.cpp (original)
+++ trunk/reactos/tools/sysreg/pipe_reader.cpp Sat Jan 13 15:19:56 2007
@@ -36,7 +36,7 @@
return false;
}
//
- m_File = _tpopen(PipeCmd.c_str(), AccessMode.c_str());
+ m_File = popen(PipeCmd.c_str(), "r"); //AccessMode.c_str());
if (m_File)
{
cerr << "PipeReader::openPipe> successfully opened
pipe" << endl;
@@ -57,7 +57,7 @@
return false;
}
- int res = _pclose(m_File);
+ int res = pclose(m_File);
if (res == INT_MAX)
{
Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
==============================================================================
--- trunk/reactos/tools/sysreg/rosboot_test.cpp (original)
+++ trunk/reactos/tools/sysreg/rosboot_test.cpp Sat Jan 13 15:19:56 2007
@@ -11,8 +11,8 @@
#include "rosboot_test.h"
#include "pipe_reader.h"
-#include "namedpipe_reader.h"
-#include "sym_file.h"
+//#include "namedpipe_reader.h"
+//#include "sym_file.h"
#include "file_reader.h"
#include "os_support.h"
@@ -24,14 +24,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include <math.h>
-
+
namespace Sysreg_
{
using std::vector;
using System_::PipeReader;
+#if 0
using System_::NamedPipeReader;
using System_::SymbolFile;
+#endif
using System_::FileReader;
using System_::OsSupport;
@@ -93,7 +96,8 @@
{
TCHAR * stop;
m_Timeout = _tcstod(timeout.c_str (), &stop);
- if (_isnan(m_Timeout) || m_Timeout == 0.0)
+
+ if (isnan(m_Timeout) || m_Timeout == 0.0)
{
cerr << "Warning: overriding timeout with
default of 60 sec" << endl;
m_Timeout = 60.0;
@@ -289,10 +293,10 @@
///
string result;
result.reserve (200);
-
+#if 0
SymbolFile::resolveAddress (modulename, address, result);
cerr << result << endl;
-
+#endif
///
/// TODO
///
@@ -338,17 +342,18 @@
//---------------------------------------------------------------------------------------
bool RosBootTest::fetchDebugByPipe(string boot_cmd)
{
- NamedPipeReader namedpipe_reader;
string pipecmd = _T("");
+ bool ret = true;
///
/// FIXME
/// split up arguments
OsSupport::ProcessID pid = OsSupport::createProcess
((TCHAR*)boot_cmd.c_str (), 0, NULL);
-
+#if 0
string::size_type pipe_pos = boot_cmd.find (_T("serial pipe:"));
+ NamedPipeReader namedpipe_reader;
if (pipe_pos != string::npos)
{
pipe_pos += 12;
@@ -371,7 +376,7 @@
/// delay reading until emulator is ready
///
- _sleep( (clock_t)m_Delayread * CLOCKS_PER_SEC );
+ sleep( (clock_t)m_Delayread * CLOCKS_PER_SEC );
}
if (!namedpipe_reader.openPipe(pipecmd))
@@ -382,7 +387,6 @@
string Buffer;
Buffer.reserve (500);
- bool ret = true;
vector<string> vect;
size_t lines = 0;
bool write_log;
@@ -436,7 +440,7 @@
}
_sleep(3* CLOCKS_PER_SEC);
OsSupport::terminateProcess (pid);
-
+#endif
return ret;
}
//---------------------------------------------------------------------------------------
@@ -457,7 +461,7 @@
/// delay reading until emulator is ready
///
- _sleep( (clock_t)m_Delayread * CLOCKS_PER_SEC );
+ sleep( (clock_t)m_Delayread * CLOCKS_PER_SEC );
}
OsSupport::ProcessID pid = 0;
Modified: trunk/reactos/tools/sysreg/sysreg.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sysreg.cpp?re…
==============================================================================
--- trunk/reactos/tools/sysreg/sysreg.cpp (original)
+++ trunk/reactos/tools/sysreg/sysreg.cpp Sat Jan 13 15:19:56 2007
@@ -20,7 +20,9 @@
using Sysreg_::RegressionTest;
using Sysreg_::RosBootTest;
+#if 0
using System_::SymbolFile;
+#endif
typedef ComponentFactoryTemplate<RegressionTest, string> ComponentFactory;
@@ -87,9 +89,9 @@
string envvar;
string ros = _T("ROS_OUTPUT");
config.getStringValue (ros, envvar);
-
+#if 0
SymbolFile::initialize (config, envvar);
-
+#endif
if (regtest->execute (config))
{
cout << "The regression test " <<
regtest->getName () << " completed successfully" << endl;
Modified: trunk/reactos/tools/sysreg/sysreg.mak
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/sysreg.mak?re…
==============================================================================
--- trunk/reactos/tools/sysreg/sysreg.mak (original)
+++ trunk/reactos/tools/sysreg/sysreg.mak Sat Jan 13 15:19:56 2007
@@ -22,9 +22,7 @@
conf_parser.cpp \
env_var.cpp \
pipe_reader.cpp \
- namedpipe_reader.cpp \
rosboot_test.cpp \
- sym_file.cpp \
sysreg.cpp \
file_reader.cpp \
os_support.cpp \
Modified: trunk/reactos/tools/sysreg/txtmode.cfg
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/txtmode.cfg?r…
==============================================================================
--- trunk/reactos/tools/sysreg/txtmode.cfg (original)
+++ trunk/reactos/tools/sysreg/txtmode.cfg Sat Jan 13 15:19:56 2007
@@ -27,7 +27,9 @@
; This value is the command which is executed to gain debugging data
; this value is mandatory
-ROSBOOT_CMD=D:\reactos\qemu\qemu.exe -serial pipe:qemu -boot d -m 128 -L D:\reactos\qemu\
D:\reactos\RosVM.vmdk -cdrom D:\Reactos\ReactOS-RegTest.iso -pidfile pid.txt
+;ROSBOOT_CMD=D:\reactos\qemu\qemu.exe -serial pipe:qemu -boot d -m 128 -L
D:\reactos\qemu\ D:\reactos\RosVM.vmdk -cdrom ; D:\Reactos\ReactOS-RegTest.iso -pidfile
pid.txt
+
+ROSBOOT_CMD=/usr/bin/qemu -serial file:/home/freenet/reactos/tools/sysreg/txtmode.log
-boot d -m 64 -L /home/freenet/reactos/qemu /home/freenet/reactos/qemu/c.img -cdrom
/home/freenet/reactos/ReactOS.iso
;
; ROSBOOT_PIDFILE
@@ -47,8 +49,8 @@
; If the value is set to pipe, then sysreg will read from pipe created by the
; ROSBOOT_CMD
;
-;ROSBOOT_DEBUG_PORT=file
-ROSBOOT_DEBUG_PORT=pipe
+ROSBOOT_DEBUG_PORT=file
+;ROSBOOT_DEBUG_PORT=pipe
;
; ROSBOOT_DEBUG_FILE
@@ -60,7 +62,8 @@
; debug data to the specified debug file
;
-ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\txtmode.log
+;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\txtmode.log
+ROSBOOT_DEBUG_FILE=/home/freenet/reactos/tools/sysreg/txtmode.log
; ROSBOOT_DELAY_READ;
;
@@ -94,9 +97,9 @@
;
; CP_NAME is the value of the ROSBOOT_CHECK_POINT variable
-ROSBOOT_CHECK_POINT=USETUP_COMPLETE
-;ROSBOOT_CHECK_POINT=SYSSETUP_COMPLETE
-;ROSBOOT_CHECK_POINT=THIRDBOOT_COMPLETE
+;ROSBOOT_CHECK_POINT=USETUP_COMPLETE
+ROSBOOT_CHECK_POINT=SYSSETUP_COMPLETE
+ROSBOOT_CHECK_POINT=THIRDBOOT_COMPLETE
; ROSBOOT_CRITICAL_APP
;
@@ -114,5 +117,4 @@
ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe
-;ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe
lsass.exe
-
+;ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe
lsass.exe