存档

‘科技’ 分类的存档

BMC and Winbond chips

2007年10月28日 没有评论

SS2280, implemented with Intel Woodcrest Dual-Core processor: enhance server visualization, faster networking. The dual core technology improves significiently the computing speed by running applications in parrellel, instead one stage each time and more to the next in line.

North bridge: Intel Blackford North Bridge. (BNB)
South bridge: ESB2E, Enterprise South Bridge 2.
PHY: Physical Layer Transceiver.
OOB: Out of Bond
VRD: Voltage Regular Down
SDR: Sensor Data Repository

The most advanced management controller, “Server Engine Pilot”, which combines baseboad management controller and graphics controller into one single chip. Such technology lowers down not only the cost, making you budget more economy, but also minimize the space of board. This chip features its enhanced performance on remote management through web service. The KVM, USB storage can also be included in the domain of remote control.

There’s something wrong with the BMC chip in last Monday, as we can not access its web service while ping is OK. Even restart the server, the BMC was not found. Later I fixed this issue by plugging out the power cable, wait for about 30 seconds, and then start up. The support engineer of SS2280 doubled it was a single failure, and suggested me to verify the following 4 servers coming in this week.

BMC monitors the fan speed according to the temperature the sensors have detected and make an appropriate adjustment and management. BMC is also responsible for monitoring of power unit through the way of checking events via SMBus. There’s anther chipset called Winbond 83627HG-AW embedded in baseboard, that also has monitoring functions. The support engineer told me it is BMC to monitor the system environment, not Winbond chips.

In the early test, I installed CentOS 4.4 with lm_sensor packages on SS2280, and then executing “sensor_detect” command detected three sensor on the board: BMC, Winbond83627HF and i2c. “sensor” command returned wired datas about all monitored elements. At first, I want to get the correct data by following up Winbond83627HF, but can not find the related driver. The support engineer gave me the hints that OpenIPMI is the default package of Linux. Then I installed this package, and using its command “ipmitool sensor” to get appropriate contents about environment. OpenIPMI provides virtual power function, that maybe useful for our BA880 to replace the physical fenced device(APC). I will study OpenIPMI in the following weeks.

分类: 科技 标签:

He who does not advance falls backward

2007年10月24日 没有评论

I must keep up writing working blog here, for colloecting the knowledge and working status. In the last two months, I am effected by some private things, and even I can not put all my heart on the current researching working in UIT. Only studing ONStor products and creating a report was praised and senseful. However, I do not show my 100% energy. It’s a shame that I feel I did not do my best, and I must do something and set new goals. First, I will study deeply about NAS products in the market,and then learn from them to apply in our BA880 series. Second, preparing for CCNA exam is obviously benifit to my tech career.

In the following two weeks, I am going to research on OpenIPMI and the Virtual Power. If Virtual Power is available in the lab, it would change the future BA880 architecture, that means the NAS gateway does not need APC device.

He who does not advance falls backward. Forza, Phillip.

分类: 科技 标签:

CCNA Exam

2007年10月23日 没有评论

Prepare for CCNA Exam(update version).

分类: 科技 标签:

Network camera

2007年9月12日 没有评论

Input the below strings in google, it is very interesting.

inurl:”viewerframe?mode=”

分类: 科技 标签:

Specifiers and Function

2007年8月27日 没有评论

If they limit the scope of their variable to their pieces of code, they do not have to worry about conflicting with variales of the same name used by ohters in other parts of the program. In C, you can declare a variable and indicate its visiblity level by designing its scope. Thus, variables with local scope can only be accessed with the block in which they are declared.

1.Block scope
In this section, a block refers to any sets of statements enclosed in braces. A variable declared within block has block scope. Thus, the variable is active and accessiable from the declaration point to the end of the block. Sometimes, block scope is also called local scope. Usually, a variable with block scope is called a local variable.

2.Nested block size
If a variable declared in the outer block shares the same name with one of the variables in the inner block, the variable within the outer block is hidden by the one within the inner block for the scope of the inner block.

3.Program scope
A variable is said to have program scope when it is declared outside a function. Here variable with program scope and also called global variables, which are visiable among different files.

