Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 控制台初始化导致内核死机_Linux_Embedded_Console_Debian_Arm - Fatal编程技术网

Linux 控制台初始化导致内核死机

Linux 控制台初始化导致内核死机,linux,embedded,console,debian,arm,Linux,Embedded,Console,Debian,Arm,系统详细信息: 操作系统:Debian/5.0内核2.6.26-2 i686 SMP 硬件:IBM Thinkpad T40 2373型奔腾M 1.5GHz,512MB RAM 来源:sudo apt get install linux-source-2.6.18 linux-patch-debian-2.6.18 linux-support-2.6.18-5 工具链:scratchbox安装的arm-linux-gcc3.4.cs-uclibc0.9.27 arm linux uclibc g

系统详细信息:

操作系统:Debian/5.0内核2.6.26-2 i686 SMP

硬件:IBM Thinkpad T40 2373型奔腾M 1.5GHz,512MB RAM

来源:sudo apt get install linux-source-2.6.18 linux-patch-debian-2.6.18 linux-support-2.6.18-5

工具链:scratchbox安装的arm-linux-gcc3.4.cs-uclibc0.9.27

arm linux uclibc gcc/-g++-v:

Reading specs from /scratchbox/compilers/arm-linux-gcc3.4.cs-uclibc0.9.27/lib/gcc/arm-linux-uclibc/3.4.2/specs
Configured with: /home/larimo/sb-toolchains/cc/gcc-jp-pass2/work/gcc-2004-q3d/configure --target=arm-linux-uclibc   --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --prefix=/scratchbox/compilers/arm-linux-gcc3.4.cs-uclibc0.9.27 --enable-languages=c,c++ --program-prefix=arm-linux-uclibc- --enable-shared --enable-static --with-sysroot=/scratchbox/compilers/arm-linux-gcc3.4.cs-uclibc0.9.27 --with-local-prefix=/scratchbox/compilers/arm-linux-gcc3.4.cs-uclibc0.9.27 --enable-symvers=gnu --with-gnu-ld  Thread model: posix gcc version 3.4.2 (release) (CodeSourcery ARM Q3D 2004)
qemu系统臂:v0.9.1

qemu命令行:qemu系统arm-m32-m integratorcp-kernelzimage-serialstdio-S-S

gdb命令行:arm-uclibc-gdb--command=gdb_commands.vim--symbols/usr/src/linux-source-2.6.18/vmlinux

内核配置:

我最终放弃了寻找调用的
\uu dabt\usvc

有几个有趣的地方:

  • 即使某些变量/函数在范围内(例如,
    inb_p
    ),也不可能检查并设置它们的中断
  • 我曾经尝试过在没有优化的情况下编译,-O和-O2,但没有成功地引导过这个问题
    • inb_p
      ,man文档清楚地说明了您需要使用-O或-O2进行编译;否则,子例程可能无法内联
  • 尽管它会在屏幕上打印“解压缩Linux…..好的,启动内核”消息,但一旦它开始初始化控制台,您就盲目了。内核不会将任何其他内容打印到屏幕上。没有漂亮的打印紧急消息-您必须进入
    \uu show\u regs()
    并手动窥探所有相关寄存器(pc、fsr等)。这并不像听起来那么难。这听起来很乏味
  • 我相信我已经为ARM和Debian应用了所有相关补丁
  • 我准备像一个膝盖被剥皮的小女孩一样哭泣

如果有一双新眼睛,或者至少是朝着正确的方向点头,我会非常感激。提前感谢您阅读本文,并感谢您提供的任何帮助。

看来QEMU在其Arm integrator仿真中没有模拟VGA设备


查看可能的解决方法。

什么是内核命令行?您应该首先使用 像这样的一句话:

console=/dev/ttyS0
console=/dev/ttyS0

然后消息应该开始流动。如果您的内核过早死亡,您还可以尝试以下方法:

Index: .kernel/kernel/printk.c
===================================================================
--- .kernel.orig/kernel/printk.c    2009-02-28 02:52:32.000000000 +0100
+++ .kernel/kernel/printk.c 2009-04-30 14:12:29.000000000 +0200
@@ -41,6 +41,7 @@
 {
 }

