简体   繁体   English

升级Binutils和GCC后,x86_64上的内核无法启动

[英]Kernel on x86_64 not boot after upgrading Binutils and GCC

I'm not able to see ANY logs on console (even not the "Decompressing Linux... " message). 我在控制台上看不到任何日志(甚至没有“ Decompressing Linux ...”消息)。

  1. I enabled any Early Boot prints under Kernel config, at least which I know (see below Kernel configuration) 我在内核配置下启用了任何Early Boot打印,至少我知道(请参阅下面的内核配置)
  2. Tried stopping the Kernel with KDB - by adding kgdbwait at the end of kernel command line arguments in grub 尝试使用KDB停止内核-通过在grub的内核命令行参数末尾添加kgdbwait
  3. I tried to boot the kernel manually from grub 我试图从grub手动启动内核
  4. I tried to add panic() or logs at the function: asmlinkage void __init start_kernel(void) (init/main.c) 我试图在函数中添加panic()或日志: asmlinkage void __init start_kernel(void)(init / main.c)
  5. Added / Changed / Removed the loglevel=verbose Kernel command line argument (in GRUB) 添加/更改/删除了loglevel = verbose内核命令行参数(在GRUB中)
  6. Remove " quiet " from Kernel command line argument (in GRUB) 从内核命令行参数中删除“ 安静 ”(在GRUB中)
  7. Add crashkernel to Kernel command line argument (in GRUB) crashkernel添加到内核命令行参数(在GRUB中)

My Questions: 我的问题:

1) Is there other thing I can do to get early boot logs ? 1)还有什么我可以做的以获得早期启动日志?

2) Is there any additional code I need to add to Kernel debug it ? 2)我是否需要向内核调试添加其他代码?

3) Is there any other methodology to debug it ? 3)还有其他方法可以调试吗?

Binutils: 2.26.1 binutils-2.26.1-1.fc25.src.rpm Binutils: 2.26.1 binutils-2.26.1-1.fc25.src.rpm

GCC: 6.4.1 gcc-6.4.1-1.fc25.src.rpm GCC: 6.4.1 gcc-6.4.1-1.fc25.src.rpm

Kernel: 3.10.0-514.21.1 内核: 3.10.0-514.21.1

GRUB configuration GRUB配置

default=0
timeout=3
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=34 serial console

title XIV-System
        root (hd0,0)
        kernel /boot/vmlinuz init=/system/my_init console=tty0 mce=0 i8042.noaux idle=poll scsi_mod.inq_timeout=2 selinux=0 nohpet console=ttyS0,115200 earlyprintk=ttyS0,115200 kgdboc=ttyS0,115200 ro crashkernel=auto 

Kernel configuration 内核配置

- For verbos boot message

CONFIG_X86_VERBOSE_BOOTUP=y

 - For early printk

CONFIG_EARLY_PRINTK=y

CONFIG_EARLY_PRINTK_DBGP=y

 - For KGDB

CONFIG_KGDB_LOW_LEVEL_TRAP=y

CONFIG_KGDB_KDB=y

CONFIG_SERIAL_KGDB_NMI=y

CONFIG_HAVE_ARCH_KGDB=y

CONFIG_KGDB=y

CONFIG_KGDB_SERIAL_CONSOLE=y

CONFIG_KGDB_TESTS=y

 - For KDB

CONFIG_KDB_KEYBOARD=y

CONFIG_KDB_CONTINUE_CATASTROPHIC=0

I was manage to solve the problem only after debug kernel with gdb (the early boot stage), basically I found out that the kernel fails on: 仅在使用gdb调试内核后(早期启动阶段),我才设法解决问题,基本上我发现内核在以下方面失败:

(gdb) bt
#0  early_idt_handler () at arch/x86/kernel/head_64.S:407
#1  0xffff9fffffffffff in ?? ()
#2  0xffffff07ffffffff in ?? ()
#3  0xffffe0ffffffffff in ?? ()
#4  0x00000e0000000000 in ?? ()
#5  0xffffffff81bee8a0 in ?? ()
#6  0xffff880000014560 in ?? ()
#7  0xffffffff819c0120 in early_idt_handler () at arch/x86/kernel/head_64.S:374
#8  0x0000000000000400 in irq_stack_union ()
#9  0xffffffff81bee8a0 in ?? ()
#10 0x000000000000000f in irq_stack_union ()
#11 0x0000000000000000 in ?? ()

from them I looked into the Kernel source tree (for patch related to head_64.S) and applied it. 从中,我研究了内核源代码树(与head_64.S相关的补丁程序)并将其应用。 you can find the patch and it's related on: 您可以找到补丁,它与以下内容有关:

commit 5f020130d5360e8266e369dc2b5f4e32ec5b05f4 (HEAD -> my_commit)
Author: Andy Lutomirski <luto@kernel.org>
Date:   Fri May 22 16:15:47 2015 -0700

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM