當前位置:首頁 » 編程軟體 » 編譯x86

編譯x86

發布時間: 2023-01-18 17:34:34

⑴ 如何編譯x86版本的bionic

oid5.0 SDK 64bit 編譯報錯
【秋佳節】碼雲陪起賞花賞月拿豪禮>>> ?
錯誤信息:
In file included from bionic/libc/kernel/uapi/linux/signal.h:21:0,
from bionic/libc/include/signal.h:45,
from bionic/libc/include/sys/select.h:35,
from bionic/libc/include/unistd.h:34,
from external/iproute2/tc/tc.c:18:
bionic/libc/include/signal.h:85:18: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
sighandler_t sa_handler;
^
2 warnings generated.
target C: tc <= external/iproute2/tc/tc_qdisc.c
target C: tc <= external/iproute2/tc/q_cbq.c
make: *** [out/target/proct/generic_arm64/obj/EXECUTABLES/tc_intermediates/tc.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from bionic/libc/kernel/uapi/linux/signal.h:21:0,
from bionic/libc/include/signal.h:45,
from bionic/libc/include/sys/select.h:35,
from bionic/libc/include/unistd.h:34,
from external/iproute2/tc/tc_qdisc.c:15:
bionic/libc/include/signal.h:85:18: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
sighandler_t sa_handler;
^
In file included from bionic/libc/kernel/uapi/linux/signal.h:21:0,
from bionic/libc/include/signal.h:45,
from bionic/libc/include/sys/select.h:35,
from bionic/libc/include/unistd.h:34,
from external/iproute2/tc/q_cbq.c:15:
bionic/libc/include/signal.h:85:18: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
sighandler_t sa_handler;
^
make: *** [out/target/proct/generic_arm64/obj/EXECUTABLES/tc_intermediates/tc_qdisc.o] Error 1

make: *** [out/target/proct/generic_arm64/obj/EXECUTABLES/tc_intermediates/q_cbq.o] Error 1
朋友碰signal.h:
....
typedef __sighandler_t sig_t; /* BSD compatibility. */
typedef __sighandler_t sighandler_t; /* glibc compatibility. */

#define si_timerid si_tid /* glibc compatibility. */

#if defined(__LP64__)
struct sigaction {
unsigned int sa_flags;
union {
sighandler_t sa_handler;
void (*sa_sigaction)(int, struct siginfo*, void*);
};
sigset_t sa_mask;
void (*sa_restorer)(void);
};
#elif defined(__mips__)
struct sigaction {
unsigned int sa_flags;
union {
sighandler_t sa_handler;
void (*sa_sigaction) (int, struct siginfo*, void*);
};
sigset_t sa_mask;
};
#endif

⑵ 編譯x86-Qtopia-2.2.0錯誤.求教大神

先說明一下幾個QT的區別:

從Qt4.1開始,Qt/Embedded改名為Qtopia Core,又從Qt4.4.1開始,Qtopia Core又改名為Qt for Embedded Linux。

我們通常所說的 Qt 都是指的用於 Linux/Unix 的 Qt/X11,真正意義上Qt 是泛指 Qt 的所有版本的圖像界面庫,比如 Qt/X11,Qt Windows, Qt Mac 等。

Qt/Embeded 的概念:它是用於嵌入式 Linux 系統的 Qt 版本,Qt/Embeded 也簡稱 Qte 或 Qt/EQte 去掉了 X Lib 的依賴而直接工作在 Framebuffer 上,雖然它是 Qt 的嵌入式版本,但是它不是 Qt/X11 的子集,它有部分機制(比如 QCOP 等)就不能用於 Qt/X11 中。
Qtopia 是一個基於 Qte 的類似桌面系統的應用環境,包含有 PDA 版本和 Phone 版本。實質上 Qtopia Core 還是基礎類庫,相當於 Qte。
最近 Qtopia Core 改名了,新名字叫做:qt-embeded-linux-xxxxxx。

以下的內容結合《基於 SKY2440/TQ2440 的 Qt/Embeded 應用程序開發完全手冊》

編譯 PC 版本的 Qtopia-2.2.0

1、准備編譯器

知道你的ubuntu10.04默認安裝的是gcc4.4,現在我們要使用gcc3.4

#apt-get install gcc-3.4

安裝後/usr/bin下就多出了gcc-3.4,原先這里有個gcc,它是指向gcc-4.4的軟鏈接,現在我們要讓它指向gcc-3.4

#rm gcc

#ln -s /usr/bin/gcc-3.4 /usr/bin/gcc

測試一下

$gcc -v

注意:在編譯PC版本的qt4.5時我們又需要把gcc的版本從3.4升到4.4

2、解壓

#tar xvfj Qte_20110601.tar.bz2 -C /

在「Linux 資源\Linux 平台開發工具包\」裡面

?arm-qtopia-2.2.0_build:將 qtopia-2.2.0.tar.bz2 源碼編譯成 ARM 版本,並且編譯 tslib-1.4.1.tar.bz2 源碼和 EmbedSky_apps.tar.bz2 源碼。

? arm-qtiopia-2.2.0-konqueror_build:在 arm-qtopia-2.2.0_build 的基礎上增加了 konqueror.tar.bz2 的 編 譯 。

? setARM_QpeEnv:設置 ARM 版本的環境變數的腳本

? setX86_QpeEnv:設置 X86 版本的環境變數的腳本。

? x86-qtopia-2.2.0_build:將 qtopia-2.2.20tar.bz2 源碼編成 PC 版本。

? x86-qtopia-2.2.0-konqeror_build:在 x86-qtopia-2.2.0_build 的基礎上增加了 konqueror.tar.bz2 的編譯。

? EmbedSky_apps.tar.bz2:後面幾個章節講到的應用程序的源碼合集(Makefile 文件基於 ARM 的,可以利用該源碼包自行生成 x86 版本的 Makefile 文 件 )。

? konqueror.tar.bz2:Web 瀏覽器的源碼。

? qtopia-2.2.0.tar.bz2:qtopia-2.2.0 的源碼。

? test_x86:當 PC 版本的 Qtopia-2.2.0 編譯成功後,模擬時運行該腳本。

? tslib-1.4.1.tar.bz2:觸摸校正的源碼

3、#./x86-qtopia-2.2.0-kongqueror_build

這一步會發生很多錯誤,下面幾步來修正。

以下內容參照



4、修改幾處代碼源文件

修改x86-qtopia-2.2.0/qt2/src/tools/qmemoryfile_unix.cpp 143行

if (!f)
f = ::pen(tmpFile.latin1(), O_CREAT | O_WRONLY);
修改為
if (!f)
f = ::pen(tmpFile.latin1(), O_CREAT | O_WRONLY, 0666);

修改x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/qmemoryfile_unix.cpp 141行

if (!f)
f = ::pen(tmpFile.latin1(), O_CREAT | O_WRONLY);
修改為
if (!f)
f = ::pen(tmpFile.latin1(), O_CREAT | O_WRONLY, 0666);

修改/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/backend/vobject.cpp:419行
char *dot = strrchr(g,'.');

char *dot = (char*)strrchr(g,'.');

修正/x86-qtopia-2.2.0/qtopia/src/plugins/codecs/wavplugin/wavplugin.cpp:435行
char *ext = strrchr( path.latin1(), '.' );
改為
char *ext = (char*)strrchr( path.latin1(), '.' );

修改x86-qtopia-2.2.0-konqueror_biuld的第26行,

. setQpeEnv
改為
./setQpeEnv

5、安裝一些包

# sudo apt-get install libx11-dev x11proto-xext-dev libqt3-mt-dev uuid-dev

6、手動設置環境變數,然後執行腳本

#source ./x86-qtopia-2.2.0/setQpeEnv

#./x86-qtopia-2.2.0-kongqueror_build

7、PC 模擬 Qtopia-2.2.0

#./test_x86

編譯 ARM 版本的 Qtopia-2.2.0

1、准備交叉編譯器

#tar xvfj EABI_4.3.3_EmbedSky_20091210.tar.bz2 -C /

然後新的交叉編譯器就在/opt/EmedSky/4.3.3/bin下面,把這個路徑放到/etc/environment中,source一下

#which arm-linux-gcc;確保當前的交叉編譯器就是/opt/EmedSky/4.3.3/bin下的那個,因為你之前可能裝過其他版本的交叉編譯器,並且把它的路徑也放到了PATH中,並且還在/opt/EmedSky/4.3.3/bin在前面,那就不對了。

2、#./arm-qtopia-2.2.0-kongqueror_build

這一步過程中會有一些錯誤,下面幾步來修正

3、 修改arm-qtopia-2.2.0/qt2/src/tools/qmemoryfile_unix.cpp 143行

if (!f)
f = ::pen(tmpFile.latin1(), O_CREAT | O_WRONLY);
修改為
if (!f)
f = ::pen(tmpFile.latin1(), O_CREAT | O_WRONLY, 0666);

4、手動設置環境變數,然後執行腳本

# source ./arm-qtopia-2.2.0/setQpeEnv

#./arm-qtopia-2.2.0-kongqueror_build

最後顯示done!成功。

至於2.3節所講的製作包含 Qtopia-2.2.0 的文件系統工作就不需要做了天嵌製作好的文件系統裡面已經包含了。

開發第一個Qt程序

依照天嵌資料第三章講的去做。不過有三點需要注意

(1)在main.cpp中印少了一個右括弧

(2)Makefile文件要改的地方不僅僅是紅色標注的地方。紅色標注的只是要添加的內容,還有一些地重復了,要刪除。直接把資料上給的Makefile復制過來也有一些問題。如果是自己改注意最後一下文件項後面不能要「\",比如

OBJECTS = first.o \

main.o

main.o後面就不能要「\"。

(3)當編譯好arm版本的first程序後,first、first.png、first.desktop是在資料所說的三個位置,但是「把三個文件放到開發板的相應位置」怎麼理解呢?

把first放到開發板的/opt/Qtopia/bin/ 下;first.png放到/opt/Qtopia/pics/下;first.desktop放到/Qtopia/apps/EmbedSky/下

⑶ 如何編譯android x86模擬器

首先你需要設置一下emulator工具的目錄之類的
要在.bashrc中新增環境變數,如下
ANDROID_PRODUCT_OUT=~/android/out/target/proct/generic
ANDROID_PRODUCT_OUT_bin=~/android/out/host/linux-x86/bin
這里是設置你的輸出文件的位置和bin工具目錄
然後在命令行輸入:
export path=${path}:${ANDROID_PRODUCT_OUT_bin}:${ANDROID_PRODUCT_OUT};
上面是導入了相關的配置,然後使之生效。
source ~/.bashrc
接著切換到輸出的system文件夾
cd ~/android/out/target/proct/generic
然後來創建模擬器
emulator -system system.img -data userdata.img -ramdisk ramdisk.img
如果你運氣夠好的話,也許現在已經在運行了,不過我運氣明顯不夠好。
提示一:
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android sdk user, please use 『@<name>』 or 『-avd <name>』
to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator

既然人家提示了,那就按照步驟走吧,輸入命令:
emulator -help-avd
接著提示如下:
use 『-avd <name>』 to start the emulator program with a given Android
Virtual Device (a.k.a. AVD), where <name> must correspond to the name
of one of the existing AVDs available on your host machine.
See -help-virtual-device to learn how to create/list/manage AVDs.
As a special convenience, using 『@<name>』 is equivalent to using
『-avd <name>』.
跟著提示繼續走,輸入命令:
emulator -help-virtual-device
又是提示了:
An Android Virtual Device (AVD) models a single virtual
device running the Android platform that has, at least, its own
kernel, system image and data partition.
Only one emulator process can run a given AVD at a time, but
you can create several AVDs and run them concurrently.
You can invoke a given AVD at startup using either 『-avd <name>』
or 『@<name>』, both forms being equivalent. For example, to launch
the AVD named 『foo』, type:
emulator @foo
The 『android』 helper tool can be used to manage virtual devices.
For example:
android create avd -n <name> -t 1 # creates a new virtual device.
android list avd # list all virtual devices available.
Try 『android –help』 for more commands.
Each AVD really corresponds to a content directory which stores
persistent and writable disk images as well as configuration files.
Each AVD must be created against an existing sdk platform or add-on.
For more information on this topic, see -help-sdk-images.

延伸1):
Android x86模擬器Intel Atom x86 System Image配置與使用方法