Since a global variable is visible among different source file of a program, using global variable increases your program’s complexity, which in turn makes your program hard to maintain or debug. It’s not recommended that you declare and are global variables unless it’s very necessary. For instance, you can declare a global variable whose value is used but never changed by several subroutines in your program(use #define directive to define constants that are used in many places in a program).

4.File scope
The program file that contains the source code.

Auto specifier:
A variable’s reserved space in the memory can be erased or relocated when the variable is out of its scope.

Static specifier:
Permanent duration, in other words, the memory storage allocated for the variabl is exited, the value of the variable is maintained outside the scope, and if execution even returns to the scope of the variable, the last stored in the variable is still there.

The register specifer:
In CPU, it’s much quicker to access a register than a memory location. Therebefore, storing variables in register may help to speed up your program. The C language provides you with the register specifer. You can apply this specifer to variables when you think it’s necessary to put the variable into the computer registers. However, the register specifier only gives the compiler a suggestion. In other words, a variable specifierd by the register keyword is not guaranteed to be stored in a register. The compiler can ignore the suggestion if there is no register available, if some other restrictions have to apply.

It is illegal to take the address of a variable that is declared with register specifier because the variable is intended to be stored in a register, not in memory.

Extern specifer:
How can a global variable declare in file A, for instance, be seen in file B? In other words, how does the compiler know the variable used in file B is actually the same variable in file A?
The answer is : Use the extern specifier provided by the C language to allude to a global variable defined elsewhere. In this case, we declare a global variable in file A, and then declare the variable again using the exterm specifier in file B.

To make your program portable across different computer platforms, you can apply the following rules in your program when you declare or allude to a global variables:
1. Ignore the extern specififer, but include an initialize when you declare a global variable.
2. Use extern specifier without an initializer.

Storage class modifiers, used to indicate to C compiler how variable many be accessed.
1.The const modifier:
The content of the variable can not be changed after it is initialized. eg:
char const *ptr_str = “hello”;
2.Volatile modifer, content can be changed without any explicite assignment statement. Ask compiler to turn off certain optimizations on a variables, can declare with valatile specifier.

A function can be declared to return any data type, except an array or function. The return statement used in a function definition returns a single value whose type should match the one declared in the function declaration. By default, the return type of a function is int, if no explicit data is specifier for the function.

syntax:
data-type-specifier function-name()
Here data-type-specifer indicates the data type that the function should return.

Function prototype(with ANSI standard, the number and types fo arguments passed to a function are allowed to be added into the function declaration). The number and types of an argument are called the function prototype.

The purpose of using a function prototype is to help the compiler check whether the data types of arguments passwd to a function match what function expects. The compiler issues an error message if the data types do not match.

“void” is used in the declaration to indicate to the compiler that no argument is needed by this function.

time() return calendar time(current data and time).
locatetime(), local time converted from calendar time
asctime: convert the date and time represented by the structure tm.

vg_start, vg_arg, vg_end.
vg_arg: use to get the next argument passed to the function.

分类: 科技 标签:

array and string

2007年8月24日 没有评论

In many cases, you need to declare a set of variables that are of the same data type. Instead of declaring each variable separately, you can declare all hte variables collectively in the format fo an array. Each variable, as an element fo the array, can be accessed either through the array reference or through a pointer that references the array.

An array consists of consecutive memory locations.
datatype Array_Name[Array-Size];
The total bytes of the array:
sizeof(data-type)* Array-size;
Or sizeof(Array_Name);

A character string is actually a character array ended with a null character

分类: 科技 标签:

Pointer

2007年8月23日 没有评论

The duties of the pointer were to point out, by calling their names, those in the congregation who should take note of some point made in the sermon.

What is a pointer?

A pointer is a variable whose value is used to point to another variable. From the definition, you know two things: first, that a pointer is a variable, so you can assign different values to a pointer and second, that the values contained by a pointer must be an address that indicates the location of another variable in the memory. That’s why a pointer is also called an address variable.

Address(Left Value) versus Contents(Right Value)
Each memory location must have a unique address so that the computer can read from or write to the memory location without any confusion. This is similar to the concept that each house in a city must have a unique address. Right value, can be thought as a letter deliveved to the mailbox.

Note, when your C program is being compiled, and a value is being assigned to a variable, the C compiler has to check the left value of the variable. If the compiler cannot find the left value, if will issue an error message saying that the variable is undefined in your program. That’s why in C, you have to declare a variable before you can use it.

The Address-of operator: &
Return the address(that is, the left value) of a variable.
eg: long int x,y;
y = &x;
assignes the address of the x to the address variable y.

The format specifier %p is used in the printf() funtion for displaying the address.(Hexadecimal Format)

Declare Pointers
A pointer is a variable, which means that a pointer has a left value and right value as well. However, both the left and right values are addresses. The left value of a pointer is used to refer to the pointer itself, whereas the right value of a pointer, which is the content of the pointer, is the address of another variable.

The general form of a pointer declaration:
data-type *pointer-name
data-type specifies the type of data to which the pointer points.
pointer-name is the name of the pointer variable.
asterisk indicates the variable is a pointer, is called dereference operator(indirection operator).

Null pointer, a pointer is said to be a null pointer when its right value is 0. Remember, a null pointer can never point to valid data. Simply assign 0 to the pointer value. eg: ptr_c = 0

Pointing to the same thing: a memory location can be pointed by more than one pointer.
eg: ptr_c1 = &c; ptr_c2 = &c;
Point to the same location in the memory.

Pointer and Guidepost:
Memory — City
Pointer — Guidepost
Pointer variable Left Value — The position of Guidepost in the city
Pointer variable Right Value — The text on the Guidepost, which is somebody’s home address
Null Pointer: Set Pointer variable Right Value as 0, means no content on the Guidepost, as empty.
Multiple Pointers: Many Guideposts are mapping to the same home address.
*Pointer — People who lives in the house that is indicated on the Guidepost.
data-type *Pointer — What’s kind of people?

分类: 科技 标签:

Control Flow and Char type

2007年8月23日 没有评论

Condition branching(or jumping), loop category are both used for controlling flow.

if syntax:
if(expression){
statement1;
statement2;
}

else if(expression){
statement1;
statement2;
}
else{
statement1;
statement2;
}

Here expression is the condition criterion. If the expression is logical TRUE(nonzero), the statements inside the braces, are executed. If the expression is logical FALSE(zero), then the statements are skipped. Note, that the braces form a block of statements that is under the control of the if statement. If there is only one statement inside the block, the braces can be ignored. The parentness, however, must always be used to closed the condition expression. For instance:
if(x>0)
printf(“x>0n”);

The general form of the switch statement is:
switch(expression){
case expression1:
statement1;
break; //break is optional
case expression2:
statement2;
break;
default:
statement-default;
break;
}

When there’s no break, this is important feature of the switch statement. The computer continutes to execute the statements following the selected case until the end of the switch statement. If the return value of expression is equal to the constant expression expression1, the statement statement1 is executed. If however, the value of expression is not equal to any value of the constante expressions labeled by the case word, the statement-default key word is executed.

Add a break statement at the end of the statement list following every case label, if you want to exit the switch constant after the statements within a selected cases are executed.

The continute statement: Instead of breaking loop, there’re timeswhen you want to stay in a loop but skip over some statements within the loop. The continute statement causes execution to jump to the top of the loop immediately. Be aware to use this statement, as well as the break statement, may make your program hard to debug.

Goto is not recommended because it may cause your program to be unreliable and hard to debug.

The char Data Type:
An object of the char data type represents a single character of the character set used by your computer. But a computer can only store numeric code. Therebefor, characters such as A,a,B,b and so on all have a unique numeric code that is used by computers to represent the characters. Usually, a character takes 8 bits to store its numeric code.

For many computers, the ASCII code are the standard codes to represent a character set. ASCII, stands for American Standard Code for Information Interchange). The original ASCII character has set only 128 characters because it was the lower 7 bits that can be represent 2**7(128) characters. On IBM-compatible PCs, the character set is extended to contain a total of 2**8=256 characters.

