blackscreen on boot with first compiled kernel
Hey, I am trying linux kernel hacking for the very first time and following the FirstKernelPatch tutorial. On compiling, installing and rebooting from the kernel I get a blackscreen and I do not get my Ubuntu login screen or any display. I can get to a bash prompt with ctrl+alt+F1. The linux kernel of my repo is 4.5.0-rc+. I copied the existing .config file from /boot to my source tree and ran 1. make olddefconfig, 2. make 3. make modules_install install. I have an NVIDIA GPU so looked around a lot for problems with nouveau. On booting and going to bash prompt, lsmod shows that nouveau is currently loaded. Here is the log related to nouveau I got using dmesg: [ 51.631325] fb: switching to nouveaufb from VESA VGA [ 51.631646] nouveau 0000:01:00.0: NVIDIA GF119 (0d9150a1) [ 51.650290] nouveau 0000:01:00.0: bios: version 75.19.0c.00.03 [ 51.650994] nouveau 0000:01:00.0: fb: 512 MiB DDR3 [ 51.708930] nouveau 0000:01:00.0: DRM: VRAM: 512 MiB [ 51.708931] nouveau 0000:01:00.0: DRM: GART: 1048576 MiB [ 51.708935] nouveau 0000:01:00.0: DRM: TMDS table version 2.0 [ 51.708936] nouveau 0000:01:00.0: DRM: DCB version 4.0 [ 51.708938] nouveau 0000:01:00.0: DRM: DCB outp 00: 01000323 00010034 [ 51.708940] nouveau 0000:01:00.0: DRM: DCB outp 01: 02014300 00000000 [ 51.708942] nouveau 0000:01:00.0: DRM: DCB outp 02: 02011362 00020010 [ 51.708943] nouveau 0000:01:00.0: DRM: DCB conn 00: 00000340 [ 51.708944] nouveau 0000:01:00.0: DRM: DCB conn 01: 00002061 [ 51.708946] nouveau 0000:01:00.0: DRM: DCB conn 02: 00000147 [ 51.708947] nouveau 0000:01:00.0: DRM: DCB conn 03: 00001231 [ 51.708948] nouveau 0000:01:00.0: DRM: DCB conn 04: 00000400 [ 51.708949] nouveau 0000:01:00.0: DRM: DCB conn 05: 00000210 [ 51.708950] nouveau 0000:01:00.0: DRM: DCB conn 06: 00000211 [ 51.708952] nouveau 0000:01:00.0: DRM: DCB conn 07: 00000213 [ 51.763658] nouveau 0000:01:00.0: DRM: MM: using COPY0 for buffer copies [ 52.612144] nouveau 0000:01:00.0: DRM: allocated 1366x768 fb: 0x60000, bo ffff880139f19c00 [ 52.612216] fbcon: nouveaufb (fb0) is primary device Iv spent a lot of time trying to understand what is wrong but could not figure it out. I know its something very basic but since Its my first time with the linux kernel I have no idea what particularly to look for. Please let me know if you need more details than I mentioned above to help with this. Thank you, Hrush
On Thu, 31 Mar 2016 06:09:13 -0000, Hrushit Parikh said:
The linux kernel of my repo is 4.5.0-rc+. I copied the existing .config file from /boot to my source tree and ran 1. make olddefconfig, 2. make 3. make modules_install install.
You probably wanted to use 'make oldconfig' rather than 'olddefconfig'. To improve your build time a lot, try this: 1) copy that .config over. 2) Insert all your USB and other pluggable devices at least once, so they get their drivers modprobed'd. 3) Use 'make localmodconfig' - this will only make modules for devices you actually have (maybe 200) rather than the 4,000 or so a distro kernel builds. Proceed with your steps 2 and 3.
Hi Hrushit,
I am trying linux kernel hacking for the very first time and following the FirstKernelPatch tutorial.
On compiling, installing and rebooting from the kernel I get a blackscreen and I do not get my Ubuntu login screen or any display. I can get to a
bash prompt with ctrl+alt+F1.
Since you are using ubuntu I recommend distro specific kernel compilation steps because following the manual steps sometimes does not work. Though i recommend you learn them. :). Next time also try to mention the Ubuntu version you are using.
The linux kernel of my repo is 4.5.0-rc+. I copied the existing .config file from /boot to my source tree and ran 1. make olddefconfig, 2. make 3. make modules_install install.
Try the below steps let me know if it works for you, 1. Copy old configuration cp /boot/config-`'uname -r ` ./.config (Use old configuration to built the kernel) 2. Clean Working Directory "make-kpkg clean". 3. Compile the Kernel "export CONCURRENCY_LEVEL=3" ( For parallel builds, faster compilation). "fakeroot make-kpkg –-initrd –-append-to-version=-some-string-here kernel-image kernel-headers" (In append-to-version please mention the name you would like to give your custom kernel) 4. Install the kernel "sudo dpkg -i linux-header.deb" "sudo dpkg -i linux-image.deb" 5. Restart the kernel. Finally compile the kernel in home directory don't use sudo except for installing the kernel.
Hi, Here are some links that i refereed, https://help.ubuntu.com/community/Kernel/Compile https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel Hope that helps you. On Fri, Apr 1, 2016 at 6:39 AM, Anil Nair <anilcoll90@gmail.com> wrote:
Hi Hrushit,
I am trying linux kernel hacking for the very first time and following the FirstKernelPatch tutorial.
On compiling, installing and rebooting from the kernel I get a blackscreen and I do not get my Ubuntu login screen or any display. I can get to a
bash prompt with ctrl+alt+F1.
Since you are using ubuntu I recommend distro specific kernel compilation steps because following the manual steps sometimes does not work. Though i recommend you learn them. :).
Next time also try to mention the Ubuntu version you are using.
The linux kernel of my repo is 4.5.0-rc+. I copied the existing .config file from /boot to my source tree and ran 1. make olddefconfig, 2. make 3. make modules_install install.
Try the below steps let me know if it works for you,
1. Copy old configuration cp /boot/config-`'uname -r ` ./.config (Use old configuration to built the kernel) 2. Clean Working Directory "make-kpkg clean". 3. Compile the Kernel
"export CONCURRENCY_LEVEL=3" ( For parallel builds, faster compilation).
"fakeroot make-kpkg –-initrd –-append-to-version=-some-string-here kernel-image kernel-headers" (In append-to-version please mention the name you would like to give your custom kernel)
4. Install the kernel "sudo dpkg -i linux-header.deb" "sudo dpkg -i linux-image.deb"
5. Restart the kernel.
Finally compile the kernel in home directory don't use sudo except for installing the kernel.
-- -- Regards, Anil Nair
Hey Anil, Thanks a lot for your reply. Your approach worked for me!! Maybe I missed reading in the FirstKernelPatch tutorial that compile steps are OS dependent. I am running Ubuntu 14.04 and here is what I ended up doing (Based on Anil's steps) for anyone having a similar problem in future: 1. Copy old configuration (Use old configuration to built the kernel): cp /boot/config-`'uname -r ` ./.config 2. Clean Working Directory "make-kpkg clean". 3. Compile the Kernel "export CONCURRENCY_LEVEL=3" ( For parallel builds, faster compilation). "make-kpkg --initrd --revision=0.1CustomKernel kernel-image kernel-headers --rootcmd fakeroot" ( "0.1CustomKernel" can be any name of your choice to give the kernel you build a unique name. There are some restrictions on the names mentioned on make-kpkg man page --rootcmd fakeroot complained of permission denied while building kernel so I used --rootcmd sudo) 4. Install the kernel "sudo dpkg -i ../linux-header.deb" "sudo dpkg -i ../linux-image.deb" 5. Reboot machine into new kernel. Compile the kernel in home directory don't use sudo except for installing the kernel. Thanks again Anil! I can finally start familiarizing with subsystems and drivers and work towards my first kernel patch! -Hrushit ________________________________________ From: Anil Nair <anilcoll90@gmail.com> Sent: Thursday, March 31, 2016 6:09 PM To: Hrushit Parikh Cc: kernelnewbies@kernelnewbies.org Subject: Re: blackscreen on boot with first compiled kernel Hi Hrushit,
I am trying linux kernel hacking for the very first time and following the FirstKernelPatch tutorial.
On compiling, installing and rebooting from the kernel I get a blackscreen and I do not get my Ubuntu login screen or any display. I can get to a
bash prompt with ctrl+alt+F1.
Since you are using ubuntu I recommend distro specific kernel compilation steps because following the manual steps sometimes does not work. Though i recommend you learn them. :). Next time also try to mention the Ubuntu version you are using.
The linux kernel of my repo is 4.5.0-rc+. I copied the existing .config file from /boot to my source tree and ran 1. make olddefconfig, 2. make 3. make modules_install install.
Try the below steps let me know if it works for you, 1. Copy old configuration cp /boot/config-`'uname -r ` ./.config (Use old configuration to built the kernel) 2. Clean Working Directory "make-kpkg clean". 3. Compile the Kernel "export CONCURRENCY_LEVEL=3" ( For parallel builds, faster compilation). "fakeroot make-kpkg –-initrd –-append-to-version=-some-string-here kernel-image kernel-headers" (In append-to-version please mention the name you would like to give your custom kernel) 4. Install the kernel "sudo dpkg -i linux-header.deb" "sudo dpkg -i linux-image.deb" 5. Restart the kernel. Finally compile the kernel in home directory don't use sudo except for installing the kernel.
Hi Hrushit, On Fri, Apr 1, 2016 at 12:24 PM, Hrushit Parikh <parikhhrushit@hotmail.com> wrote:
Hey Anil, Thanks a lot for your reply. Your approach worked for me!! Maybe I missed reading in the FirstKernelPatch tutorial that compile steps are OS dependent.
Your welcome. :) But Please note get familiar with the basic kernel compilation process before jumping onto distro specific kernel compilation.
1. Copy old configuration (Use old configuration to built the kernel): cp /boot/config-`'uname -r ` ./.config
2. Clean Working Directory "make-kpkg clean".
3. Compile the Kernel
"export CONCURRENCY_LEVEL=3" ( For parallel builds, faster compilation).
"make-kpkg --initrd --revision=0.1CustomKernel kernel-image kernel-headers --rootcmd fakeroot"
( "0.1CustomKernel" can be any name of your choice to give the kernel you build a unique name. There are some restrictions on the names mentioned on make-kpkg man page --rootcmd fakeroot complained of permission denied while building kernel so I used --rootcmd sudo)
4. Install the kernel "sudo dpkg -i ../linux-header.deb" "sudo dpkg -i ../linux-image.deb"
5. Reboot machine into new kernel.
Compile the kernel in home directory don't use sudo except for installing the kernel.
Ya I missed a few details thanks for filling that up. :)
Thanks again Anil! I can finally start familiarizing with subsystems and drivers and work towards my first kernel patch!
Your welcome once again.:) Also there is great book that Greg KH has written, http://www.kroah.com/lkn/ (Linux Kernel In Nutshell), Its a great start for beginners, All the kernel compilation steps are mentioned in the book, be sure to read it. :) -- -- Regards, Anil Nair
participants (3)
-
Anil Nair -
Hrushit Parikh -
Valdis.Kletnieks@vt.edu