跳到主要內容

發表文章

目前顯示的是 7月, 2010的文章

What Is A Kernel Module?

引述自  The Linux Kernel Module Programming Guide 原文 : What exactly is a kernel module? Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. For example, one type of module is the device driver, which allows the kernel to access hardware connected to the system. Without modules, we would have to build monolithic kernels and add new functionality directly into the kernel image. Besides having larger kernels, this has the disadvantage of requiring us to rebuild and reboot the kernel every time we want new functionality.   自譯 :         Kernel module 其實就是一段程式碼,根據需求(service),module 可以載入 kernel 裡,或是從 kernel 中卸除,並不需要重新啟動作業系統(Linux),module 擴展了 kernel 的功能。         舉例,假設有一個 module 是屬於 device driver 類型,那麼這個 module 在 kernel 中可以直接存取與系統連線的硬體;相對地,若是 kernel 沒有提供 module 這樣的機制,我們必須在建置一個單體核心(ex. Linux)時,選擇直接加入新的功能到 kernel 裡,除此之外,kern...