分类: 科技 标签:

Review: C program

2007年8月21日 没有评论

Manipulating Bits:
Computer data and files are made of bits(or bytes).

There’re six bit-manipulation operators in C:
&: The bitwise AND operation
|: The bitwise OR operation
^: The bitwise exclusive OR(XOR)
~: The bitwise complement operator
>>: right-shift operator
<<: left-shift operator Decimal number converts to Hexadecimal or Binary. Each digit in a hex number consists of fours bits. A bit represents a digit in a binary number. As we know, the binary is a 2-based numbering system. Each digit in a binary number is called a bit, and can be 1 or 0. If the position of a bit in a binary number is n, then the bit can have a value of 2 to the power of n. The position of a bit in a binary number is counted from the right of the binary number. The most-right bit is at the position of zero. For example: (Binary) 1000 -> 1*2**3+0*2**2+0*2**1+0*2**0 -> 8 (Decimal)
(Decimal) 10 -> 1*2**3+0*2**2+1*2**1+0*2**0 -> 1010 (Binary)

&: Compare each bit of x to the corresponding bit in y. If both bits are 1, 1 is placed at the same position of the bit in the result. If one of the bits, or two of them, is 0, 0 is placed in the result.
eg: 01 & 11 returns 01

|: However, places 1 in the result if either operand is 1.
eg: 01 | 11 returns 11

^: Place 1 in the result if either operand, but not both.
eg: 01 ^ 11 returns 10

~: Takes just one operand. This operator reverses each bit in the operand.
eg: ~01 returns 10

>>: Shifts the bits of and operand to the right.