大家現在開發使用的Android 模擬器模擬的是 arm 的體系結構(arm-eabi),因此模擬器並不是運行在x86上而是模擬的arm,所以我們調試程序的時候經常感覺到非常慢,大部分開發者應該都深有體會。
針對這種情況,前段時間intel推出了支持x86的Android模擬器,這將大大提高啟動速度和程序的運行速度,這將允許Android模擬器能夠以原始速度(真機運行速度)運行在使用intel x86處理器的電腦中,各位開發者有福了,下面將為大家展示使用方法。

一、首先下載intel提供的 intel® Hardware Accelerated Execution Manager 1.0.1(R2)

requirement:
1. requires the Android* SDK to be installed (version 17 or higher). SDK17或者以上
2.intel® processor with support for VT-x, EM64T, and Execute Disable (XD) bit functionality intel的cpu:並支持VT-X(虛擬化技術)、可擴展64位、Execute Disable bit。(均需要保證在bios中開啟Enable)
3. At least 1 gb of available ram 1G以上內存,否則安裝不了

滿足硬體和軟體要求之後,就可以開始安裝了,一直下一步至安裝成功。途中有個地方選擇分配給HAXM內存大小,一般默認就好,分太多會拖慢整機速度。

安裝成功後命令行輸入sc query intelhaxm,查看運行狀態: state is: 「4 RUNNING」 ,即代表安裝成功。需要更改分配內存,重新運行一下安裝程序選擇change即可修改。
還可以使用以下指令手動開啟和關閉:
Stop: sc stop intelhaxm

