Saturday, May 28, 2011

How to install M5sim

M5 sim installation

1. nrs@nrs-OptiPlex-745:~$ sudo apt-get install g++ python-dev scons swig zlib1g-dev m4 mercurial patch subversion


2. hg clone http://repo.m5sim.org/m5

3. nrs@nrs-OptiPlex-745:~/m5$ scons build_opts/X86_SE/m5.opt
scons: Reading SConscript files ...

You're missing the M5 style hook.
Please install the hook so we can ensure that all code fits a common style.

All you'd need to do is add the following lines to your repository .hg/hgrc
or your personal .hgrc
----------------

[extensions]
style = ./util/style.py

[hooks]
pretxncommit.style = python:style.check_style
pre-qrefresh.style = python:style.check_style

4. The program 'style' is currently not installed.  You can install it by typing:
sudo apt-get install diction

during compilation  don't use sudo. Simply compile using scons in the given directory.

5. sudo apt-get install diction

6. scons build/ALPHA_FS/m5.debug

7. scons build/X86_FS/m5.debug

8. download the vmlinux files for the respective ISA

9. mkdir /dist/m5/system and extract the files there.

10. now for running the program use
cd ~/m5
sudo ./build/ALPHA_FS/m5.opt configs/example/fs.py

Monday, February 21, 2011

How to install R plot

Add the following line to /etc/sources.lst

deb http://cran.opensourceresources.org/bin/linux/ubuntu feisty/

or find the appropriate mirror from http://cran.r-project.org/mirrors.html and add replace the word cran.opensources.org




Wednesday, May 19, 2010

Command for varying RTT

tc qdisc add dev eth0 root netem delay 100

100 is in milli seconds

Friday, April 30, 2010

Finding the location of TCP variants in Linux kernel

nightfall:~# echo "westwood" > /proc/sys/net/ipv4/tcp_congestion_control 
nightfall:~# cat /proc/sys/net/ipv4/tcp_congestion_control 
westwood
nightfall:~# 
A list of available modules can be found here:
nightfall:~# ls /lib/modules/`uname -r`/kernel/net/ipv4/
ip_gre.ko  netfilter   tcp_cubic.ko      tcp_htcp.ko   tcp_lp.ko        tcp_vegas.ko
ipip.ko    tcp_bic.ko  tcp_highspeed.ko  tcp_hybla.ko  tcp_scalable.ko  tcp_veno.ko
nightfall:~# 

Thursday, February 11, 2010

How to solve undefined reference to `__umoddi3'

Problem faced:

kernel/built-in.o: In function `getnstimeofday':
(.text+0xee36): undefined reference to `__umoddi3'
kernel/built-in.o: In function `do_gettimeofday':
(.text+0xeee1): undefined reference to `__udivdi3'
kernel/built-in.o: In function `do_gettimeofday':
(.text+0xeefe): undefined reference to `__umoddi3'
kernel/built-in.o: In function `do_timer':
(.text+0xfd88): undefined reference to `__udivdi3'
kernel/built-in.o: In function `do_timer':
(.text+0xfda5): undefined reference to `__umoddi3'
make: *** [.tmp_vmlinux1] Error 1

Solution:


---
 include/linux/time.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/time.h b/include/linux/time.h
index 2091a19..d32ef0a 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -174,6 +174,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
 {
  ns += a->tv_nsec;
  while(unlikely(ns >= NSEC_PER_SEC)) {
+  /* The following asm() prevents the compiler from
+   * optimising this loop into a modulo operation.  */
+  asm("" : "+r"(ns));       // Include this line in the file /include/linux/time.h
+
   ns -= NSEC_PER_SEC;
   a->tv_sec++;
  }
-- 
This patch prevents gcc form "optimizing" the while loop into a costly modulo.
operation

Thursday, February 4, 2010

Setting and Removing http_proxy in linux

1. For setting http_proxy
                export http_proxy="http://proxy:port/"

2. For unsetting
                  unset http_proxy=""

Removing http_proxy [ 407 proxy authentication required ] when using synaptic package manager:

Do the following:
1. Remove proxy from Preferences -> Network proxy [ use direct connection ]
2. Remove proxy from synaptic package manager -> preferences -> Network
3. use unset http_proxy
4. export http_proxy=""
           check if proxy is set or not by using: echo $http_proxy
Repeat steps (3) and (4) for ftp proxy also.


5. immediately do apt-get update once or twice
6. If still you get error [407 proxy authentication required]

    goto ~/.bashrc check if http_proxy is set if so remove it.

Please also check if you have changed the file sources.list in /etc/apt folder. If so reverse it back to the old version.
Powered By Blogger