版本 35bdab35d8a3f9091e75bf1efbeb01dadbaa4a24
Changes from 35bdab35d8a3f9091e75bf1efbeb01dadbaa4a24 to b56fb8927c5300ea622aaf456bcb03a631ece29a
---
title: Week #3 (Mar 10) :: ARM Architecture
toc: no
...
教材
----------
* fork() 系統呼叫的原理
- `一個fork的面試題<http://coolshell.cn/articles/7965.html>`_
+ 假設 fork.c 編譯出來的結果是 ``fork``,則可用這個指令計算 '-' 數量: ``./fork | wc -c``
- `In fork() which will run first, parent or child?<http://stackoverflow.com/questions/21586292/in-fork-which-will-run-first-parent-or-child>`_
+ ``sudo sysctl -w kernel.sched_child_runs_first=1``
+ `基本能力鑑定</embedded/2015q1w2>`_ 的第 4 題題意不清,所以沒有辦法作答
* `Introduction to ARM Architecture<https://docs.google.com/presentation/d/1cFBRICktpVQAOLzE5eDKD-OM4ckJuncFsn39Wg8aLZI/edit#slide=id.p14>`_
- `ARM Conditional Execution<http://www.davespace.co.uk/arm/introduction-to-arm/conditional.html>`_,以 C 程式來說:
.. code-block:: prettyprint
if (z == 1) R1 = R2 + (R3 * 4)
對應的 ARM 組合語言為
.. code-block:: prettyprint
addeqs r1, r2, r3, lsl #2