kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Help to test the powerpc architecture
@ 2020-08-02 14:27 Oscar Carter
  2020-08-10  9:13 ` Santosh S
  0 siblings, 1 reply; 3+ messages in thread
From: Oscar Carter @ 2020-08-02 14:27 UTC (permalink / raw)
  To: kernelnewbies; +Cc: Oscar Carter

Hi,

I'm working in a new feature for the powerpc (64 bits little endian)
architecture. Since I can't test it in a real environment, I need to
emulate this arch. To do this I use qemu-ppc. My problem is that the
built kernel don't boot in qemu.

To build the kernel:

make defconfig ARCH=powerpc

Then I set to NO the CONFIG_KEXEC option as I found that qemu can't
boot a KEXEC kernel. And now:

make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- -j4

Finally I obtain a zImage in arch/powerpc/boot/ directory.

Before to run qemu I create a rootfs with debootstrap. Then I run qemu
with the following parameters:

qemu-system-ppc -kernel /media/ubuntu/Data/linux/arch/powerpc/boot/zImage \
		-append "root=/dev/sda console=ttyS0" \
		-drive file=qemu_image.img,index=0,media=disk,format=raw \
		--nographic

If I add the "-prom-env boot-args=-v" to the end of the last command I get
the same result. The qemu always stops at this point:

>> =============================================================
>> OpenBIOS 1.1 [Dec 27 2018 23:11]
>> Configuration device id QEMU version 1 machine id 2
>> CPUs: 1
>> Memory: 128M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,750
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on Dec 27 2018 23:11
>> [ppc] Kernel already loaded (0x01000000 + 0x009085d8) (initrd 0x00000000 + 0x00000000)
>> [ppc] Kernel command line: root=/dev/sda console=ttyS0
>> switching to new context:

Also, I've tried to build the kernel with a DTB embedded in the image,
but not luck. The same result again.

make ps3_defconfig ARCH=powerpc
make ARCH=powerpc simpleImage.ps3 CROSS_COMPILE=powerpc-linux-gnu- -j4

I'm stuck at this point. I don't know how to configure the kernel to be
able to boot with qemu. Any help to point me to the right direction
will be greatly appreciated.

Thank's in advance.
Oscar Carter

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

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

* Re: Help to test the powerpc architecture
  2020-08-02 14:27 Help to test the powerpc architecture Oscar Carter
@ 2020-08-10  9:13 ` Santosh S
  2020-08-11  7:28   ` jim.cromie
  0 siblings, 1 reply; 3+ messages in thread
From: Santosh S @ 2020-08-10  9:13 UTC (permalink / raw)
  To: kernelnewbies


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

On Sunday, 2 August, 2020 7:57:03 PM IST Oscar Carter wrote:
> Hi,
> 
> I'm working in a new feature for the powerpc (64 bits little endian)
> architecture. Since I can't test it in a real environment, I need to
> emulate this arch. To do this I use qemu-ppc. My problem is that the
> built kernel don't boot in qemu.
> 
> To build the kernel:
> 
> make defconfig ARCH=powerpc
> 
> Then I set to NO the CONFIG_KEXEC option as I found that qemu can't
> boot a KEXEC kernel. And now:
> 
> make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- -j4
> 
> Finally I obtain a zImage in arch/powerpc/boot/ directory.
> 
> Before to run qemu I create a rootfs with debootstrap. Then I run qemu
> with the following parameters:
> 
> qemu-system-ppc -kernel /media/ubuntu/Data/linux/arch/powerpc/boot/zImage \
> 		-append "root=/dev/sda console=ttyS0" \
> 		-drive file=qemu_image.img,index=0,media=disk,format=raw \
> 		--nographic
> 
> If I add the "-prom-env boot-args=-v" to the end of the last command I get
> 
> the same result. The qemu always stops at this point:
> >> =============================================================
> >> OpenBIOS 1.1 [Dec 27 2018 23:11]
> >> Configuration device id QEMU version 1 machine id 2
> >> CPUs: 1
> >> Memory: 128M
> >> UUID: 00000000-0000-0000-0000-000000000000
> >> CPU type PowerPC,750
> 
> milliseconds isn't unique.
> Welcome to OpenBIOS v1.1 built on Dec 27 2018 23:11
> 
> >> [ppc] Kernel already loaded (0x01000000 + 0x009085d8) (initrd 0x00000000
> >> + 0x00000000) [ppc] Kernel command line: root=/dev/sda console=ttyS0
> 
> >> switching to new context:
> Also, I've tried to build the kernel with a DTB embedded in the image,
> but not luck. The same result again.
> 
> make ps3_defconfig ARCH=powerpc
> make ARCH=powerpc simpleImage.ps3 CROSS_COMPILE=powerpc-linux-gnu- -j4
> 
> I'm stuck at this point. I don't know how to configure the kernel to be
> able to boot with qemu. Any help to point me to the right direction
> will be greatly appreciated.

I used `pseries_defconfig` and have also used `pseries_le_defconfig` and 
have done successful boots. You should probably give the machine type in
your qemu command line.

`-M pseries`

or whatever is the machine type is for ps3

Thanks,
Santosh

> 
> Thank's in advance.
> Oscar Carter
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 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: Help to test the powerpc architecture
  2020-08-10  9:13 ` Santosh S
