簡體   English   中英

如何模擬ARM處理器運行時環境並將Linux內核模塊加載到其中?

[英]How to simulate an ARM processor run-time environment and load a Linux kernel module into it?

我嘗試將我的vmlinux加載到gdb並使用ARM核心模擬器。

但我無法理解為什么我會得到Undefined target command: "sim".

這是shell輸出:

$ arm-eabi-gdb vmlinux
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /repo/kernel/kernel/vmlinux...done.
(gdb) target sim
Undefined target command: "sim".  Try "help target".
(gdb) help target
Connect to a target machine or process.
The first argument is the type or protocol of the target machine.
Remaining arguments are interpreted by the target protocol.  For more
information on the arguments for a particular protocol, type
`help target ' followed by the protocol name.

List of target subcommands:

target core -- Use a core file as a target
target exec -- Use an executable file as a target
target extended-remote -- Use a remote computer via a serial line
target record -- Log program while executing and replay execution from log
target record-core -- Log program while executing and replay execution from log
target remote -- Use a remote computer via a serial line
target tfile -- Use a trace file as a target

根據此電子郵件和手冊中的gdb目標命令頁面,您的過程是正確的。

但是, gdb configure腳本具有--disable-sim選項。 crosstool-ng項目默認使用此選項 大多數交叉編譯器都是使用這個項目Note1構建的,因為這是一個相當漫長的過程。 你的gdb很可能沒有內置的模擬器

似乎沒有用於打印gdb配置的命令行選項。 但是,運行strings -n 3 arm-eabi-gdb | grep -iw sim strings -n 3 arm-eabi-gdb | grep -iw sim應該驗證你的gdb是否有sim選項; 如果gdb中沒有sim選項,該命令將不返回任何內容。

注1:至少,Linaro,Ubuntu,Debian和Ltib使用crosstool-ng 我不確定Android套件。

GDB中的ARM模擬器不會模擬能夠運行Linux內核的ARM應用程序處理器,例如我認為它不會模擬內存管理單元。 要運行Linux,請改用QEMU及其內置gdb服務器: https//plus.google.com/100386424363328269117/posts/RhdQmjz4gBJ

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM