Topics

回复:回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?


"曹子龙
 

Thank you!
It seems work seeing the source code, but still has problem on connection:
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
warning: Selected architecture i386:x64-32 is not compatible with reported target architecture i386:x86-64
Remote 'g' packet reply is too long (expected 596 bytes, got 608 bytes): 00000000000000000000000000000000000000000000000063060000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0ff0000000000000200000000f0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000001000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f0300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000801f0000
(gdb) 

BTW, can this debug method view each core of SMP?  how ? thank you!

曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 


------------------------------------------------------------------
发件人:Cufi, Carles <carles.cufi@...>
发送时间:2020年1月27日(星期一) 00:40
收件人:曹子龙 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>
主 题:Re: 回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

Hi there,

 

You are right, I made a mistake. Here’s the updated instructions that work for me:

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ /opt/zephyr-sdk/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gdb build/zephyr/zephyr.elf

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

So it’s a matter of using Zephyr’s SDK gdb and passing it as a parameter the path to build/zephyr/zephyr.elf

 

Carles

 

From:曹子 <caozilong@...>
Sent: 25 January 2020 03:15
To: Cufi, Carles <Carles.Cufi@...>; Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Subject:
回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you!

But it seems cant load the symbol, so how to compile the debug elf files?

BTW: there are two elf files exist in build dir, zephyr.elf and zepyhr-qemu.elf, what is the difference?

Thread 1 received signal SIGINT, Interrupt.

0x0000000000100dfb in ?? ()

(gdb) bt

#0  0x0000000000100dfb in ?? ()

#1  0x0000000000102e7e in ?? ()

#2  0x0000000000102e5a in ?? ()

#3  0x00000000001004d2 in ?? ()

#4  0x0000000000000000 in ?? ()

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <Carles.Cufi@...>

发送时间:2020124(星期五) 23:53

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:RE: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From:devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From:devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 

 



Boie, Andrew P
 

Try this instead, this is what I do every day, I never use west as it doesn’t properly support emulators. For x86-64 the host GDB works great:

 

. zephyr-env.sh

cd samples/hello_world

mkdir out

cd out

cmake -DBOARD=qemu_x86_64 ..

make -j32

make debugserver

 

In another terminal:

cd samples/hello_world/out

gdb zephyr/zephyr.elf -ex "target remote :1234"

 

GDB will start up and you can debug as usual.

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Sunday, January 26, 2020 7:54 PM
To: devel <devel@...>; Boie, Andrew P <andrew.p.boie@...>
Subject: 回复:回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you

It seems work seeing the source code, but still has problem on connection:

(gdb) target remote localhost:1234

Remote debugging using localhost:1234

warning: Selected architecture i386:x64-32 is not compatible with reported target architecture i386:x86-64

Remote 'g' packet reply is too long (expected 596 bytes, got 608 bytes): 00000000000000000000000000000000000000000000000063060000000000000000000000000000000000000000000000000000000000000000000000000000000

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0ff0000000000000200000000f0000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000001000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f0300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000000000000000000000801f0000

(gdb) 

 

BTW can this debug method view each core of SMP?  how ? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <carles.cufi@...>

发送时间:2020127(星期一) 00:40

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:Re: 回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Hi there,

 

You are right, I made a mistake. Here’s the updated instructions that work for me:

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ /opt/zephyr-sdk/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gdb build/zephyr/zephyr.elf

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

So it’s a matter of using Zephyr’s SDK gdb and passing it as a parameter the path to build/zephyr/zephyr.elf

 

Carles

 

From:曹子 <caozilong@...>
Sent: 25 January 2020 03:15
To: Cufi, Carles <Carles.Cufi@...>; Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Subject:
回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you!

But it seems cant load the symbol, so how to compile the debug elf files?

BTW: there are two elf files exist in build dir, zephyr.elf and zepyhr-qemu.elf, what is the difference?

Thread 1 received signal SIGINT, Interrupt.

0x0000000000100dfb in ?? ()

(gdb) bt

#0  0x0000000000100dfb in ?? ()

#1  0x0000000000102e7e in ?? ()

#2  0x0000000000102e5a in ?? ()

#3  0x00000000001004d2 in ?? ()

#4  0x0000000000000000 in ?? ()

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <Carles.Cufi@...>

发送时间:2020124(星期五) 23:53

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:RE: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From:devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From:devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com