[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: When qemu starts kernel image (given by -kernel option), deos it ini
From: |
ckim |
Subject: |
RE: When qemu starts kernel image (given by -kernel option), deos it initialize CPU registers like firmwares and bootloaders do before kernel loading? |
Date: |
Sun, 17 Jan 2021 00:28:40 +0900 |
Hi, that answers my question.
Thank you very much!
Chan Kim
> -----Original Message-----
> From: Peter Maydell <peter.maydell@linaro.org>
> Sent: Saturday, January 16, 2021 9:55 PM
> To: Chan Kim <ckim@etri.re.kr>
> Cc: qemu-discuss <qemu-discuss@nongnu.org>
> Subject: Re: When qemu starts kernel image (given by -kernel option), deos
> it initialize CPU registers like firmwares and bootloaders do before
> kernel loading?
>
> On Sat, 16 Jan 2021 at 06:18, <ckim@etri.re.kr> wrote:
> > My question is the same as the email subject.
> >
> > When qemu starts kernel image (given by -kernel option), deos it
> initialize CPU registers like firmwares and bootloaders do before kernel
> loading?
>
> The behaviour of -kernel depends on the target CPU type, the machine type,
> and also on what kind of file you pass to it. So it's not possible to say
> much in general.
> In some cases it will do CPU register setup, in some cases not.
>
> The most common behaviour is "do whatever this target CPU type and board
> needs to do to boot a Linux kernel", which tends to involve setting at
> least some CPU registers.
> For instance for 32-bit Arm kernels (in uImage, zImage or plain Image
> format) we do what is required by the booting documentation:
> https://www.kernel.org/doc/Documentation/arm/Booting
> But different architectures do different things in the details.
>
> Some uses of -kernel don't do "set up to boot a kernel", eg if you pass an
> ELF file to an Arm target QEMU -kernel option it just loads the ELF file
> and does nothing else to set up the CPU.
>
> Some uses of -kernel do much more complicated things, eg for x86 PC
> machines QEMU will boot the BIOS in the guest and then make the kernel
> file available to the BIOS for it to do whatever it likes (which usually
> is "boot it").
>
> thanks
> -- PMM