27. 地址概念
● 物理地址
● 邏輯地址
● 線性結構
● 32bit => 4G
● Base + offset
Kernel space
User space
Stack
.
.
.
Heap
--------
BSS
--------
DATA
--------
TEXT
Process 1 Process n
28. space
● Kernel space
– 保留給 Kernel 使用
– 所有的 Kernel process 共享同一塊空間
● User space
– 應用程式使用
– 擁有獨立的空間,互不干擾
33. Loader
● 將程式 『載入』到記憶體中
● 靜態連結
● 動態連結
● takes one or more object files generated by a
compiler and combines them into a single
executable program.
● pmap `pidof xxx`
47. example
#include <stdio.h>
#include <unistd.h>
int main (void) {
int i; // is it the 'same' i?
if (fork() == 0)
for (i = 0; i < 10000000; i++)
printf("child: %dn", i);
else
for (i = 0; i < 10000000; i++)
printf("parent: %dn", i);
}
55. TCP/IP
● Transmission Control Protocol / Internet Protocol
● The gap between applications and Network
● 4 layers
● 抽象
● 上層不需要管底層
● Reliable / Performance
56. 4 Layers architecture
● Application Layer
– Beyond your imagination
● Transport Layer (Port)
– Data flow
● Network Layer (IP)
– 封包傳遞 (src, dst)
● Link Layer (data-link)
– 負責硬體實現細節 (Ethernet, Wifi ...)
81. Watch point
(lldb) wa s v self->currentBullet
Watchpoint created: Watchpoint 1: addr = 0x08a4a9f4 size = 4 state = enabled
type = w
declare @ '/Users/xatier/work/tcfsh/cute-a-pult/cute-a-
pult/HelloWorldLayer.mm:512'
watchpoint spec = 'self->currentBullet'
new value: 0
(lldb) c
Process 11495 resuming
Watchpoint 1 hit:
old value: 0
new value: 0
(lldb)