Start:
sc start intelhaxm

滿足軟硬體條件,若提示如下Error:but intel Execute Disable bit (XD) is not turned on......
(需要開啟系統數據執行保護功能dep,下午糾結了好久才查到。官網原文:Windows* hosts may need to enable dep (Data Execution Prevention) in addition to intel XD)
命令行使用指令:bcdedit.exe /set nx optin 打開即可,需要重啟電腦

二、下載Intel Atom x86 System Image
1. 從SDK Manager下載:打開SDK Manager,展開至Android2.3.3(API10)(注意:目前只有2.3.3和4.0.3(Ice Cream Sandwich)有x86的Image),需要和2.3.3的SDK Platform配合使用。

2.使用avd Manager創建一個新的avd: Hardware Property裡面選擇gpu emulation yes 還有 Keyboard support yes

3.開始使用飛速的模擬器吧,各種爽歪歪
好的工具可以更有效率的開發APP,讓我們從此告別那龜速的模擬器吧

⑷ 大家編譯一個x86的Linux內核需要多長時間

make 時加參數 -jX
X 是你的 CPU 核心數量 +1 。
可以加快你的編譯速度。

我的本本 T5450 編譯需要 10 分鍾。我的內核是針對機器剪裁了的。不剪裁的全功能內核貌似我就需要 30 分鍾了。

