關(guān)于我們
書單推薦
新書推薦
|
嵌入式C語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) 讀者對象:嵌入式學(xué)習(xí)者、開發(fā)者,從事Linux下C語言開發(fā)工作的人員
這是一本專門為嵌入式讀者打造的C語言進(jìn)階學(xué)習(xí)圖書。本書的學(xué)習(xí)重點不再是C語言的基本語法,而是和嵌入式、C語言相關(guān)的一系列知識。作者以C語言為切入點,分別探討了嵌入式開發(fā)所需要的諸多核心理論和技能,力圖幫助讀者從零搭建嵌入式開發(fā)所需要的完整知識體系和技能樹。本書從底層CPU的制造流程和工作原理開始講起,到計算機(jī)體系結(jié)構(gòu),C程序的反匯編分析,程序的編譯、運行和重定位,程序運行時的堆棧內(nèi)存動態(tài)變化,GNU C編譯器的擴(kuò)展語法,指針的靈活使用,C語言的面向?qū)ο缶幊趟枷,C語言的模塊化編程思想,C語言的多任務(wù)編程思想,進(jìn)程、線程和協(xié)程的概念,從底層到上層,從芯片、硬件到軟件、框架,幾乎涵蓋了嵌入式開發(fā)的所有知識點。
王利濤,嵌入式工程師、培訓(xùn)講師,多年嵌入式開發(fā)經(jīng)驗,包括芯片測試、BSP、驅(qū)動開發(fā)、USB子系統(tǒng)等。目前在開發(fā)《嵌入式工程師自我修養(yǎng)》系列在線視頻教程,以及在個人博客(www.zhaixue.cc)分享更多的嵌入式、Linux、AIoT技術(shù)。
第1 章 工欲善其事,必先利其器 ·····································································.1
1.1 代碼編輯工具:Vim ·············································································.2 1.1.1 安裝Vim ·················································································.2 1.1.2 Vim 常用命令 ············································································.3 1.1.3 Vim 配置文件:vimrc ··································································.6 1.1.4 Vim 的按鍵映射 ·········································································.8 1.2 程序編譯工具:make ···········································································.10 1.2.1 使用IDE 編譯C 程序 ·································································.10 1.2.2 使用gcc 編譯C 源程序 ·······························································.11 1.2.3 使用make 編譯程序 ···································································.14 1.3 代碼管理工具:Git ·············································································.16 1.3.1 什么是版本控制系統(tǒng) ··································································.16 1.3.2 Git 的安裝和配置 ······································································.18 1.3.3 Git 常用命令 ············································································.18 第2 章 計算機(jī)體系結(jié)構(gòu)與CPU 工作原理 ·························································.21 2.1 一顆芯片是怎樣誕生的 ········································································.22 2.1.1 從沙子到單晶硅 ········································································.22 2.1.2 PN 結(jié)的工作原理 ······································································.24 2.1.3 從PN 結(jié)到芯片電路 ···································································.26 2.1.4 芯片的封裝 ··············································································.28 2.2 一顆CPU 是怎么設(shè)計出來的 ·································································.29 2.2.1 計算機(jī)理論基石:圖靈機(jī) ····························································.30 嵌入式C 語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) ? XIV ? 2.2.2 CPU 內(nèi)部結(jié)構(gòu)及工作原理 ····························································.31 2.2.3 CPU 設(shè)計流程 ··········································································.33 2.3 計算機(jī)體系結(jié)構(gòu) ·················································································.37 2.3.1 馮·諾依曼架構(gòu) ··········································································.38 2.3.2 哈弗架構(gòu) ················································································.38 2.3.3 混合架構(gòu) ················································································.38 2.4 CPU 性能提升:Cache 機(jī)制 ···································································.39 2.4.1 Cache 的工作原理 ······································································.39 2.4.2 一級Cache 和二級Cache ·····························································.41 2.4.3 為什么有些處理器沒有Cache ·······················································.42 2.5 CPU 性能提升:流水線 ········································································.42 2.5.1 流水線工作原理 ········································································.43 2.5.2 超流水線技術(shù) ···········································································.44 2.5.3 流水線冒險 ··············································································.47 2.5.4 分支預(yù)測 ················································································.49 2.5.5 亂序執(zhí)行 ················································································.50 2.5.6 SIMD 和NEON ········································································.51 2.5.7 單發(fā)射和多發(fā)射 ········································································.52 2.6 多核CPU ·························································································.54 2.6.1 單核處理器的瓶頸 ·····································································.54 2.6.2 片上多核互連技術(shù) ·····································································.55 2.6.3 big.LITTLE 結(jié)構(gòu) ·······································································.58 2.6.4 超線程技術(shù) ··············································································.59 2.6.5 CPU 核數(shù)越多越好嗎 ··································································.61 2.7 后摩爾時代:異構(gòu)計算的崛起 ································································.62 2.7.1 什么是異構(gòu)計算 ········································································.62 2.7.2 GPU ······················································································.63 2.7.3 DSP ·······················································································.64 2.7.4 FPGA ·····················································································.64 2.7.5 TPU ·······················································································.65 2.7.6 NPU ······················································································.67 2.7.7 后摩爾時代的XPU 們 ·································································.70 目 錄 ? XV ? 2.8 總線與地址 ·······················································································.71 2.8.1 地址的本質(zhì) ··············································································.72 2.8.2 總線的概念 ··············································································.73 2.8.3 總線編址方式 ···········································································.74 2.9 指令集與微架構(gòu) ·················································································.74 2.9.1 什么是指令集 ···········································································.75 2.9.2 什么是微架構(gòu) ···········································································.76 2.9.3 指令助記符:匯編語言 ·······························································.79 第3 章 ARM 體系結(jié)構(gòu)與匯編語言 ··································································.81 3.1 ARM 體系結(jié)構(gòu) ··················································································.81 3.2 ARM 匯編指令 ··················································································.84 3.2.1 存儲訪問指令 ···········································································.85 3.2.2 數(shù)據(jù)傳送指令 ···········································································.87 3.2.3 算術(shù)邏輯運算指令 ·····································································.87 3.2.4 操作數(shù):operand2 詳解 ·······························································.88 3.2.5 比較指令 ················································································.88 3.2.6 條件執(zhí)行指令 ···········································································.89 3.2.7 跳轉(zhuǎn)指令 ················································································.90 3.3 ARM 尋址方式 ··················································································.91 3.3.1 寄存器尋址 ··············································································.91 3.3.2 立即數(shù)尋址 ··············································································.91 3.3.3 寄存器偏移尋址 ········································································.92 3.3.4 寄存器間接尋址 ········································································.92 3.3.5 基址尋址 ················································································.92 3.3.6 多寄存器尋址 ···········································································.92 3.3.7 相對尋址 ················································································.93 3.4 ARM 偽指令 ·····················································································.94 3.4.1 LDR 偽指令 ·············································································.94 3.4.2 ADR 偽指令 ·············································································.96 3.5 ARM 匯編程序設(shè)計·············································································.97 3.5.1 ARM 匯編程序格式 ···································································.97 嵌入式C 語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) ? XVI ? 3.5.2 符號與標(biāo)號 ··············································································.98 3.5.3 偽操作 ···················································································.99 3.6 C 語言和匯編語言混合編程 ·································································.101 3.6.1 ATPCS 規(guī)則 ···········································································.101 3.6.2 在C 程序中內(nèi)嵌匯編代碼 ··························································.103 3.6.3 在匯編程序中調(diào)用C 程序 ··························································.104 3.7 GNU ARM 匯編語言 ·········································································.105 3.7.1 重新認(rèn)識編譯器 ······································································.105 3.7.2 GNU ARM 編譯器的偽操作 ························································.107 3.7.3 GNU ARM 匯編語言中的標(biāo)號 ·····················································.108 3.7.4 .section 偽操作 ········································································.109 3.7.5 基本數(shù)據(jù)格式 ·········································································.110 3.7.6 數(shù)據(jù)定義 ··············································································.110 3.7.7 匯編代碼分析實戰(zhàn) ···································································.111 第4 章 程序的編譯、鏈接、安裝和運行 ·························································.114 4.1 從源程序到二進(jìn)制文件 ······································································.115 4.2 預(yù)處理過程 ·····················································································.120 4.3 程序的編譯 ·····················································································.123 4.3.1 從C 文件到匯編文件 ································································.124 4.3.2 匯編過程 ··············································································.127 4.3.3 符號表與重定位表 ···································································.129 4.4 鏈接過程························································································.132 4.4.1 分段組裝 ··············································································.132 4.4.2 符號決議 ··············································································.136 4.4.3 重定位 ·················································································.140 4.5 程序的安裝 ·····················································································.142 4.5.1 程序安裝的本質(zhì) ······································································.142 4.5.2 在Linux 下制作軟件安裝包 ························································.143 4.5.3 使用apt-get 在線安裝軟件 ··························································.145 4.5.4 在Windows 下制作軟件安裝包 ····················································.147 目 錄 ? XVII ? 4.6 程序的運行 ·····················································································.150 4.6.1 操作系統(tǒng)環(huán)境下的程序運行 ·······················································.150 4.6.2 裸機(jī)環(huán)境下的程序運行 ·····························································.153 4.6.3 程序入口main()函數(shù)分析 ···························································.154 4.6.4 BSS 段的小秘密 ······································································.157 4.7 鏈接靜態(tài)庫 ·····················································································.158 4.8 動態(tài)鏈接························································································.162 4.8.1 與地址無關(guān)的代碼 ···································································.164 4.8.2 全局偏移表 ············································································.165 4.8.3 延遲綁定 ··············································································.166 4.8.4 共享庫 ·················································································.168 4.9 插件的工作原理 ···············································································.169 4.10 Linux 內(nèi)核模塊運行機(jī)制 ···································································.171 4.11 Linux 內(nèi)核編譯和啟動分析 ································································.174 4.12 U-boot 重定位分析 ··········································································.179 4.13 常用的binutils 工具集 ······································································.185 第5 章 內(nèi)存堆棧管理 ·················································································.188 5.1 程序運行的“馬甲”:進(jìn)程 ·································································.189 5.2 Linux 環(huán)境下的內(nèi)存管理 ····································································.190 5.3 棧的管理························································································.192 5.3.1 棧的初始化 ············································································.193 5.3.2 函數(shù)調(diào)用 ··············································································.195 5.3.3 參數(shù)傳遞 ··············································································.199 5.3.4 形參與實參 ············································································.201 5.3.5 棧與作用域 ············································································.206 5.3.6 棧溢出攻擊原理 ······································································.208 5.4 堆內(nèi)存管理 ·····················································································.210 5.4.1 裸機(jī)環(huán)境下的堆內(nèi)存管理 ··························································.212 5.4.2 uC/OS 的堆內(nèi)存管理 ································································.213 5.4.3 Linux 堆內(nèi)存管理 ····································································.219 5.4.4 堆內(nèi)存測試程序 ······································································.227 嵌入式C 語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) ? XVIII ? 5.4.5 實現(xiàn)自己的堆管理器 ································································.229 5.5 mmap 映射區(qū)域探秘 ··········································································.233 5.5.1 將文件映射到內(nèi)存 ···································································.236 5.5.2 mmap 映射實現(xiàn)機(jī)制分析 ···························································.239 5.5.3 把設(shè)備映射到內(nèi)存 ···································································.240 5.5.4 多進(jìn)程共享動態(tài)庫 ···································································.243 5.6 內(nèi)存泄漏與防范 ···············································································.245 5.6.1 一個內(nèi)存泄漏的例子 ································································.245 5.6.2 預(yù)防內(nèi)存泄漏 ·········································································.246 5.6.3 內(nèi)存泄漏檢測:MTrace ·····························································.248 5.6.4 廣義上的內(nèi)存泄漏 ···································································.250 5.7 常見的內(nèi)存錯誤及檢測 ······································································.251 5.7.1 總有一個Bug,讓你淚流滿面 ·····················································.253 5.7.2 使用core dump 調(diào)試段錯誤 ························································.254 5.7.3 什么是內(nèi)存踩踏 ······································································.256 5.7.4 內(nèi)存踩踏監(jiān)測:mprotect ····························································.257 5.7.5 內(nèi)存檢測神器:Valgrind ····························································.259 第6 章 GNU C 編譯器擴(kuò)展語法精講 ·····························································.263 6.1 C 語言標(biāo)準(zhǔn)和編譯器 ·········································································.264 6.1.1 什么是C 語言標(biāo)準(zhǔn) ··································································.264 6.1.2 C 語言標(biāo)準(zhǔn)的內(nèi)容 ···································································.265 6.1.3 C 語言標(biāo)準(zhǔn)的發(fā)展過程 ·····························································.265 6.1.4 編譯器對C 語言標(biāo)準(zhǔn)的支持 ·······················································.268 6.1.5 編譯器對C 語言標(biāo)準(zhǔn)的擴(kuò)展 ·······················································.268 6.2 指定初始化 ·····················································································.269 6.2.1 指定初始化數(shù)組元素 ································································.269 6.2.2 指定初始化結(jié)構(gòu)體成員 ·····························································.271 6.2.3 Linux 內(nèi)核驅(qū)動注冊 ·································································.271 6.2.4 指定初始化的好處 ···································································.273 6.3 宏構(gòu)造“利器”:語句表達(dá)式 ······························································.273 6.3.1 表達(dá)式、語句和代碼塊 ·····························································.273 目 錄 ? XIX ? 6.3.2 語句表達(dá)式 ············································································.274 6.3.3 在宏定義中使用語句表達(dá)式 ·······················································.276 6.3.4 內(nèi)核中的語句表達(dá)式 ································································.280 6.4 typeof 與container_of 宏 ·····································································.280 6.4.1 typeof 關(guān)鍵字 ·········································································.280 6.4.2 typeof 使用示例 ······································································.281 6.4.3 Linux 內(nèi)核中的container_of 宏 ····················································.281 6.4.4 container_of 宏實現(xiàn)分析 ····························································.283 6.5 零長度數(shù)組 ·····················································································.286 6.5.1 什么是零長度數(shù)組 ···································································.286 6.5.2 零長度數(shù)組使用示例 ································································.288 6.5.3 內(nèi)核中的零長度數(shù)組 ································································.288 6.5.4 思考:指針與零長度數(shù)組 ··························································.290 6.6 屬性聲明:section·············································································.292 6.6.1 GNU C 編譯器擴(kuò)展關(guān)鍵字:__attribute__ ·······································.292 6.6.2 屬性聲明:section ···································································.294 6.6.3 U-boot 鏡像自復(fù)制分析 ·····························································.297 6.7 屬性聲明:aligned ············································································.299 6.7.1 地址對齊:aligned ···································································.299 6.7.2 結(jié)構(gòu)體的對齊 ·········································································.302 6.7.3 思考:編譯器一定會按照aligned 指定的方式對齊嗎 ·························.304 6.7.4 屬性聲明:packed ···································································.305 6.7.5 內(nèi)核中的aligned、packed 聲明 ····················································.306 6.8 屬性聲明:format ·············································································.306 6.8.1 變參函數(shù)的格式檢查 ································································.306 6.8.2 變參函數(shù)的設(shè)計與實現(xiàn) ·····························································.308 6.8.3 實現(xiàn)自己的日志打印函數(shù) ··························································.312 6.9 屬性聲明:weak ···············································································.314 6.9.1 強(qiáng)符號和弱符號 ······································································.314 6.9.2 函數(shù)的強(qiáng)符號與弱符號 ·····························································.316 6.9.3 弱符號的用途 ·········································································.317 6.9.4 屬性聲明:alias ······································································.319 嵌入式C 語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) ? XX ? 6.10 內(nèi)聯(lián)函數(shù) ······················································································.320 6.10.1 屬性聲明:noinline ·································································.320 6.10.2 什么是內(nèi)聯(lián)函數(shù) ····································································.320 6.10.3 內(nèi)聯(lián)函數(shù)與宏 ·······································································.321 6.10.4 編譯器對內(nèi)聯(lián)函數(shù)的處理 ·························································.322 6.10.5 思考:內(nèi)聯(lián)函數(shù)為什么定義在頭文件中 ········································.324 6.11 內(nèi)建函數(shù) ······················································································.324 6.11.1 什么是內(nèi)建函數(shù) ····································································.324 6.11.2 常用的內(nèi)建函數(shù) ····································································.325 6.11.3 C 標(biāo)準(zhǔn)庫的內(nèi)建函數(shù) ·······························································.328 6.11.4 內(nèi)建函數(shù):__builtin_constant_p(n) ···············································.328 6.11.5 內(nèi)建函數(shù):__builtin_expect(exp,c) ···············································.329 6.11.6 Linux 內(nèi)核中的likely 和unlikely ················································.330 6.12 可變參數(shù)宏 ···················································································.333 6.12.1 什么是可變參數(shù)宏 ··································································.334 6.12.2 繼續(xù)改進(jìn)我們的宏 ··································································.335 6.12.3 可變參數(shù)宏的另一種寫法 ·························································.336 6.12.4 內(nèi)核中的可變參數(shù)宏 ·······························································.336 第7 章 數(shù)據(jù)存儲與指針 ··············································································.339 7.1 數(shù)據(jù)類型與存儲 ···············································································.340 7.1.1 大端模式與小端模式 ································································.340 7.1.2 有符號數(shù)和無符號數(shù) ································································.343 7.1.3 數(shù)據(jù)溢出 ··············································································.345 7.1.4 數(shù)據(jù)類型轉(zhuǎn)換 ·········································································.348 7.2 數(shù)據(jù)對齊························································································.352 7.2.1 為什么要數(shù)據(jù)對齊 ···································································.352 7.2.2 結(jié)構(gòu)體對齊 ············································································.353 7.2.3 聯(lián)合體對齊 ············································································.356 7.3 數(shù)據(jù)的可移植性 ···············································································.358 7.4 Linux 內(nèi)核中的size_t 類型 ··································································.360 7.5 為什么很多人編程時喜歡用typedef ·······················································.361 目 錄 ? XXI ? 7.5.1 typedef 的基本用法 ··································································.361 7.5.2 使用typedef 的優(yōu)勢 ··································································.364 7.5.3 使用typedef 需要注意的地方 ······················································.366 7.5.4 typedef 的作用域 ·····································································.368 7.5.5 如何避免typedef 被大量濫用 ······················································.368 7.6 枚舉類型························································································.369 7.6.1 使用枚舉的三種方法 ································································.370 7.6.2 枚舉的本質(zhì) ············································································.370 7.6.3 Linux 內(nèi)核中的枚舉類型 ···························································.372 7.6.4 使用枚舉需要注意的地方 ··························································.372 7.7 常量和變量 ·····················································································.373 7.7.1 變量的本質(zhì) ············································································.374 7.7.2 常量存儲 ··············································································.376 7.7.3 常量折疊 ··············································································.377 7.8 從變量到指針 ··················································································.378 7.8.1 指針的本質(zhì) ············································································.379 7.8.2 一些復(fù)雜的指針聲明 ································································.381 7.8.3 指針類型與運算 ······································································.383 7.9 指針與數(shù)組的“曖昧”關(guān)系 ·································································.386 7.9.1 下標(biāo)運算符[] ··········································································.388 7.9.2 數(shù)組名的本質(zhì) ·········································································.389 7.9.3 指針數(shù)組與數(shù)組指針 ································································.392 7.10 指針與結(jié)構(gòu)體 ················································································.395 7.11 二級指針 ······················································································.399 7.11.1 修改指針變量的值 ··································································.400 7.11.2 二維指針和指針數(shù)組 ·······························································.402 7.11.3 二級指針和二維數(shù)組 ·······························································.403 7.12 函數(shù)指針 ······················································································.407 7.13 重新認(rèn)識void ················································································.408 第8 章 C 語言的面向?qū)ο缶幊趟枷?·······························································.411 8.1 代碼復(fù)用與分層思想 ·········································································.412 嵌入式C 語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) ? XXII ? 8.2 面向?qū)ο缶幊袒A(chǔ) ············································································.413 8.2.1 什么是OOP ···········································································.414 8.2.2 類的封裝與實例化 ···································································.414 8.2.3 繼承與多態(tài) ············································································.416 8.2.4 虛函數(shù)與純虛函數(shù) ···································································.418 8.3 Linux 內(nèi)核中的OOP 思想:封裝 ··························································.419 8.3.1 類的C 語言模擬實現(xiàn) ································································.420 8.3.2 鏈表的抽象與封裝 ···································································.422 8.3.3 設(shè)備管理模型 ·········································································.423 8.3.4 總線設(shè)備模型 ·········································································.427 8.4 Linux 內(nèi)核中的OOP 思想:繼承 ··························································.429 8.4.1 繼承與私有指針 ······································································.429 8.4.2 繼承與抽象類 ·········································································.430 8.4.3 繼承與接口 ············································································.431 8.5 Linux 內(nèi)核中的OOP 思想:多態(tài) ··························································.433 第9 章 C 語言的模塊化編程思想 ··································································.436 9.1 模塊的編譯和鏈接 ············································································.437 9.2 系統(tǒng)模塊劃分 ··················································································.439 9.2.1 模塊劃分方法 ·········································································.439 9.2.2 面向?qū)ο缶幊痰乃季S陷阱 ··························································.441 9.2.3 規(guī)劃合理的目錄結(jié)構(gòu) ································································.442 9.3 一個模塊的封裝 ···············································································.443 9.4 頭文件深度剖析 ···············································································.444 9.4.1 基本概念 ··············································································.444 9.4.2 隱式聲明 ··············································································.446 9.4.3 變量的聲明與定義 ···································································.447 9.4.4 如何區(qū)分定義和聲明 ································································.449 9.4.5 前向引用和前向聲明 ································································.450 9.4.6 定義與聲明的一致性 ································································.453 9.4.7 頭文件路徑 ············································································.454 9.4.8 Linux 內(nèi)核中的頭文件 ······························································.456 目 錄 ? XXIII ? 9.4.9 頭文件中的內(nèi)聯(lián)函數(shù) ································································.459 9.5 模塊設(shè)計原則 ··················································································.459 9.6 被誤解的關(guān)鍵字:goto ·······································································.461 9.7 模塊間通信 ·····················································································.462 9.7.1 全局變量 ··············································································.462 9.7.2 回調(diào)函數(shù) ··············································································.466 9.7.3 異步通信 ··············································································.470 9.8 模塊設(shè)計進(jìn)階 ··················································································.471 9.8.1 跨平臺設(shè)計 ············································································.471 9.8.2 框架 ····················································································.473 9.9 AIoT 時代的模塊化編程 ·····································································.476 第10 章 C 語言的多任務(wù)編程思想和操作系統(tǒng)入門 ···········································.478 10.1 多任務(wù)的裸機(jī)實現(xiàn) ···········································································.479 10.1.1 多任務(wù)的模擬實現(xiàn) ··································································.479 10.1.2 改變?nèi)蝿?wù)的執(zhí)行頻率 ·······························································.481 10.1.3 改變?nèi)蝿?wù)的執(zhí)行時間 ·······························································.484 10.2 操作系統(tǒng)基本原理 ···········································································.488 10.2.1 調(diào)度器工作原理 ····································································.490 10.2.2 函數(shù)棧與進(jìn)程棧 ····································································.492 10.2.3 可重入函數(shù) ··········································································.493 10.2.4 臨界區(qū)與臨界資源 ··································································.495 10.3 中斷 ····························································································.497 10.3.1 中斷處理流程 ·······································································.497 10.3.2 進(jìn)程棧與中斷棧 ····································································.500 10.3.3 中斷函數(shù)的實現(xiàn) ····································································.504 10.4 系統(tǒng)調(diào)用 ······················································································.506 10.4.1 操作系統(tǒng)的API ·····································································.506 10.4.2 操作系統(tǒng)的權(quán)限管理 ·······························································.508 10.4.3 CPU 的特權(quán)模式 ····································································.508 10.4.4 Linux 系統(tǒng)調(diào)用接口 ································································.509 嵌入式C 語言自我修養(yǎng)——從芯片、編譯器到操作系統(tǒng) ? XXIV ? 10.5 揭開文件系統(tǒng)的神秘面紗 ··································································.510 10.5.1 什么是文件系統(tǒng) ····································································.511 10.5.2 文件系統(tǒng)的掛載 ····································································.513 10.5.3 根文件系統(tǒng) ··········································································.514 10.6 存儲器接口與映射 ···········································································.515 10.6.1 存儲器與接口 ·······································································.515 10.6.2 存儲映射 ·············································································.518 10.6.3 嵌入式啟動方式 ····································································.520 10.7 內(nèi)存與外部設(shè)備 ·············································································.521 10.7.1 內(nèi)存與外存 ··········································································.521 10.7.2 外部設(shè)備 ·············································································.522 10.7.3 I/O 端口與I/O 內(nèi)存 ································································.523 10.8 寄存器操作 ···················································································.524 10.8.1 位運算應(yīng)用 ··········································································.524 10.8.2 操作寄存器 ··········································································.527 10.8.3 位域 ···················································································.529 10.9 內(nèi)存管理單元MMU ········································································.531 10.9.1 地址轉(zhuǎn)換 ·············································································.532 10.9.2 權(quán)限管理 ·············································································.534 10.10 進(jìn)程、線程和協(xié)程 ·········································································.535 10.10.1 進(jìn)程 ·················································································.536 10.10.2 線程 ·················································································.538 10.10.3 線程池 ··············································································.539 10.10.4 協(xié)程 ·················································································.540 10.10.5 小結(jié) ·················································································.541 參考文獻(xiàn) ···································································································.543
你還可能感興趣
我要評論
|