Sunday, October 19, 2014

Hello World Assembly Programming

; Macros used in NASM assembler
%define SYS_EXIT    1
%define SYS_READ    3
%define SYS_WRITE   4
%define STDOUT      1
%define STATUS      0
%define SYS_INTR    0x80

section .data
    hello: db 'Hello World!', 10 ;NOTE This 10 is for new line
    ;hello: db 'Hello World!'
    helloLen: equ $-hello           ;This will have the length of helloLen
                                    ; Note unlike "hello", helloLen is not an address; but value

section .text
    global _start

_start:
        ;Printing Hello World String.
        mov eax, SYS_WRITE
        mov ebx, STDOUT
        mov ecx, hello
        mov edx, helloLen
        int SYS_INTR

        ;Exit from main program
        mov eax, 1
        mov ebx, 0
        int SYS_INTR
        ret                 ; This will not get executed at all

Command to Assemble:

nasm -f elf hello.asm

Command to Link:
ld -s -o hello hello.o -m elf_i386 (Note elf_i386 denotes that this needs to be linked for 32 bit application)

Friday, October 10, 2014

DAS, NAS, SAN (FC & ISCSI & FCOE)

LINKS:
http://www.stonefly.com/resources/watch.asp?vid=FCoE-vs-iSCSI,-What%27s-The-Better-Choice-For-You#video


DAS:

SERVER-SERVER: 
PHYSICAL: ETHERNET
PROTOCOL: TCPIP
SERVER-STORAGE:
PHYSICAL: SCSI (SATA CARDS)
PROTOCOL: SCSI
CONS:
Free Storage in one server could not be shared with other


NAS:

SERVER-SERVER: 
PHYSICAL: ETHERNET
PROTOCOL: TCPIP
SERVER-STORAGE:
PHYSICAL: ETHERNET
PROTOCOL: TCPIP
PROS:
- Centralized Storage
- Sharable
- Data can be accessed as \\12.11.1.2\file_name (means, the server or host knows the storage is not Local)
CONS:
- File Level Transfer, hence slower
- Did support all applications (like mail exchange, database so on)
But now it supports all the applications



SAN (with FC):

SERVER-SERVER: 
PHYSICAL: ETHERNET
PROTOCOL: TCPIP
SERVER-STORAGE:
PHYSICAL: Fiber Channel
PROTOCOL: Fiber Channel
PROS:
- Centralized Storage
- Block Level Transfer
- Data can be accessed as D:\ (which means, the server assumes the storage is local BUT IT IS NOT)
CONS:
- High Cost
- New deployment needed server to have HBA (new PCI card)



SAN (with iSCSI):

SERVER-SERVER: 
PHYSICAL: ETHERNET
PROTOCOL: TCPIP
SERVER-STORAGE:
PHYSICAL: Ethernet
PROTOCOL: ISCSI (NOT TCPIP; and hence supports BLOCK_TRANSFER)
PROS:
- Centralized Storage
- Block Level Transfer
- No need for HBA
CONS:
- NO CONS IDENTIFIED AS OF NOW (IT IS TAKING OVER FC MARKET)



SAN (with FCOE):

SERVER-SERVER: 
PHYSICAL: ETHERNET
PROTOCOL: TCPIP
SERVER-STORAGE:
PHYSICAL: Ethernet
PROTOCOL: Fiber Channel (NOT TCPIP or ISCSI)
PROS:
- Centralized Storage
- Block Level Transfer
CONS:
- FCOE HBA Cards are needed for servers



Monday, May 12, 2014

Screen Command in Linux

screen:
=========
Ctrl-a c Create new window (shell)
Ctrl-a k Kill the current window (could be ctrl+a <shift k>)
Ctrl-a w List all windows (the current window is marked with "*")
Ctrl-a 0-9 Go to a window numbered 0-9
Ctrl-a n Go to the next window
Ctrl-a Ctrl-a Toggle between the current and previous window
Ctrl-a [ Start copy mode
Ctrl-a ] Paste copied text
Ctrl-a ? Help (display a list of commands)
Ctrl-a Ctrl-\ Quit screen
Ctrl-a D (Shift-d) Power detach and logout
Ctrl-a d Detach but keep shell window open
Ctrl-a Esc TO SCROLL THROUGH THE PREVIOUS BUFFERS (V V USEFUL)

References:
http://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/
http://aperiodic.net/screen/quick_reference