"GIT" What, how , ..etc ?

GIT ? “Git is distributed version control system focused on speed, effectivity and real-worldusability on large projects.” The above snip can be found here at “http://git-scm.com/about”… I dont know how many people are using “git” with their daily work.. But I know almost all open source projects are moving to “git” model Or almost done.. …

Read more

Install Fully virtualized guest on an ITANIUM system

To install a fully virtualized guest on an Itanium Red Hat Enterprise Linux system, first ensure that “xen-ia64-guest-firmware” package is installed on the host. After creating the guest, either through virt-manager or using virt-install, the guest will present an EFI shell. In order to begin the installation, enter mount fs0. This will make files available …

Read more

How can I increase a virtual image disk space if it is created on a file image

This is a very useful method in your real life.. I have come across to increase the space in virtual machine when it created on a file image .. You can try any of the below to increase the space depending on the virtual guest’s storage .. That being said , it is possible to …

Read more

Retrieving current process/task_struct in linux kernel

As you know, processes are represented in the kernel by a structure called ‘task_struct’. All the processes in kernel got its own kernel stack. There is also an important structure called “thread_info” which is of size “52” bytes. .. Where “task” field in the thread_info structure is the association of process descriptor with the thread_info. The “rsp” or “esp” ( stack pointers) can be effectively used by the kernel to retrieve information about the active process on the CPU.

struct thread_info { struct task_struct *task; /* main task structure */

*****

‘thread_info’ and the ‘stack’ is a union as shown below.

union thread_union { struct thread_info thread_info; unsigned long stack[THREAD_SIZE/sizeof(long)]; };


Where THREAD_SIZE is equal ( After macro filling) to ((_AC(1,UL) << 12) << 1) which is 8192 ( for 8k stack).

To get ‘current’ process information, the kernel makes use of below macro in an effective way.

movl $0xffffe000,%ecx /* or 0xfffff000 for 4KB stacks */ andl %esp,%ecx movl (%ecx),p

line number “2” performs the main operation here. The stack pointer “esp”‘s last “13” or “12” bits are masked ( 8k and 4k stacks effectively) to get the thread_info structure. The thread_info structure’s “0th” offset holds a pointer to the ‘task_struct’. Thus kernel can easily retrieve the currently running process (line 3) from the CPU.

The “current” variable in kernel code refers to this task_struct.

#define get_current() (current_thread_info()->task)

grep/display number of lines before and after matching a pattern

I know lots of people are looking for a command-line method on grepping a particular line and some lines BEFORE OR AFTER that pattern matched line…. There are atleast 2 ways which I know :).. Method 1 : using GREP I think it will be self explanatory by the below example… [hchiramm@hchiramm tmp]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0 …

Read more