From 8663f008a394294d225fa55ec1bdc4e9525959c6 Mon Sep 17 00:00:00 2001 From: hellwig Date: Fri, 30 Mar 2012 15:35:41 +0000 Subject: [PATCH] BochsController.cc is back git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1013 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- core/SAL/CMakeLists.txt | 22 ++++++---- .../{Controller.cc => BochsController.cc} | 0 core/experiments/hscsimple/experiment.cc | 42 ++++++++----------- 3 files changed, 33 insertions(+), 31 deletions(-) rename core/SAL/bochs/{Controller.cc => BochsController.cc} (100%) diff --git a/core/SAL/CMakeLists.txt b/core/SAL/CMakeLists.txt index aa153b74..02ae6fb5 100644 --- a/core/SAL/CMakeLists.txt +++ b/core/SAL/CMakeLists.txt @@ -1,10 +1,18 @@ -set(SRCS - Memory.cc - Register.cc - SimulatorController.cc - ${VARIANT}/Controller.cc -) +if(BUILD_BOCHS) + set(SRCS + Memory.cc + Register.cc + SimulatorController.cc + bochs/BochsController.cc + ) +else() + set(SRCS + Memory.cc + Register.cc + SimulatorController.cc + ${VARIANT}/Controller.cc + ) +endif(BUILD_BOCHS) add_library(SAL ${SRCS}) - diff --git a/core/SAL/bochs/Controller.cc b/core/SAL/bochs/BochsController.cc similarity index 100% rename from core/SAL/bochs/Controller.cc rename to core/SAL/bochs/BochsController.cc diff --git a/core/experiments/hscsimple/experiment.cc b/core/experiments/hscsimple/experiment.cc index c02d744a..c0017789 100644 --- a/core/experiments/hscsimple/experiment.cc +++ b/core/experiments/hscsimple/experiment.cc @@ -24,33 +24,27 @@ bool hscsimpleExperiment::run() // do funny things here... #if 1 // STEP 1 - fi::BPEvent mainbp(0x00003c34); - sal::simulator.addEventAndWait(&mainbp); - log << "breakpoint reached, saving" << endl; - sal::simulator.save("hello.state"); + //sal::simulator.dbgEnableInstrPtrOutput(500); + while(1){ + int j = 0; + for(j=0 ; j<=50 ; j++){ + cout << "durch" << endl; + fi::BPEvent mainbp(0x1045f5); + //fi::BPEvent mainbp(0x105bfa); + sal::simulator.addEventAndWait(&mainbp); + } + + int i; + for(i=0 ; i<= 0 ; i++){ + cout << "Interrupt wird ausgeloest" << endl; + //sleep(1); + sal::simulator.fireInterrupt(9); + } + } #elif 1 // STEP 2 - log << "restoring ..." << endl; - sal::simulator.restore("hello.state"); - log << "restored!" << endl; + sal::simulator.dbgEnableInstrPtrOutput(500); - log << "waiting for last square() instruction" << endl; - fi::BPEvent breakpoint(0x3c9e); // square(x) ret instruction - sal::simulator.addEventAndWait(&breakpoint); - log << "injecting hellish fault" << endl; -#if BX_SUPPORT_X86_64 - int reg = sal::RID_RAX; -#else - int reg = sal::RID_EAX; -#endif - sal::simulator.getRegisterManager().getRegister(reg)->setData(666); - log << "waiting for last main() instruction" << endl; - breakpoint.setWatchInstructionPointer(0x3c92); - sal::simulator.addEventAndWait(&breakpoint); - - log << "reached" << endl; - - sal::simulator.addEventAndWait(&breakpoint); #endif return true;