All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel doesn't start booting after chaning to minimum config (on qemu arm64 machine)
@ 2021-10-12 14:06 Chan Kim
  2021-10-13  7:23 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Chan Kim @ 2021-10-12 14:06 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1796 bytes --]

Hello all,

To make a minimal kernel size (with almost no driver), I copied a .config
that was used for building kernel for sparc machine using linux 3.3 several
years ago to current linux 5.4.21 version build tree.

(That .config was for kernel with interrupt controller, timer and uart so a
very basic scheduling and shell is possible.)

Then I ran 

Yes "" | make ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- oldconfig

This copies the configs and sets all the new config settings with default
values. 

(see
https://serverfault.com/questions/116299/automatically-answer-defaults-when-
doing-make-oldconfig-on-a-kernel-tree)

 

Now I can see the start_kernel function runs to the end and it's running
inside the cpu_idle function. but I don't see the first scrolling message
below that I normally should see.

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

I tried adding several CONFIG variables using menuconfig but it's still the
same.

(CONFIG_SERIAL_AMBA_PL010, CONFIG_SERIAL_AMBA_PL010_CONSOLE,
CONFIG_SERIAL_CORE, CONFIG_SERIAL_CORE_CONSOLE were already automatically
set. 

And later I tried adding CONFIG_CPU_IDLE, CONFIG_CPU_IDLE_GOV_LADDR,
CONFIG_ACPI and other ACPI related things, CONFIG_PCI_ECAM, CONFIG_PNP,
CONFIG_PNP_DEBUG_MESSAGES, .. )

And the qemu command is like this.

${QEMU_DIR}/qemu-system-aarch64 -M ${QMACHINE} -cpu cortex-a72 -kernel
${LINUX_DIR}/arch/arm64/boot/Image -initrd ${BUSYBOX_DIR}/initramfs.cpio.gz
--append "root=/dev/ram init=/init nokaslr earlycon ip=dhcp" -m 2048M
-nographic -netdev user,id=n1 -device e1000,netdev=n1

Has anyone any idea what I can add in the config or try? (with original
.config, the kernel boots ok to the bash in initramfs)

Any suggestion will be appreciated.

Thank you,

Kind regards,

Chan Kim

 


[-- Attachment #1.2: Type: text/html, Size: 4876 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: kernel doesn't start booting after chaning to minimum config (on qemu arm64 machine)
  2021-10-12 14:06 kernel doesn't start booting after chaning to minimum config (on qemu arm64 machine) Chan Kim
@ 2021-10-13  7:23 ` Greg KH
  2021-10-13  8:21   ` Chan Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-10-13  7:23 UTC (permalink / raw)
  To: Chan Kim; +Cc: kernelnewbies

On Tue, Oct 12, 2021 at 11:06:53PM +0900, Chan Kim wrote:
> Hello all,
> 
> To make a minimal kernel size (with almost no driver), I copied a .config
> that was used for building kernel for sparc machine using linux 3.3 several
> years ago to current linux 5.4.21 version build tree.
> 
> (That .config was for kernel with interrupt controller, timer and uart so a
> very basic scheduling and shell is possible.)
> 
> Then I ran 
> 
> Yes "" | make ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- oldconfig
> 
> This copies the configs and sets all the new config settings with default
> values. 
> 
> (see
> https://serverfault.com/questions/116299/automatically-answer-defaults-when-
> doing-make-oldconfig-on-a-kernel-tree)
> 
>  
> 
> Now I can see the start_kernel function runs to the end and it's running
> inside the cpu_idle function. but I don't see the first scrolling message
> below that I normally should see.
> 
> [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
> 
> I tried adding several CONFIG variables using menuconfig but it's still the
> same.
> 
> (CONFIG_SERIAL_AMBA_PL010, CONFIG_SERIAL_AMBA_PL010_CONSOLE,
> CONFIG_SERIAL_CORE, CONFIG_SERIAL_CORE_CONSOLE were already automatically
> set. 
> 
> And later I tried adding CONFIG_CPU_IDLE, CONFIG_CPU_IDLE_GOV_LADDR,
> CONFIG_ACPI and other ACPI related things, CONFIG_PCI_ECAM, CONFIG_PNP,
> CONFIG_PNP_DEBUG_MESSAGES, .. )
> 
> And the qemu command is like this.
> 
> ${QEMU_DIR}/qemu-system-aarch64 -M ${QMACHINE} -cpu cortex-a72 -kernel
> ${LINUX_DIR}/arch/arm64/boot/Image -initrd ${BUSYBOX_DIR}/initramfs.cpio.gz
> --append "root=/dev/ram init=/init nokaslr earlycon ip=dhcp" -m 2048M
> -nographic -netdev user,id=n1 -device e1000,netdev=n1
> 
> Has anyone any idea what I can add in the config or try? (with original
> .config, the kernel boots ok to the bash in initramfs)
> 
> Any suggestion will be appreciated.

There are two different ways of getting a "minimal" kernel
configuration:
	- start with a working one and remove items until something
	  breaks
	- start with a minimal config and keep adding things until it
	  works.

Usually the first option is the easier one, as it should go faster and
you can figure out exactly what is needed.  The second way is just
blindly guessing, like it seems you are doing here.

Best of luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: kernel doesn't start booting after chaning to minimum config (on qemu arm64 machine)
  2021-10-13  7:23 ` Greg KH
@ 2021-10-13  8:21   ` Chan Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Chan Kim @ 2021-10-13  8:21 UTC (permalink / raw)
  To: 'Greg KH'; +Cc: kernelnewbies


Hi Greg K-H,

> There are two different ways of getting a "minimal" kernel
> configuration:
> 	- start with a working one and remove items until something
> 	  breaks
> 	- start with a minimal config and keep adding things until it
> 	  works.
> 
> Usually the first option is the easier one, as it should go faster and you
> can figure out exactly what is needed.  The second way is just blindly
> guessing, like it seems you are doing here.
> 
> Best of luck!
> 
> greg k-h

After reading your email I thought I'd try just a couple of more additions (because gradually removing will take so long..) and tried adding the most suspicious ones. Then I found CONFIG_SERIAL_AMBA_PL011, CONFIG_SERIAL_AMBA_PL011_CONSOLE and CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST were not set! (qemu virt machine uses PL011 not PL010 which was set). After this addition, it boots ok to the shell! I was very luck.. 😊
Thank you,
Best regards,

Chan Kim





_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-13  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 14:06 kernel doesn't start booting after chaning to minimum config (on qemu arm64 machine) Chan Kim
2021-10-13  7:23 ` Greg KH
2021-10-13  8:21   ` Chan Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.