diff --git a/reactos/tools/sysreg/os_support.cpp b/reactos/tools/sysreg/os_support.cpp index 13828e866b6..15fa570995d 100644 --- a/reactos/tools/sysreg/os_support.cpp +++ b/reactos/tools/sysreg/os_support.cpp @@ -57,7 +57,7 @@ namespace System_ free(command); return pid; } -#elif defined (__LINUX__) +#else /********************************************************************************************************************/ OsSupport::ProcessID OsSupport::createProcess(TCHAR *procname, int procargsnum, TCHAR **procargs) { @@ -66,11 +66,24 @@ namespace System_ 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 } // end of namespace System_ diff --git a/reactos/tools/sysreg/os_support.h b/reactos/tools/sysreg/os_support.h index 3f63ae47b9a..af046f6756f 100644 --- a/reactos/tools/sysreg/os_support.h +++ b/reactos/tools/sysreg/os_support.h @@ -10,10 +10,12 @@ * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) */ -#ifdef WIN32 +#if 0 #include -#elif defined(__LINUX__) +#else #include +#include +#include #endif #include "user_types.h" @@ -34,14 +36,10 @@ namespace System_ #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 //--------------------------------------------------------------------------------------- /// diff --git a/reactos/tools/sysreg/pipe_reader.cpp b/reactos/tools/sysreg/pipe_reader.cpp index 8e7d5883aec..88de72e3a34 100644 --- a/reactos/tools/sysreg/pipe_reader.cpp +++ b/reactos/tools/sysreg/pipe_reader.cpp @@ -36,7 +36,7 @@ namespace System_ 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 @@ namespace System_ return false; } - int res = _pclose(m_File); + int res = pclose(m_File); if (res == INT_MAX) { diff --git a/reactos/tools/sysreg/rosboot_test.cpp b/reactos/tools/sysreg/rosboot_test.cpp index c6dd8aa562b..19f0326f342 100644 --- a/reactos/tools/sysreg/rosboot_test.cpp +++ b/reactos/tools/sysreg/rosboot_test.cpp @@ -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 #include #include +#include - + 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 @@ namespace Sysreg_ { 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 @@ namespace Sysreg_ /// string result; result.reserve (200); - +#if 0 SymbolFile::resolveAddress (modulename, address, result); cerr << result << endl; - +#endif /// /// TODO /// @@ -338,17 +342,18 @@ namespace Sysreg_ //--------------------------------------------------------------------------------------- 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 @@ namespace Sysreg_ /// 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 @@ namespace Sysreg_ string Buffer; Buffer.reserve (500); - bool ret = true; vector vect; size_t lines = 0; bool write_log; @@ -436,7 +440,7 @@ namespace Sysreg_ } _sleep(3* CLOCKS_PER_SEC); OsSupport::terminateProcess (pid); - +#endif return ret; } //--------------------------------------------------------------------------------------- @@ -457,7 +461,7 @@ namespace Sysreg_ /// 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; diff --git a/reactos/tools/sysreg/sysreg.cpp b/reactos/tools/sysreg/sysreg.cpp index e36c2e4ef2c..0d4fde4ed9e 100644 --- a/reactos/tools/sysreg/sysreg.cpp +++ b/reactos/tools/sysreg/sysreg.cpp @@ -20,7 +20,9 @@ using Sysreg_::ConfigParser; using Sysreg_::RegressionTest; using Sysreg_::RosBootTest; +#if 0 using System_::SymbolFile; +#endif typedef ComponentFactoryTemplate ComponentFactory; @@ -87,9 +89,9 @@ int _tmain(int argc, TCHAR * argv[]) 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; diff --git a/reactos/tools/sysreg/sysreg.mak b/reactos/tools/sysreg/sysreg.mak index 3fcc89ab7cd..ee36f7f1dcc 100644 --- a/reactos/tools/sysreg/sysreg.mak +++ b/reactos/tools/sysreg/sysreg.mak @@ -22,9 +22,7 @@ SYSREGBUILD_SOURCES = $(addprefix $(SYSREGBUILD_BASE_),\ 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 \ diff --git a/reactos/tools/sysreg/txtmode.cfg b/reactos/tools/sysreg/txtmode.cfg index b13639118e3..672ff7da0f7 100644 --- a/reactos/tools/sysreg/txtmode.cfg +++ b/reactos/tools/sysreg/txtmode.cfg @@ -27,7 +27,9 @@ ROS_ADDR2LINE=addr2line.exe --exe= ; 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 @@ ROSBOOT_PID_FILE=pid.txt ; 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 @@ ROSBOOT_DEBUG_PORT=pipe ; 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 @@ ROSBOOT_TIME_OUT=180.0 ; ; 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_CHECK_POINT=USETUP_COMPLETE 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 \ No newline at end of file