From Msim

Revision as of 23:24, 18 July 2010 by Jloew (Talk | contribs)
Jump to: navigation, search

This page refers to the changes made in the 3.0.19 release of M-sim.

Release Date:


File Table

  • On fork, standard IO entries were not copied to the child thread. This is fixed (see copy_from: cur_entry.reserved & FE_STANDARD_IO).
  • closing standard IO file descriptors is now allowed (see closer) as long as they aren't STDIN/STDOUT/STDERR that belong to the simulator.
  • The FD_CLOEXEC flag is now handled (which also handles fcntl::getfd and fcntl::setfd).
  • The method for getting the lowest available file descriptor terminated too early (and could result in duplicate simulated file descriptors).
  • The file table now handles the determination of terminal (tty) status.
  • dup and dup2 now copy the FE_STANDARD_IO flag (they probably shouldn't copy FD_CLOEXEC though).
  • insert now returns the file descriptor provided (it used to always give the same one as asked for but this isn't always possible).


  • ld_load_prog now returns an int (for errno or success). Programs that fail to launch through exec can still crash the simulator since exec flushes the memory pages too early. This will be fixed in a later release.
  • The reduced environment set is now oriented towards user msimuser. This provides a consistent environment to run bash through M-Sim as a user.
  • a passwd file is provided with msimuser as user 1000 (group 15)

Branch Prediction

  • A value for a branch misprediction penalty is added to cmp.h and utilized by rollbackTo to impose a misprediction penalty.


  • gpid and gid added. More will probably be added too.


  • FILE is now passed to all functions that output so that turning off the printout for power statistics actually works.


  • mmap now ensures that length is on a quad_word boundary.
  • updates to mmap to handle possible incomplete reads.

Process ID Handler

  • Calls to wait can now return ECHILD when appropriate.


  • -fastfwd 1 now properly uses the fast-forwarding value from the .arg file
  • The branch misprediction is now set using "-bpred:penalty" and for multicore "-bpred:penalty_<core_num>"
  • continue_fastfwd scans through all leftover contexts (to make to erase dead ones). Not doing this can cause deadlock in the fast-forward logic.



osf_sys_lseek does not return -1 when called on stdin, stdout or stderr on Tru64. Empirically, it appears to output the total number of characters printed for the current session.

#include <sys/types.h>
#include <unistd.h>
#include <iostream>

int main()
       cout << "Weeee!" << endl;
       for(int i=0;i<10;i++)
               off_t sval = lseek(i,0,1);
               cout << i << ":  " << sval << endl;
       return 0;

On a new session:

jloew@tru64:~/syscall$ ./a.out
0:  722
1:  730
2:  738
3:  -1
4:  -1
5:  -1
6:  -1
7:  -1
8:  -1
9:  -1

Second execution:

jloew@tru64:~/syscall$ ./a.out
0:  864
1:  872
2:  880
3:  -1
4:  -1
5:  -1
6:  -1
7:  -1
8:  -1
9:  -1

The difference is consistent (typing into the command prompt and deleting it will increase this counter).

Personal tools