<<: Operand shifts the bits to the left. Note that the unsigned integer format specifier with a minimum field width of 6, %6u, and the uppercase Hex format specifier with the minimum width of 4, %04X, and used in the printf() function. The unsigned integer data type(that is, the non-negative integer data type) is chosen so that the complementary value of an integer can be shown and understood easily. ?: is called condition operator x?y:z, Here x, y and z are three expressions. X contains the test condition. Y and Z present the final value of the expression, if X returns nonzero(TRUE), y is chosen; if X returns zero(FALSE), Z is chosen. ~(1< 1111 1100
3. Finally, add one to the complemented binary.
eg. 1111 1100 + 0000 0001 —-> 1111 1101

As shown above, -3 is represented as “1111 1101” in binary format. There’s another method to find its binary format(Also contains three steps):
1. Set sign bit at leftmost position, 1 represent negative, 0 represent integer:
eg. -3 —-> 1000 0011
2. Reverse all the bits except of sign bit.
eg. 1000 0011 —-> 1111 1100
3. Add 1 to the above binary format.
eg. 1111 1100 + 0000 0001 —-> 1111 1101

Compare with above two method, their results are same. (-3 has binary format as 1111 1101).

Note the follow cases:

Case One. 4 – 3 = 1
4 —-> 0000 0100
-3 —-> 1111 1101
——————–
+ (1)0000 0001 Here, the blue marked “1” is ignored.
Note, integer(indicates number > 0) has three same format(orginal,reverse,complement codes). See the result “0000 0001”,its left-most bit is set as 0, which means it is an integer(>0), and the corresponding decimal number is 1.
More attention, the sign bits of both 4 and (-3) must be took part in adding calculation.

Case Two. 1 – 2 = -1
-2 original code: 1000 0010
reverse code: 1111 1101
complement code: 1111 1101 + 0000 0001 —> 1111 1110
Hence, 1 —> 0000 0001
-2 1111 1110
———————-
+ 1111 1111 (Complement code)
Convert negative number 1111 1111 from its complement code to original code:
Complement Code: 1111 1111
Reverse Code: 1111 1111 – 0000 0001 = 1111 1110
Original Code: 1111 1110 —> 1000 0001 —> Decimal 10
Here, when convert negative number from reverse code to its original code, the sign bit must NOT be changed.

Case Three: -2 – 2 = -4
-2 Complement Code: 1111 1110
-2 1111 1110
—————————–
+ Result Comple. Code: (1)1111 1100

Here blue marked 1 is ignored.

Convert the result to decimal:
Complement Code: 1111 1100
Reverse Code: 1111 1100 – 0000 0001 = 1111 1101
Original Code: 1111 1101 —> 1000 0010 —> -4 Decimal

The ANSI standard allows you to indicate that a constant is of type unsigned by suffixing u or U to the constant.

Change Data Sizes:
Sometimes, you want to reduce the memory taken by variables, or you need to increase the storage space of certain data types. C language gives you the flexiblity to modify size of data types.

The short modifier, a data type can be modified to take less memory by using the short modifier. For instance, you can apply the short modifier to an integer variable that is 32 bits long, which migh reduce the memory taken by the variable to as litter as 16 bits. By default, a short int data type is signed number:
eg: printf(“Hex of -12345 is 0x%X”, -12345); result is 0xFFFF CFCT
printf(“Hex of -12345 is 0x%hX”, -12345); result is 0xCFCT

Long modifier: more memory to keep values from a wide range.

You can add h into the integer format specifiet like this: %hd, %hu. Long is represented as “%L” or “%l”.

Have to include the header file math.h before you can use any math functions defined in the header file.

Pow syntax:
# include double pow(double x, double y);
x is raised to the power of y.

Sqrt syntax:
# include double sqrt(double x);
non-negative sqart root of x in double data type. The function returns error if x is negative.

Pow(x, 0.5) equals to Sqrt(x).

Note, all floating point calculations including both the float and double data type, are done in double-precision arithmetic. That is, a float data variable must be converted to a double in order to carry on the calculation. After the calculation, the double has to be converted to the float variable. Therefor a float calculation may take more time. THe main reason the C supports the float type is to save memory spaces, because the double data type takes twice as much memory space for storage as the float data type does.

分类: 科技 标签:

Use ScribeFire(Firefox addon) to publish MSN blog

2007年8月21日 没有评论

In the past three years, I had to edit my MSN space by IE in Windows, because firefox does not support MSN blog well(Sometimes format messes). Today I find a powerful tool to resolve this problem. Goes to the following link: “https://addons.mozilla.org/en-US/firefox/addon/1730”, and install ScribeFire for my firefox 1.5.07. After online installation, restart filefox, and there will a yellow iron on the below-right. Yes, it is ScribeFire.

Now I can write blog and publish on firefox. However, it seemes that I can not configure username/password by ScribeFire “Launch Account Wizard”. I have to edit in Scribe and paste the texts to blog window.

分类: 科技 标签: