Installing GRUB on a Hard Disk Image File

文章目錄 Creating the ImageUsing the Image quoted from http://www.omninerd.com/articles/Installing_GRUB_on_a_Hard_Disk_Image_File IntroductionGRUB is the GRand Unified Bootloader. For those unfamiliar, a bootloader is a

在 kernel中如何定時, 變數 HZ 和 jiffies

 HZ      定義了時鐘中斷的頻率,即每秒鐘時鐘中斷的次數jiffies  記錄了自啟動後,時鐘中斷髮生的次數 例如:unsigned long timeout = jiffies + (3*HZ);     while (hwgroup->busy) {     /* ... */     if (time_after(jiffies, timeout)) {     return -EBUSY;     }     /* ... */}return

bootsect.S 所做的工作

1. 將自己(512B)移動到0x90000 並新的地方繼續執行 2. 從磁碟第二個扇區開始的四個扇區的setup模組拷貝到0x90200, 即bootsect後面 3. 儲存每磁軌最大扇區數到 變數sectors, 用init 0x13, 用於判斷跟檔案系統,in step5 4. 載入system模組到0x10000處, 5. 確定根檔案系統裝置號,並儲存到root_dev中,以備setup模組用到 6. 長跳轉到setup模組,執行

Concurrency and Race Condition

產生競爭的原因:   對資源的共用訪問,包括硬體資源(裝置)和軟體資源(記憶體空間) 原則:   盡量減少共用資源的使用,如全域變數等 解決的方法:   通過建立critical section是操作成為原子操作,使同一時間內,只有一個線程操作該段代碼。   kernel對不同的情況提供了不同的方法,注意的是,有的方法可以 Go to sleep的,有的不行!   有的方法會導致執行的線程go to sleep,而有的方法不會。   有的代碼是允許sleep的,那就可以使用go to

三種 bottom half的實現方式 softirqs, tasklets, work queue 及之間的比較

The following mechanisms are available in the kernel to defer work to a bottom half: softirqs, tasklets, and work queues.  Softirqs are the basic bottom half mechanism and have strong locking requirements. They are used only by afew

Add a system call on x86_32 arch

diff --git a/Makefile b/Makefileindex a43733d..9e3bfef 100644--- a/Makefile+++ b/Makefile@@ -708,7 +708,7 @@ export mod_strip_cmd   ifeq ($(KBUILD_EXTMOD),)-core-y        += kernel/ mm/ fs/ ipc/ security/ crypto/ block/+core-y        += kernel/ mm/

如何產生core file 及使用

程式發生crash時,linux會產生core dump。但是這個是需要配置的。 1.     configure kernelmakemenuconfigenterGeneral setup & select Enable ELF core dumps 3.       configure the core file limit and patternulimit  -cunlimitedulimit unlimitedecho "/var/%e.core">/proc/sys/

Major and Minor Numbers 及 註冊和撤銷

Char devices are accessedthrough names in the filesystem. Those names arecalled special files or device files or simply nodes of thefilesystem tree; they are conventionally located in the/dev directory. Special filesfor char drivers are

Debian-dpkg-apt

Debian是一款能安裝在電腦上使用的作業系統 (OS)。作業系統就是能讓您的電腦工作 的一系列基本程式和工具 + 生產力。由於 Debian 採用了 Linux Kernel (作業系統的核心),但是大部分基礎的作業系統工具都來自於 GNU 工程, 因此又稱為 GNU/Linux。Debian GNU/Linux 附帶了超過 29000 個軟體包,這些預先編譯好的軟體被包裹成一種良好的格式以便於在您的機器上進行安裝。 APT——Advanced Package

Char Device Driver Example for Kernel 2.6

現在還有疑問,1.怎麼知道註冊了device後,在/dev目錄下顯示的是哪個檔案名稱?在class_device_create中產生該檔案。 仍有待研究。  註冊字元裝置的過程1. alloc_chrdev_region 動態分配裝置號2. cdev_init  初始化cdev,將fops註冊3. cdev_add  將這個字元裝置註冊到kernel這樣cdev_add後,在/dev目錄下並不產生指定的檔案。使用 mknod 如mknod /dev/yw_device c 251