@ 2020-08-11  7:28   ` jim.cromie
  0 siblings, 0 replies; 3+ messages in thread
From: jim.cromie @ 2020-08-11  7:28 UTC (permalink / raw)
  To: Santosh S; +Cc: kernelnewbies

On Mon, Aug 10, 2020 at 3:15 AM Santosh S <santosh@fossix.org> wrote:
>
> On Sunday, 2 August, 2020 7:57:03 PM IST Oscar Carter wrote:
> > Hi,
> >
> > I'm working in a new feature for the powerpc (64 bits little endian)
> > architecture. Since I can't test it in a real environment, I need to
> > emulate this arch. To do this I use qemu-ppc. My problem is that the
> > built kernel don't boot in qemu.
> >
> > To build the kernel:
> >

I would recommend you try virtme, particularly virtme-config-kernel

[jimc@frodo build-v1]$ virtme-configkernel --help
usage: virtme-configkernel [-h] [--arch ARCHITECTURE] [--allnoconfig |
--defconfig | --update]

Configure a kernel for virtme

optional arguments:
  -h, --help           show this help message and exit
  --arch ARCHITECTURE  Target architecture

Mode:
  --allnoconfig        Overwrite configuration with a virtme-suitable
allnoconfig (unlikely to work)
  --defconfig          Overwrite configuration with a virtme-suitable defconfig
  --update             Update existing config for virtme



> > make defconfig ARCH=powerpc
> >
> > Then I set to NO the CONFIG_KEXEC option as I found that qemu can't
> > boot a KEXEC kernel. And now:
> >
> > make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- -j4
> >
> > Finally I obtain a zImage in arch/powerpc/boot/ directory.
> >
> > Before to run qemu I create a rootfs with debootstrap. Then I run qemu
> > with the following parameters:
> >
> > qemu-system-ppc -kernel /media/ubuntu/Data/linux/arch/powerpc/boot/zImage \
> >               -append "root=/dev/sda console=ttyS0" \
> >               -drive file=qemu_image.img,index=0,media=disk,format=raw \
> >               --nographic
> >
> > If I add the "-prom-env boot-args=-v" to the end of the last command I get
> >
> > the same result. The qemu always stops at this point:
> > >> =============================================================
> > >> OpenBIOS 1.1 [Dec 27 2018 23:11]
> > >> Configuration device id QEMU version 1 machine id 2
> > >> CPUs: 1
> > >> Memory: 128M
> > >> UUID: 00000000-0000-0000-0000-000000000000
> > >> CPU type PowerPC,750
> >
> > milliseconds isn't unique.
> > Welcome to OpenBIOS v1.1 built on Dec 27 2018 23:11
> >
> > >> [ppc] Kernel already loaded (0x01000000 + 0x009085d8) (initrd 0x00000000
> > >> + 0x00000000) [ppc] Kernel command line: root=/dev/sda console=ttyS0
> >
> > >> switching to new context:
> > Also, I've tried to build the kernel with a DTB embedded in the image,
> > but not luck. The same result again.
> >
> > make ps3_defconfig ARCH=powerpc
> > make ARCH=powerpc simpleImage.ps3 CROSS_COMPILE=powerpc-linux-gnu- -j4
> >
> > I'm stuck at this point. I don't know how to configure the kernel to be
> > able to boot with qemu. Any help to point me to the right direction
> > will be greatly appreciated.
>
> I used `pseries_defconfig` and have also used `pseries_le_defconfig` and
> have done successful boots. You should probably give the machine type in
> your qemu command line.
>
> `-M pseries`
>
> or whatever is the machine type is for ps3
>
> Thanks,
> Santosh
>
> >
> > Thank's in advance.
> > Oscar Carter
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
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:[~2020-08-11  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02 14:27 Help to test the powerpc architecture Oscar Carter
2020-08-10  9:13 ` Santosh S
2020-08-11  7:28   ` jim.cromie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).