'[Z-01] 참고 ' 카테고리의 다른 글
EDID란? (0) | 2012.12.21 |
---|---|
VirtualBox에서 USB로 부팅하기 (0) | 2012.12.04 |
[Site] pdf 암호제거 tool (0) | 2011.11.07 |
[site] JEDEC (DDR2, DDR3 Standard 문서를 얻을 수 있는 곳) (0) | 2011.10.14 |
[Glossary] Segmentation fault (0) | 2011.06.15 |
EDID란? (0) | 2012.12.21 |
---|---|
VirtualBox에서 USB로 부팅하기 (0) | 2012.12.04 |
[Site] pdf 암호제거 tool (0) | 2011.11.07 |
[site] JEDEC (DDR2, DDR3 Standard 문서를 얻을 수 있는 곳) (0) | 2011.10.14 |
[Glossary] Segmentation fault (0) | 2011.06.15 |
VirtualBox에서 USB로 부팅하기 (0) | 2012.12.04 |
---|---|
[Site] NotePad ++ (0) | 2011.11.24 |
[site] JEDEC (DDR2, DDR3 Standard 문서를 얻을 수 있는 곳) (0) | 2011.10.14 |
[Glossary] Segmentation fault (0) | 2011.06.15 |
[site] Duplicate IP and MAC address ARP patch (0) | 2011.05.04 |
[Site] NotePad ++ (0) | 2011.11.24 |
---|---|
[Site] pdf 암호제거 tool (0) | 2011.11.07 |
[Glossary] Segmentation fault (0) | 2011.06.15 |
[site] Duplicate IP and MAC address ARP patch (0) | 2011.05.04 |
윈7에서 Administrator 계정 사용 방법 (0) | 2011.04.21 |
[Linux] Vi(m) 사용시 ^M 없애기 (0) | 2011.11.30 |
---|---|
에볼루션(E-mail) 사용하기 (0) | 2011.11.26 |
[Linux] 리눅스 명령어 (scp : 파일전송) (0) | 2011.09.07 |
[Linux] Endian 체크하기 (0) | 2011.09.06 |
[Linux] make의 -j 옵션에 대해서(소스 컴파일 속도 최적화) (0) | 2011.07.14 |
에볼루션(E-mail) 사용하기 (0) | 2011.11.26 |
---|---|
position-independent 과 relocatable의 차이 (0) | 2011.09.09 |
[Linux] Endian 체크하기 (0) | 2011.09.06 |
[Linux] make의 -j 옵션에 대해서(소스 컴파일 속도 최적화) (0) | 2011.07.14 |
The standard sections of the man pages (0) | 2011.07.14 |
Source
#include <stdio.h>
int main()
{
int i = 0x00000001;
if( ((char *)&i)[0])
printf ("Little Endian\n");
else
printf ("Big Endian\n");
return 0;
}
Reference site
http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Network_Programing/Documents/endian#AEN57
http://www.jopenbusiness.com/mediawiki/index.php/Unix_to_Linux_Migration
position-independent 과 relocatable의 차이 (0) | 2011.09.09 |
---|---|
[Linux] 리눅스 명령어 (scp : 파일전송) (0) | 2011.09.07 |
[Linux] make의 -j 옵션에 대해서(소스 컴파일 속도 최적화) (0) | 2011.07.14 |
The standard sections of the man pages (0) | 2011.07.14 |
[커널함수] net_ratelimit() (0) | 2011.05.17 |
[Linux] 리눅스 명령어 (scp : 파일전송) (0) | 2011.09.07 |
---|---|
[Linux] Endian 체크하기 (0) | 2011.09.06 |
The standard sections of the man pages (0) | 2011.07.14 |
[커널함수] net_ratelimit() (0) | 2011.05.17 |
[FileSystem] 파일시스템 비교 (0) | 2011.03.04 |
man page 설치
yum install man-pages # 페도라에서 맨 페이지 설치
apt-get install manpages-dev # 우분투에서 맨 페이지 설치
apt-get install manpages-posix-dev # 우분투에서 posix 함수 관련 맨 페이지 설치
Section 번호
맨 페이지에는 명령어 별로 섹션이 분류가 되있으며, 섹션 번호를 이용하면 원하는 명령어의 메뉴얼을 볼 수 있습니다. 섹션 번호는 다음과 같습니다.
Section 1 : user commands
Section 2 : system calls
Section 3 : C library functions
Section 4 : devices and special files
Section 5 : file formats and conventions
Section 8 : system administration tools and deamons
맨 페이지를 사용할 때 ” man [섹션 번호] command ” 와 같이 사용하면 원하는 특정 명령어를 찾을 수 있습니다.
vim에서는 커서를 함수이름에 위치 시킨 후 ” [섹션 번호] Shift + k ” 를 입력하면 맨 페이지로 이동합니다.
[Linux] Endian 체크하기 (0) | 2011.09.06 |
---|---|
[Linux] make의 -j 옵션에 대해서(소스 컴파일 속도 최적화) (0) | 2011.07.14 |
[커널함수] net_ratelimit() (0) | 2011.05.17 |
[FileSystem] 파일시스템 비교 (0) | 2011.03.04 |
[linux] Linux에서 그래픽카드 확인하기 (0) | 2011.02.25 |
[glossary] CVBS란? (0) | 2011.03.11 |
---|---|
[kernel debug] 덤프의 사후 분석(post-mortem) (0) | 2010.12.17 |
[glossary] SCSI ( Small Computer Systems Interface) (0) | 2010.10.06 |
[device] flash memory의 SLC와 MLC (0) | 2010.10.05 |
[filesystems] BusyBox 사이트 (0) | 2010.10.04 |
A segmentation fault (often shortened to segfault) or bus error is generally an attempt to access memory that the CPU cannot physically address. It occurs when the hardware notifies a Unix-like operating system about a memory access violation. Then the OS kernel sends a signal to the process which caused the exception. By default the process receiving the signal dumps core and terminates. The default signal handler can also be overridden to customize how the signal is handled.[1]
Contents[hide] |
Bus errors usually are signaled with the SIGBUS signal, but SIGBUS can also be caused by any general device fault that the computer detects. A bus error rarely means that the computer hardware is physically broken - it is normally caused by a bug in a program's source code.
There are two main causes of bus errors:
CPUs generally access data at the full width of their data bus at all times. To address bytes, they access memory at the full width of their data bus, then mask and shift to address the individual byte. This is inefficient, but tolerated as it is an essential feature for most software, especially string processing. Unlike bytes, larger units can span two aligned addresses and would thus require more than one fetch on the data bus. It is possible for CPUs to support this, but this functionality is rarely required directly at the machine code level, thus CPU designers normally avoid implementing it and instead issue bus errors for unaligned memory access.
A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system).
Segmentation is one approach to memory management and protection in the operating system. It has been superseded by paging for most purposes, but much of the terminology of segmentation is still used, "segmentation fault" being an example. Some operating systems still have segmentation at some logical level although paging is used as the main memory management policy.
On Unix-like operating systems, a signal called SIGSEGV is sent to a process that accesses an invalid memory address. On Microsoft Windows, a process that accesses invalid memory receives the STATUS_ACCESS_VIOLATION exception.
A few causes of a segmentation fault can be summarized as follows:
Generally, segmentation faults occur because: a pointer is either NULL, points to random memory (probably never initialized to anything), or points to memory that has been freed/deallocated/"deleted".
e.g.
char *p1 = NULL; // Initialized to null, which is OK,
// (but cannot be dereferenced on many systems).
char *p2; // Not initialized at all.
char *p3 = new char[20]; // Great! it's allocated,
delete [] p3; // but now it isn't anymore.
Now, dereferencing any of these variables could cause a segmentation fault.
This is an example of un-aligned memory access, written in the C programming language.
#include <stdlib.h>
int main(int argc, char **argv) {
int *iptr;
char *cptr;
#if defined(__GNUC__)
# if defined(__i386__)
/* Enable Alignment Checking on x86 */
__asm__("pushf\norl $0x40000,(%esp)\npopf");
# elif defined(__x86_64__)
/* Enable Alignment Checking on x86_64 */
__asm__("pushf\norl $0x40000,(%rsp)\npopf");
# endif
#endif
/* malloc() always provides aligned memory */
cptr = malloc(sizeof(int) + 1);
/* Increment the pointer by one, making it misaligned */
iptr = (int *) ++cptr;
/* Dereference it as an int pointer, causing an unaligned access */
*iptr = 42;
return 0;
}
Compiling and running the example on Linux on x86 demonstrates the error:
$ gcc -ansi sigbus.c -o sigbus
$ ./sigbus
Bus error
$ gdb ./sigbus
(gdb) r
Program received signal SIGBUS, Bus error.
0x080483ba in main ()
(gdb) x/i $pc
0x80483ba <main+54>: mov DWORD PTR [eax],0x2a
(gdb) p/x $eax
$1 = 0x804a009
(gdb) p/t $eax & (sizeof(int) - 1)
$2 = 1
The GDB debugger shows that the immediate value 0x2a is being stored at the location stored in the EAX register, using X86 assembly language. This is an example of register indirect addressing.
Printing the low order bits of the address shows that it is not aligned to a word boundary ("dword" using x86 terminology).
Here is an example of ANSI C code that should create a segmentation fault on platforms with memory protection:
int main(void)
{
char *s = "hello world";
*s = 'H';
}
When the program containing this code is compiled, the string "hello world" is placed in the section of the program binary marked as read-only; when loaded, the operating system places it with other strings and constant data in a read-only segment of memory. When executed, a variable, s, is set to point to the string's location, and an attempt is made to write an H character through the variable into the memory, causing a segmentation fault. Compiling such a program with a compiler that does not check for the assignment of read-only locations at compile time, and running it on a Unix-like operating system produces the following runtime error:
$ gcc segfault.c -g -o segfault
$ ./segfault
Segmentation fault
Program received signal SIGSEGV, Segmentation fault.
0x1c0005c2 in main () at segfault.c:6
6 *s = 'H';
The conditions under which segmentation violations occur and how they manifest themselves are specific to an operating system.
Because a very common program error is a null pointer dereference (a read or write through a null pointer, used in C to mean "pointer to no object" and as an error indicator), most operating systems map the null pointer's address such that accessing it causes a segmentation fault.
int *ptr = NULL;
*ptr = 1;
This sample code creates a null pointer, and tries to assign a value to its non-existent target. Doing so causes a segmentation fault at runtime on many operating systems.
Another example is recursion without a base case:
int main(void)
{
main();
}
which causes the stack to overflow which results in a segmentation fault.[2]
[Site] pdf 암호제거 tool (0) | 2011.11.07 |
---|---|
[site] JEDEC (DDR2, DDR3 Standard 문서를 얻을 수 있는 곳) (0) | 2011.10.14 |
[site] Duplicate IP and MAC address ARP patch (0) | 2011.05.04 |
윈7에서 Administrator 계정 사용 방법 (0) | 2011.04.21 |
TortoiseSVN에서 ssh+svn 사용 방법 (0) | 2011.04.14 |
[Linux] make의 -j 옵션에 대해서(소스 컴파일 속도 최적화) (0) | 2011.07.14 |
---|---|
The standard sections of the man pages (0) | 2011.07.14 |
[FileSystem] 파일시스템 비교 (0) | 2011.03.04 |
[linux] Linux에서 그래픽카드 확인하기 (0) | 2011.02.25 |
[Linux] Fedora에서 자동 로그인 방법 (0) | 2011.01.27 |
[site] JEDEC (DDR2, DDR3 Standard 문서를 얻을 수 있는 곳) (0) | 2011.10.14 |
---|---|
[Glossary] Segmentation fault (0) | 2011.06.15 |
윈7에서 Administrator 계정 사용 방법 (0) | 2011.04.21 |
TortoiseSVN에서 ssh+svn 사용 방법 (0) | 2011.04.14 |
[UTIL] wireshark - network protocol analyzer (0) | 2011.04.14 |
[AVR] Intel Hex File Format (0) | 2010.06.25 |
---|---|
uIP-AVR (0) | 2009.11.09 |
Linux에서 AVR 컴파일환경 만들기 (0) | 2009.11.09 |
AVR221: Discrete PID controller (0) | 2009.11.06 |
AVR Timer 계산기 (0) | 2009.10.26 |
관리자 권한으로 cmd.exe를 실행 후 아래 명령어 실행하면 됩니다.
net user administrator /active:yes
administrator로 로그인시 모든 명령들이 관리자 권한으로 실행됩니다.
[Glossary] Segmentation fault (0) | 2011.06.15 |
---|---|
[site] Duplicate IP and MAC address ARP patch (0) | 2011.05.04 |
TortoiseSVN에서 ssh+svn 사용 방법 (0) | 2011.04.14 |
[UTIL] wireshark - network protocol analyzer (0) | 2011.04.14 |
[UTIL] WinHex - Hex 코드 편집기 (0) | 2011.04.14 |
"D:\Program Files\TortoiseSVN\bin\TortoisePlink.exe" -l 계정 -pw 암호
[site] Duplicate IP and MAC address ARP patch (0) | 2011.05.04 |
---|---|
윈7에서 Administrator 계정 사용 방법 (0) | 2011.04.21 |
[UTIL] wireshark - network protocol analyzer (0) | 2011.04.14 |
[UTIL] WinHex - Hex 코드 편집기 (0) | 2011.04.14 |
[site] Free Electrons (0) | 2011.03.18 |
윈7에서 Administrator 계정 사용 방법 (0) | 2011.04.21 |
---|---|
TortoiseSVN에서 ssh+svn 사용 방법 (0) | 2011.04.14 |
[UTIL] WinHex - Hex 코드 편집기 (0) | 2011.04.14 |
[site] Free Electrons (0) | 2011.03.18 |
[site] Linux Shell Scripting Tutorial (0) | 2011.01.26 |
TortoiseSVN에서 ssh+svn 사용 방법 (0) | 2011.04.14 |
---|---|
[UTIL] wireshark - network protocol analyzer (0) | 2011.04.14 |
[site] Free Electrons (0) | 2011.03.18 |
[site] Linux Shell Scripting Tutorial (0) | 2011.01.26 |
[site] 리눅스 시스템 관리 (0) | 2011.01.21 |
CFG_I2C_NOPROBES
이 옵션은 'i2c probe' 명령이 issue되었을 때, skipp될 I2C device의 list를 명시한다.
만약 CONFIG_I2C_MULTI_BUS 가 설정되었다면 bus-device pairs의 list를 명시하고, 그렇지 않으면 device address의 1차 배열을 명시해서 사용한다.
e.g.
하나의 i2c bus에서 0x50, 0x68의 address를 skip할 것이다.
bus0에서 0x50, 0x68의 address를 skip하고, bus1에서는 0x54의 address를 skip할 것이다.
[UTIL] wireshark - network protocol analyzer (0) | 2011.04.14 |
---|---|
[UTIL] WinHex - Hex 코드 편집기 (0) | 2011.04.14 |
[site] Linux Shell Scripting Tutorial (0) | 2011.01.26 |
[site] 리눅스 시스템 관리 (0) | 2011.01.21 |
[site] SAMSUNG semiconductor (0) | 2011.01.21 |
⊙ cpu_init_crit
중요한 registers 및 memory timing 등을 setup한다.
cpu_init_crit:
#ifndef CONFIG_EVT1
#if 0
bl v7_flush_dcache_all
#else
bl disable_l2cache
mov r0, #0x0 @
mov r1, #0x0 @ i
mov r3, #0x0
mov r4, #0x0
lp1:
mov r2, #0x0 @ j
lp2:
mov r3, r1, LSL #29 @ r3 = r1(i) <<29
mov r4, r2, LSL #6 @ r4 = r2(j) <<6
orr r4, r4, #0x2 @ r3 = (i<<29)|(j<<6)|(1<<1)
orr r3, r3, r4
mov r0, r3 @ r0 = r3
bl CoInvalidateDCacheIndex
add r2, #0x1 @ r2(j)++
cmp r2, #1024 @ r2 < 1024
bne lp2 @ jump to lp2
add r1, #0x1 @ r1(i)++
cmp r1, #8 @ r1(i) < 8
bne lp1 @ jump to lp1
bl set_l2cache_auxctrl
bl enable_l2cache
#endif
#endif
bl disable_l2cache
bl set_l2cache_auxctrl_cycle
bl enable_l2cache
/*
* Invalidate L1 I/D
*/
mov r0, #0 @ set up for MCR
mcr p15, 0, r0, c8, c7, 0 @ invalidate TLBs
mcr p15, 0, r0, c7, c5, 0 @ invalidate icache
/*
* disable MMU stuff and caches
*/
mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #0x00002000 @ clear bits 13 (--V-)
bic r0, r0, #0x00000007 @ clear bits 2:0 (-CAM)
orr r0, r0, #0x00000002 @ set bit 1 (--A-) Align
orr r0, r0, #0x00000800 @ set bit 12 (Z---) BTB
mcr p15, 0, r0, c1, c0, 0
/* Read booting information */
ldr r0, =PRO_ID_BASE
ldr r1, [r0,#OMR_OFFSET]
bic r2, r1, #0xffffffc1
#ifdef CONFIG_VOGUES
/* PS_HOLD(GPH0_0) set to output high */
ldr r0, =ELFIN_GPIO_BASE
ldr r1, =0x00000001
str r1, [r0, #GPH0CON_OFFSET]
ldr r1, =0x5500
str r1, [r0, #GPH0PUD_OFFSET]
ldr r1, =0x01
str r1, [r0, #GPH0DAT_OFFSET]
#endif
[mango210] u-boot.lds 분석 (0) | 2011.03.17 |
---|---|
[mango210] u-boot hardware point (0) | 2011.03.16 |
[mango210] u-boot 디렉토리 구조 (0) | 2011.03.16 |
[mango210] ARM Architecture Reference Manual (0) | 2011.03.10 |
[mango210] S5PV210 Booting Sequence (0) | 2011.01.14 |