For Disk or any other peripheral device simulation/emulation, you need to look at the QEMU part of MARSS.
To handle all the IO emulation, CPU interrupts and other system parts except CPU, MARSS switches from PTLsim to QEMU. In simulation mode, after every runcycle (simulating one cpu cycle) it checks if there are any interrupts need to be handled or not. If it does then it 'returns' from the 'OOOcore::run()' function and switches to QEMU to handle all the interrupts. For the IO instructions like in/out , PTLsim uses 'l_assist' function in the pipeline to call 'helper_in*' or 'helper_out*' functions of QEMU to handle them. For data transfer, all DMA are handled by QEMU also. You can start with the 'qemu/hw/ide.h' and files in 'qemu/hw/ide' folder. - Avadh On Mon, Aug 23, 2010 at 6:14 AM, Sungchan Kim <[email protected]>wrote: > All, > Regarding the mail I sent as below, I forgot telling the location of the > code segments I'm asking about. > They appear in the later part of the function "bool > OutOfOrderCore::runcycle()" > Thanks. > > ---------- Forwarded message ---------- > From: Sungchan Kim <[email protected]> > Date: 2010/8/23 > Subject: Where can I hook hard disk I/O in PTLSIM? > To: [email protected] > > > All, > I'm trying to find an entry point of hard disk I/O in PTLSIM source tree. > Even though I haven't looked at the entire source codes fully, I found that > the following parts are visited when I do a file I/O. > > (in $MARSS/ptlsim/core/ooocore.cpp) > > .... > case COMMIT_RESULT_EXCEPTION: { > if (logable(3) && thread->current_basic_block && > thread->current_basic_block->rip) { > ptl_logfile << " [vcpu ", thread->ctx.cpu_index, "] in exception > handling at rip ", thread->current_basic_block->rip, endl, flush; > } > exiting = !thread->handle_exception(); > break; > } > .... > > Then, my question is whether all accesses to hard disk go through the above > code segments. > If not, can any one explain about the entry points for hooking hard disk > accesses? > Thanks. > > > > _______________________________________________ > http://www.marss86.org > Marss86-Devel mailing list > [email protected] > https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel > >
_______________________________________________ http://www.marss86.org Marss86-Devel mailing list [email protected] https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