⑸ 怎麼編譯linux x86

首先你需要設置一下emulator工具的目錄之類的,這個不細說了,
要在.bashrc中新增環境變數,如下
ANDROID_PRODUCT_OUT=~/android/out/target/proct/generic
ANDROID_PRODUCT_OUT_BIN=~/android/out/host/linux-x86/bin
這里是設置你的輸出文件的位置和bin工具目錄,不用多解釋吧?
然後在命令行輸入:
export PATH=${PATH}:${ANDROID_PRODUCT_OUT_BIN}:${ANDROID_PRODUCT_OUT};
上面是導入了相關的配置,然後使之生效。
source ~/.bashrc
接著切換到輸出的system文件夾
cd ~/android/out/target/proct/generic
然後來創建模擬器
emulator -system system.img -data userdata.img -ramdisk ramdisk.img
如果你運氣夠好的話,也許現在已經在運行了,不過我運氣明顯不夠好。
提示一:
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android SDK user, please use 『@<name>』 or 『-avd <name>』
to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator

既然人家提示了,那就按照步驟走吧,輸入命令:
emulator -help-avd
接著提示如下:
use 『-avd <name>』 to start the emulator program with a given Android
Virtual Device (a.k.a. AVD), where <name> must correspond to the name
of one of the existing AVDs available on your host machine.
See -help-virtual-device to learn how to create/list/manage AVDs.
As a special convenience, using 『@<name>』 is equivalent to using
『-avd <name>』.
跟著提示繼續走,輸入命令:
emulator -help-virtual-device
又是提示了:
An Android Virtual Device (AVD) models a single virtual
device running the Android platform that has, at least, its own
kernel, system image and data partition.
Only one emulator process can run a given AVD at a time, but
you can create several AVDs and run them concurrently.
You can invoke a given AVD at startup using either 『-avd <name>』
or 『@<name>』, both forms being equivalent. For example, to launch
the AVD named 『foo』, type:
emulator @foo
The 『android』 helper tool can be used to manage virtual devices.
For example:
android create avd -n <name> -t 1 # creates a new virtual device.
android list avd # list all virtual devices available.
Try 『android –help』 for more commands.
Each AVD really corresponds to a content directory which stores
persistent and writable disk images as well as configuration files.
Each AVD must be created against an existing SDK platform or add-on.
For more information on this topic, see -help-sdk-images.