[收藏] 走出備份的誤區

HP始終認為,備份只是一種手段,備份的目的是為了防止資料災難,縮短停機時間,保證資料安全,伺服器硬體升級;而備份的最終目的:恢複!其中,磁帶機提供了經濟有效備份,它能夠以10%~20%的投資,實現100%的可靠。   很多系統管理人員以及CIO對備份的認識有著一定的誤區。誤區之一是:用拷貝來代替備份。實際上,備份等於拷貝加管理,備份能實現可 計劃性以及自動化,以及記錄的儲存和日誌記錄。在海量資料情況下,如果不對資料進行管理,則會陷入資料汪洋之中。誤區之二是用雙機、磁碟陣列、鏡像等

在非process context中,不能做什麼

 When you are outside of process context (i.e., in interrupt context), you must observe thefollowing rules:  • No access to user space is allowed. Because there is no process context, there is     no path to the user space associated with any

Create file under /proc — Manage it with standard file system

 /* *  procfs3.c -  create a "file" in /proc, use the file_operation way *              to manage the file. */#include <linux/kernel.h>       /* We're doing kernel work */#include <linux/module.h>       /* Specifically, a module

APUE讀書筆記-第11章-線程

11.1 引言*一個進程中的所以線程都可以訪問該進程的組成組件,如檔案描述符和記憶體*無論何時,只要單個資源需要在多個使用者間共用,就必須處理一致性問題*同步機制用以防止多個線程查看到不一致的共用資源11.2 線程概念*典型的UNIX進程可以看成只要一個控制線程:一個進程在同一時刻只做一件事情。有了多個控制縣城以後,在程式設計時可以把進程設計成在同一時刻能夠做不止一件事,每個線程處理各自獨立的任務*多線程的好處包括:(a)通過為每種事件類型的處理分配單獨的線程,能夠簡化處理非同步事件的代碼(b)

資料結構對齊, #pragma pack 和 __attribute__((packed))

gcc中定義了兩個修改資料結構對齊的語句1. #pragma pack()2. __attribute__((packed)) #include <stdio.h>#include <stdlib.h>#include <string.h>// calculate the offset of t in S#define offsetof(S,t)     (size_t)&(((S *)0)->t)    typedef struct _S1{ 

kernel的鏈表api

/* * ===================================================================================== * *       Filename:  list.c * *    Description:   * *        Version:  1.0 *        Created:  12/13/2010 02:27:18 PM *       Revision:  none *       Compiler: 

Intel x86 下 gcc彙編結果

GCC的組合語言用的是AT&T的文法。 源檔案:test.c#include <stdio.h>#include <fcntl.h>int swap(int *a, int *b){ int c ; c = *a;  *a = *b; *b = c; return c;}int main(int argc, char *argv[]){ int a, b, c; a = 16; b = 32; c = swap(&a, &b); return 1;

APUE讀書筆記-第13章-守護進程

第13章 守護進程13.1 引言*守護進程也稱精靈進程(daemon)是生存期較長的一種進程。它們常常在系統自舉時啟動,僅在系統關閉時才終止。因為它們沒有控制終端,所以說它們是在後台啟動並執行。UNIX系統有很多守護進程,它們執行日常事務活動13.2

block裝置 發送一個bio的過程 2.6.36

sync_request 這個是不一定的,可以call別的函數    submit_bio //這個的bio 和 bio_vec是local變數static int sync_request(struct page *page, struct block_device *bdev, int rw){    struct bio bio;    struct bio_vec bio_vec;    struct completion complete;    bio_init(&bio);

使用spinlock需要注意的事項

Concurrency IV -- Spinlock, may be used in code that can't sleepPinciples for using spinlock1. CANNOT sleep when holding a spinlock2. disable preemption before holding a apinlock   this is done by kernel, the spinlock code itself3. disable the

總頁數: 61357 1 .... 13733 13734 13735 13736 13737 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.