Hi Jasmin,

In full-system mode, gem5 runs a full operating system and all software.It
is analogous to a pure virtualization platform. In full-system mode, gem5
must model all devices, etc. that the OS expects to interact with.
This is in comparison to syscall-emulation mode. In SE mode, gem5 only
executes user-mode code. All OS system calls are routed into the simulator
and are *emulated*.

To answer your questions:
   - Is it possible to reason wether an instruction is user
instruction or kernel
instruction?
Yes and no. No, there is no simple function to call to see if you are
currently running in kernel or user mode. However, depending on your kernel
/ OS certain PC addresses represent kernel vs user-mode code. Additionally,
you could watch what mode the CPU is in (ring-0 vs ring-3, etc), depending
on the architecture.

   - Can we know to which process is an instruction belongs inside of the
 OS?
This is a little more tricky, but it may be possible based on the physical
address of the PC and using OS interfaces (e.g., /proc on Linux).

   - How is memory mapped to OS processes?
Again, this is tricky, but may be possible with introspection into /proc or
something similar.

Overall, I believe something may exist that does what you're trying to do.
There was a presentation a few years ago at the gem5 users workshop that
did some of these things. See the PDF here:
http://gem5.org/wiki/images/9/9f/2012_12_01_gem5_workshop_Streamline.pdf. I
don't know what the current state of that project is. You may want to
contact the author directly.

Hope this helps!

Jason

On Wed, Aug 31, 2016 at 6:28 AM Jasmin Jahic <[email protected]> wrote:

> Hello,
>
> I will try to refine my last question a bit. In the gem5 full system mode;
>
>    - Is it possible to reason wether an instruction is user instruction or
>    kernel instruction?
>    - Can we know to which process is an instruction belongs inside of the
>    OS?
>    - How is memory mapped to OS processes?
>
> I hope that someone has some knowledge about the questions above. If yes,
> they would help a lot.
>
> Best regards,
> Jasmin
>
>
> On Tue, Aug 30, 2016 at 6:22 PM, Stine, James <[email protected]>
> wrote:
>
> > Many apologies - my email got corrupted.  Please ignore last Email.
> >
> > James
> >
> > > On Aug 30, 2016, at 11:21 AM, Stine, James <[email protected]>
> > wrote:
> > >
> > > I can make smaller if you want..  Let me know if not what you need or
> > want.  Thanks for letting me know!  Take care.
> > >
> > > J
> > >
> > > <Memo_to_OSU_Faculty_SHPE.pdf>
> > >
> > >
> > >> On Aug 30, 2016, at 11:18 AM, Jasmin Jahic <[email protected]>
> > wrote:
> > >>
> > >> Hello,
> > >>
> > >> I have one question regarding the architecture of gem5 and I hope that
> > you
> > >> can help me. I am interested where gem5 in Full system mode ends and
> > where
> > >> the OS is completely taking over?
> > >>
> > >> For example, can I influence scheduling of the tasks by modifying the
> > gem5
> > >> code directly, or is the gem5 simply running the OS as any other
> > program?
> > >>
> > >> Another example, from the OS's console I can start a simple binary.
> Can
> > I
> > >> modify the code to load a binary or is that handled completely through
> > the
> > >> OS, and gem5 cannot distinguish between instructions coming from the
> OS
> > or
> > >> other process and the regular binary I would run from the console?
> > >>
> > >> Best regards,
> > >> Jasmin
> > >> _______________________________________________
> > >> gem5-dev mailing list
> > >> [email protected]
> > >> http://m5sim.org/mailman/listinfo/gem5-dev
> > >
> >
> > _______________________________________________
> > gem5-dev mailing list
> > [email protected]
> > http://m5sim.org/mailman/listinfo/gem5-dev
> >
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to