⑹ XCode12 編譯x86_64的framework

參考以下步驟 單獨編譯x86_64

1.找到需要編譯的target 切換到build Settings中將

更改為

2.將

⑺ 如何編譯linux的x86內核

Gcc編譯器, Linux-2.6.29內核

步驟:

(一):清除臨時文件,中間文件和配置文件等(剛從網上下載下來的文件這步可省略)。

make clean

刪除大多數的由編譯生成的文件、但會保留內核的配置文件.config。

make mrproper

刪除所有的編譯生成的文件,還有內核配置文件,再加上各種備份文件。

make distclean

mrproper刪除的文件,加上編輯備份文件和一些補丁文件。

(二)選擇參考配置文件

使用正在運行的內核配置文件作為參考配製文件,該配置文件在/boot目錄下,使用命令

cp /boot/config-2.6.18-53.el5 .config。

(三)配置內核

配置內核有如下命令:

make config:基於文件模式的互動式配置(也就是一問一答)。

make menuconfig:基於文本模式的菜單式配置(強烈推薦)。

make oldconfig:使用已有的配置文件(.config)但是會詢問新增的配置選項。

make xconfig:圖形化配置(需要安裝圖形化系統)。

make menuconfig是最為常用的內核配置方式,使用方法如下:

1、使用方向鍵在各選項間移動;

2、使用「Enter」鍵進入下一層選單;每個選項上的高亮字母是鍵盤快捷方式,使用它可以快速地到達想要設置的選單項。

3、在括弧中按「y」將這個項目編譯進內核中,按「m」編譯為模塊,按「n」為不選擇(按空格鍵也可在編譯進內核、編譯為模塊和不編譯三者間進行切換),按「h」將顯示這個選項的幫助信息,按「Esc」鍵將返回到上層選單。

內核配置通常在一個已有的配置文件基礎上,通過修改得到新的配置文件Linux內核提供了一系列可供參考的內核配置文件,位於Arch/$cpu/configs

注意:要運行make menuconfig的界面需要調整終端的窗口大小,至少為80*19。

(四)編譯內核

(1):make zImage

(2):make bzImage

區別:在X86平台,在zImage只能用於小於512Kd的內核(注意是X86平台)

如需獲取詳細編譯信息,可使用:

make zImage V=1

make bzImage V=1

編譯好的內核位於arch/<cpu>/boot目錄下

(五)編譯內核模塊

使用命令make moles

內核模塊編譯的時間比較長,一般需要1~2小時的時間。這些模塊源於使用命令make menuconfig啟動的菜單型配置界面中選擇<m>的項。

(六)安裝內核模塊

使用命令:make moles_install,完成安裝後,編譯好的內核模塊會從內核源代碼目錄拷貝至/lib/moles/2.6.29目錄下。