+extern void printascii(const char *);
 #define __LOG_BUF_LEN  (1 << CONFIG_LOG_BUF_SHIFT)

 /* printk's without a loglevel use this.. */
@@ -552,7 +553,7 @@

    /* Emit the output into the temporary buffer */
    printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
-
+        printascii(printk_buf);
    if (printed_len > 0) {
        unsigned int loglevel;
        int mark_len;
索引:.kernel/kernel/printk.c
===================================================================
---.kernel.orig/kernel/printk.c 2009-02-28 02:52:32.000000000+0100
+++.kernel/kernel/printk.c 2009-04-30 14:12:29.000000000+0200
@@ -41,6 +41,7 @@
{
}
+外部无效打印ASCII(常量字符*);

#定义日志(1)我被迫删除顶级内核makefile,因为它占用了太多的空间。对它唯一的更改是:ARCH?=arm CROSS_COMPILE?=/scratchbox/compilers/arm-linux-gcc3.4.cs-uclibc0.9.27/bin/arm-linux-uclibc-HOSTCFLAGS=-Wall-Wstrict prototype-g hostcxflags=-gYeah,我想知道这一点。我以前点击过这个链接,我想知道看起来他们在使用不同的机器仿真(versatilepb)。我以前也能做到这一点。但后来我发现一个中文网站,似乎暗示我正在努力做的事情是可以做到的。我说不出来,因为我看不懂中文。如果有人感兴趣的话:Shodanex,这是重点。工作很有魅力。我本来打算做这样的事情,但不知道如何处理它。这是你自己的吗?如果不是,你是在哪里发现的?你怎么知道这会起作用?printascii从哪里来?谢谢你的帮助!我一直在定制硬件上使用各种ARM处理器,如果你第一次没有弄对,那么你至少需要一些调试帮助。串行控制台是ARM上的标准,而且当人们被一个默默失败的内核所困扰时,printascii黑客经常出现在ARM linux邮件列表中。
#0  __do_kernel_fault (mm=0xc0225f28, addr=53, fsr=53, regs=0x30001)
    at arch/arm/mm/fault.c:82
#1  0xc002a03c in do_bad_area (tsk=0xc0228340, mm=0xc0225e34, 
    addr=3221397564, fsr=53, regs=0xc0225f28) at arch/arm/mm/fault.c:145
#2  0xc002a2fc in do_translation_fault (addr=3223477848, fsr=53, 
    regs=0xc0225f28) at arch/arm/mm/fault.c:356
#3  0xc002a39c in do_DataAbort (addr=3992978394, fsr=53, 
    regs=0xc0225f28) at arch/arm/mm/fault.c:450
#4  0xc0023848 in __dabt_svc () at proc_fs.h:194
#5  0xc0023848 in __dabt_svc () at proc_fs.h:194
#6  0xc0023848 in __dabt_svc () at proc_fs.h:194
#7  0xc0023848 in __dabt_svc () at proc_fs.h:194
#8  0xc0023848 in __dabt_svc () at proc_fs.h:194
#9  0xc0023848 in __dabt_svc () at proc_fs.h:194
...
#1500  0xc0023848 in __dabt_svc () at proc_fs.h:194
...
#15000  0xc0023848 in __dabt_svc () at proc_fs.h:194
...
Index: .kernel/kernel/printk.c
===================================================================
--- .kernel.orig/kernel/printk.c    2009-02-28 02:52:32.000000000 +0100
+++ .kernel/kernel/printk.c 2009-04-30 14:12:29.000000000 +0200
@@ -41,6 +41,7 @@
 {
 }

+extern void printascii(const char *);
 #define __LOG_BUF_LEN  (1 << CONFIG_LOG_BUF_SHIFT)

 /* printk's without a loglevel use this.. */
@@ -552,7 +553,7 @@

    /* Emit the output into the temporary buffer */
    printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
-
+        printascii(printk_buf);
    if (printed_len > 0) {
        unsigned int loglevel;
        int mark_len;