[Gem 5] Recover ubuntu root password in Virtualbox (reset password trong ubuntu)

some how you get lost your password. Then, I can not remember what your password is. you can reset your password.

Step1: restart your ubuntu and hold shift key until the boot screen appears.

Step2: choose the generic second boot option

Step3: the new screen appears, choose "Drop into root shell prompt"

Step4: run below command:
           >> mount -rw -o remount /

Step5: run below command to create new root password
          >> sudo passwd root


If you see some error like:
passwd: Authentication token manipulation error
passwd: password unchanged

This means that you did not run the command at step 4. If so, try to run the command at step 4 and then command at step 5.

--
Lấy lại password trong ubuntu dùng virtualbox. Theo các bước ở trên

[gem5] How to install Cuda on ubuntu 14.04

Step 1: get the suitable cuda repo from https://developer.nvidia.com/cuda-downloads
    in this case, cuda for ubuntu 14.04 is fetched using below command:
      >> wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.0-28_amd64.deb

Step 2: get cuda and install:
    >> sudo dpkg -cuda-repo-ubuntu1404_7.0-28_amd64.deb

Step 3: install cuda tookit
    >> sudo apt-get install cuda

When you are done with installation, you should set the Cuda environment variable. It is better to place below commands into your .bashrc file in your home director

export CUDA_HOME=/usr/local/cuda-7.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64

PATH=${CUDA_HOME}/bin:${PATH}
export PATH 


---
Cách cài đặt Cuda trên ubuntu 14.04. Theo từng bước như ở trên.

[Gem 5] Steps to compile an ARM program, run execution program and stats output

Follow steps below:

Step 1: get the program ( queen.c program is used in this case )

[~/gem5]  wget https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_14/SingleSource/Benchmarks/McGill/queens.c

Step 2: compile the program, it is recommended to compile with static flag

[~/gem5]  arm-linux-gnueabi-gcc –DUNIX –o queens queens.c –static

Step 3:run program in SE mode

[~/gem5]  ./build/ARM/gem5.opt configs/example/se.py -c queens –o 16

Step 4: display statistics:
[~/gem5] cat m5out/stats.txt

[Gem5] Important Folders/Files in Gem5 source

From users perspective, it is not necessary to know all of source files in gem5. We just need to know some important folders/files which we will modify to fit our CPU architecture.

To me, the folder "configs" is important, we should dig into it first to see some examples of sample configurations and you can create a configurations for your own.

Below are some important folders/files which I think that we should know before we modify it to make our own CPU:

[Python] Inheritance

Python is an object-oriented programming language, so it also has inheritance, overloading, overriding, etc. Below is one of the simple examples of how inheritance is implemented in Python.

By looking at below example, it is easy to learn how a class inherits from other classes and how a class is declared, defined and used in Python.

--------------------------------
Python là một ngôn ngữ lập trình hướng đối tượng! bên dưới là một ví dụ đơn giản về tính thừa kế trong Python.

[Python] Small Python program applying Skeleton

This is an example of how to apply skeleton in the previous post.
This program is just the simplest calculator in the world. The purpose is just to prove how efficient to apply the skeleton into your project. It makes the project have a good look and well-organized.

--------------------
Chương trình máy tính python đơn giản. Cách áp dụng coding style ở bài trước
--------------------

[Python] Skeleton

A good programming habit is to have a skeleton for every new project. Below is a simple skeleton Python project which can be served as an entry point for a initial start of writing your own skeleton:

----------
Bộ khung mẫu của một chương trình trong python! Nó sẽ giúp ích trong việc tổ chức code
----------

import sys
def main():
    func1()
    func2()
    pass

def func1():
    # doing your work
    pass

def func2():
    # doing your work
    pass
    
if __name__ == '__main__':
    sys.exit(main())

[Gem5] GEM5 Installation on ubuntu 14

Just follow steps below:

step1: sudo apt-get update; sudo apt-get upgrade

step2: sudo apt-get install mercurial scons swig gcc m4 python python-dev libgoogle-perftools-dev g++

step 3: hg clone http://repo.gem5.org/gem5

step 4: cd gem5/

step5: scons build/ARM/gem5.opt -j2

step6: build/ARM/gem5.opt configs/example/se.py -c tests/test-progs/hello/bin/arm/linux/hel
­lo

Related Posts Plugin for WordPress, Blogger...