(七)製作init ramdisk

使用cd跳動linux-2.6.29/,目錄的上層目錄,使用命令:mkinitrdinitrd-$version $version(mkinitrd initrd-2.6.29 2.6.29)將上一步中產生的模塊目錄/lib/moles/2.6.29製作成initrd-2.6.29。

提示:initrd是「initial ramdisk」的縮寫,initrd是在實際根文件系統可用之前掛載到系統中的一個初始根文件系統。在桌面或伺服器Linux系統中,initrd是一個臨時的文件系統。其生命周期很短,只會用作真實文件系統的一個橋梁。在沒有存儲設備的嵌入式系統中,initrd可以是永久的根文件系統。

Linux的眾多發行版之所以使用initrd主要是為了在內核啟動之後能夠判斷哪些硬體驅動需要載入,哪些不需要,文件系統有沒有問題等,最終使得根分區能順利載入。在scsi和sata設備上啟動,usb啟動盤,無盤伺服器等都需要initrd來做判斷,這樣可以提高Linux內核的通用性。

(八)安裝內核

由於Linux系統啟動時,會從/boot目錄下尋找內核文件與init ramdisk,所以需要將內核和initrd拷貝至/boot目錄。使用命令:

cp initrd-2.6.29 /boot

cp linux-2.6.29/arch/x86/boot/bzImage /boot/vmlinuz-2.6.29

(九)修改/etc/grub.conf或者/etc/lilo.conf

為了讓grub在啟動時能提供一項我們自己製作的linux內核的選項,需要修改grub的配置文件/etc/grub.conf。(添加的代碼為title My Linux(2.6.29)以下的)

注意:/etc/grub.conf實際上是/boot/grub/grub.conf的一個鏈接,因此真正的配置文件存在與/boot/grub目錄下。

⑻ x86linux 怎麼編譯內核

內核,是一個操作系統的核心。它負責管理系統的進程、內存、設備驅動程序、文件和網路系統,決定著系統的性能和穩定性。Linux作為一個自由軟體,
在廣大愛好者的支持下,內核版本不斷更新。新的內核修訂了舊內核的bug,並增加了許多新的特性。如果用戶想要使用這些新特性,或想根據自己的系統度身定
制一個更高效,更穩定的內核,就需要重新編譯內核。本文將以RedHat Linux 6.0(kernel
2.2.5)為操作系統平台,介紹在Linux上進行內核編譯的方法。

一、 下載新內核的源代碼

目前,在Internet上提供Linux源代碼的站點有很多,讀者可以選擇一個速度較快的站點下載。筆者是從站點 上下載了Linux的最新開發版內核2.3.14的源代碼,全部代碼被壓縮到一個名叫Linux-2.3.14.tar.gz的文件中。

二、 釋放內核源代碼

由於源代碼放在一個壓縮文件中,因此在配置內核之前,要先將源代碼釋放到指定的目錄下。首先以root帳號登錄,然後進入/usr/src子目錄。如果用戶在安裝Linux時,安裝了內核的源代碼,則會發現一個linux-2.2.5的子目錄。該目錄下存放著內核2.2.5的源代碼。此外,還會發現一個指向該目錄的鏈接linux。刪除該連接,然後將新內核的源文件拷貝到/usr/src目錄中。

(一)、用tar命令釋放內核源代碼

# cd /usr/src

# tar zxvf Linux-2.3.14.tar.gz

文件釋放成功後,在/usr/src目錄下會生成一個linux子目錄。其中包含了內核2.3.14的全部源代碼。

(二)、將/usr/include/asm、/usr/inlude/linux、/usr/include/scsi鏈接到/usr/src/linux/include目錄下的對應目錄中。

# cd /usr/include

# rm -Rf asm linux

# ln -s /usr/src/linux/include/asm-i386 asm

# ln -s /usr/src/linux/include/linux linux

# ln -s /usr/src/linux/include/scsi scsi

(三)、刪除源代碼目錄中殘留的.o文件和其它從屬文件。

# cd /usr/src/linux

# make mrproper

三、 配置內核

(一)、啟動內核配置程序。

# cd /usr/src/linux

# make config

除了上面的命令,用戶還可以使用make menuconfig命令啟動一個菜單模式的配置界面。如果用戶安裝了X window系統,還可以執行make xconfig命令啟動X window下的內核配置程序。

(二)、配置內核

Linux的
內核配置程序提供了一系列配置選項。對於每一個配置選項,用戶可以回答"y"、"m"或"n"。其中"y"表示將相應特性的支持或設備驅動程序編譯進內
核;"m"表示將相應特性的支持或設備驅動程序編譯成可載入模塊,在需要時,可由系統或用戶自行加入到內核中去;"n"表示內核不提供相應特性或驅動程序
的支持。由於內核的配置選項非常多,本文只介紹一些比較重要的選項。

1、Code maturity level options(代碼成熟度選項)

Prompt for development and/or incomplete code/drivers
(CONFIG_EXPERIMENTAL) [N/y/?]
如果用戶想要使用還處於測試階段的代碼或驅動,可以選擇「y」。如果想編譯出一個穩定的內核,則要選擇「n」。

1、 Processor type and features(處理器類型和特色)

(1)、Processor family (386, 486/Cx486, 586/K5/5x86/6x86, Pentium/K6/TSC, PPro/6x86MX) [PPro/6x86MX] 選擇處理器類型,預設為Ppro/6x86MX。

(2)、Maximum Physical Memory (1GB, 2GB) [1GB] 內核支持的最大內存數,預設為1G。

(3)、Math emulation (CONFIG_MATH_EMULATION) [N/y/?] 協處理器模擬,預設為不模擬。

(4)、MTRR (Memory Type Range Register) support (CONFIG_MTRR) [N/y/?]

選擇該選項,系統將生成/proc/mtrr文件對MTRR進行管理,供X server使用。

(5)、Symmetric multi-processing support (CONFIG_SMP) [Y/n/?] 選擇「y」,內核將支持對稱多處理器。

2、 Loadable mole support(可載入模塊支持)

(1)、Enable loadable mole support (CONFIG_MODULES) [Y/n/?] 選擇「y」,內核將支持載入模塊。

(2)、Kernel mole loader (CONFIG_KMOD) [N/y/?] 選擇「y」,內核將自動載入那些可載入模塊,否則需要用戶手工載入。

3、 General setup(一般設置)

(1)、Networking support (CONFIG_NET) [Y/n/?] 該選項設置是否在內核中提供網路支持。

(2)、PCI support (CONFIG_PCI) [Y/n/?] 該選項設置是否在內核中提供PCI支持。

(3)、PCI access mode (BIOS, Direct, Any) [Any] 該選項設置Linux探測PCI設備的方式。選擇「BIOS」,Linux將使用BIOS;選擇「Direct」,Linux將不通過BIOS;選擇「Any」,Linux將直接探測PCI設備,如果失敗,再使用BIOS。

(4)Parallel port support (CONFIG_PARPORT) [N/y/m/?] 選擇「y」,內核將支持平行口。

4、 Plug and Play configuration(即插即用設備支持)

(1)、Plug and Play support (CONFIG_PNP) [Y/m/n/?] 選擇「y」,內核將自動配置即插即用設備。

(2)、ISA Plug and Play support (CONFIG_ISAPNP) [Y/m/n/?] 選擇「y」,內核將自動配置基於ISA匯流排的即插即用設備。

5、 Block devices(塊設備)

(1)、Normal PC floppy disk support (CONFIG_BLK_DEV_FD) [Y/m/n/?] 選擇「y」,內核將提供對軟盤的支持。

(2)、Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support (CONFIG_BLK_DEV_IDE) [Y/m/n/?] 選擇「y」,內核將提供對增強IDE硬碟、CDROM和磁帶機的支持。

6、 Networking options(網路選項)

(1)、Packet socket (CONFIG_PACKET) [Y/m/n/?] 選擇「y」,一些應用程序將使用Packet協議直接同網路設備通訊,而不通過內核中的其它中介協議。

(2)、Network firewalls (CONFIG_FIREWALL) [N/y/?] 選擇「y」,內核將支持防火牆。

(3)、TCP/IP networking (CONFIG_INET) [Y/n/?] 選擇「y」,內核將支持TCP/IP協議。

(4)The IPX protocol (CONFIG_IPX) [N/y/m/?] 選擇「y」,內核將支持IPX協議。

(5)、Appletalk DDP (CONFIG_ATALK) [N/y/m/?] 選擇「y」,內核將支持Appletalk DDP協議。

8、SCSI support(SCSI支持)

如果用戶要使用SCSI設備,可配置相應選項。

9、Network device support(網路設備支持)

Network device support (CONFIG_NETDEVICES) [Y/n/?] 選擇「y」,內核將提供對網路驅動程序的支持。

10、Ethernet (10 or 100Mbit)(10M或100M乙太網)

在該項設置中,系統提供了許多網卡驅動程序,用戶只要選擇自己的網卡驅動就可以了。此外,用戶還可以根據需要,在內核中加入對FDDI、PPP、SLIP和無線LAN(Wireless LAN)的支持。

11、Character devices(字元設備)

(1)、Virtual terminal (CONFIG_VT) [Y/n/?] 選擇「y」,內核將支持虛擬終端。

(2)、Support for console on virtual terminal (CONFIG_VT_CONSOLE) [Y/n/?]

選擇「y」,內核可將一個虛擬終端用作系統控制台。

(3)、Standard/generic (mb) serial support (CONFIG_SERIAL) [Y/m/n/?]

選擇「y」,內核將支持串列口。

(4)、Support for console on serial port (CONFIG_SERIAL_CONSOLE) [N/y/?]

選擇「y」,內核可將一個串列口用作系統控制台。

12、Mice(滑鼠)

PS/2 mouse (aka "auxiliary device") support (CONFIG_PSMOUSE) [Y/n/?] 如果用戶使用的是PS/2滑鼠,則該選項應該選擇「y」。

13、Filesystems(文件系統)

(1)、Quota support (CONFIG_QUOTA) [N/y/?] 選擇「y」,內核將支持磁碟限額。

(2)、Kernel automounter support (CONFIG_AUTOFS_FS) [Y/m/n/?] 選擇「y」,內核將提供對automounter的支持,使系統在啟動時自動 mount遠程文件系統。

(3)、DOS FAT fs support (CONFIG_FAT_FS) [N/y/m/?] 選擇「y」,內核將支持DOS FAT文件系統。

(4)、ISO 9660 CDROM filesystem support (CONFIG_ISO9660_FS) [Y/m/n/?]

選擇「y」,內核將支持ISO 9660 CDROM文件系統。

(5)、NTFS filesystem support (read only) (CONFIG_NTFS_FS) [N/y/m/?]

選擇「y」,用戶就可以以只讀方式訪問NTFS文件系統。

(6)、/proc filesystem support (CONFIG_PROC_FS) [Y/n/?] /proc是存放Linux系統運行狀態的虛擬文件系統,該項必須選擇「y」。

(7)、Second extended fs support (CONFIG_EXT2_FS) [Y/m/n/?] EXT2是Linux的標准文件系統,該項也必須選擇「y」。

⑼ 編譯在X86平台下運行的linux內核出錯 make: Warning: File `.config' has modification time 6.5e+02 s in

出現這種錯誤有可能是因為工程在別的電腦上一直到當前的電腦上,進行編譯出現的。主要是因為兩個環境的時間不對應。

原因:window的時間和虛擬機上的時間有差異。
解決:修改虛擬機上的時間。
指令1:sudo date -s 02/19/2021 //月、日、年
指令2:sudo date -s 14:46:00 //時、分、秒

⑽ 大家編譯一個x86的Linux內核需要多長時間

make
時加參數
-jX
X
是你的
CPU
核心數量
+1

可以加快你的編譯速度。
我的本本
T5450
編譯需要
10
分鍾。我的內核是針對機器剪裁了的。不剪裁的全功能內核貌似我就需要
30
分鍾了。

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:705
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:969
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:677
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:831
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:738
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1077
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:309
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:189
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:875
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:831