Re: [seL4] seL4 on Zinq7000 on QEMU

2016-12-08 Thread Alexander.Kroh
Hi Andrew,

 Thanks for your contributions. We will add Zynq simulation to our
regression tests.

 - Alex



On Tue, 2016-12-06 at 19:56 -0600, Andrew Gacek wrote:
> It looks like the libplatsupport drivers do this enabling as well.
> Though it appears there's a typo in the transmit enable:
> 
>   
> https://github.com/seL4/util_libs/blob/master/libplatsupport/src/plat/zynq7000/serial.c#L174
> 
> I've created a pull request to fix that as well.
> 
>   https://github.com/seL4/util_libs/pull/5
> 
> -Andrew
> 
> On Tue, Dec 6, 2016 at 6:46 PM, Andrew Gacek <andrew.ga...@gmail.com> wrote:
> > Ok thanks. I've created a pull request for this change:
> >
> >   https://github.com/seL4/seL4_tools/pull/2
> >
> > -Andrew
> >
> > On Tue, Dec 6, 2016 at 5:58 PM,  <alexander.k...@data61.csiro.au> wrote:
> >> Hi Andrew,
> >>
> >> Nice find! U-boot obviously performs some initialisation of the UART on
> >> our behalf, hence we have not had problems when testing on real
> >> hardware.
> >>
> >> The correct place would be here:
> >> https://github.com/seL4/seL4_tools/blob/2.0.x-compatible/elfloader-tool/src/arch-arm/plat-zynq7000/platform_init.c#L72
> >>
> >> But, it should call out to a dedicated init function in sys_fputc.c
> >>
> >> The call to platform_init() would also need to occur a few lines
> >> earlier, before the first printf:
> >> https://github.com/seL4/seL4_tools/blob/2.0.x-compatible/elfloader-tool/src/arch-arm/boot.c#L81
> >>
> >>  - Alex
> >>
> >>
> >> On Tue, 2016-12-06 at 16:35 -0600, Andrew Gacek wrote:
> >>> I've found the problem. First, the default UART for zynq7000 is the
> >>> second one, so I need to run qemu like this:
> >>>
> >>>   qemu-system-arm -M xilinx-zynq-a9 -kernel
> >>> images/capdl-loader-experimental-image-arm-zynq7000 -m size=512M
> >>> -monitor none -nographic -serial /dev/null -serial stdio
> >>>
> >>> Second, the Zynq7000 uart needs to be explicitly enabled. This is done
> >>> by clearing bit 5 and setting bit 4 of the control register. It looks
> >>> like seL4 and related tools are not doing this. For now I've done this
> >>> by modifying
> >>>
> >>>   tools/elfloader/src/arch-arm/plat-zynq7000/sys_fputc.c
> >>>
> >>> to add
> >>>
> >>>uint32_t v = *UART_REG(UART_CONTROL);
> >>> v |= (1 << 4);
> >>> v &= ~(1 << 5);
> >>> *UART_REG(UART_CONTROL) = v;
> >>>
> >>> to the __fputc function.
> >>>
> >>> This clearly isn't the right spot for it. Where should such initial
> >>> configuration be done?
> >>>
> >>> -Andrew
> >>>
> >>>
> >>> On Tue, Dec 6, 2016 at 3:33 PM, Andrew Gacek <andrew.ga...@gmail.com> 
> >>> wrote:
> >>> > If I suspend the execution in QEMU, the program counter is at
> >>> > 0xe00108ec. In the kernel, that is the  method. So
> >>> > perhaps the system is running, but I'm just not able to see any output
> >>> > from the elfloader, kernel, etc.
> >>> >
> >>> > -Andrew
> >>> >
> >>> > On Tue, Dec 6, 2016 at 2:49 PM, Andrew Gacek <andrew.ga...@gmail.com> 
> >>> > wrote:
> >>> >> Thanks Alex. That fixes the crash. Now the system runs but just seems
> >>> >> to hang without doing anything. I don't get any output at all (whereas
> >>> >> the kzm version spews out a ton of messages). In 'top' I can see it's
> >>> >> using about 3% cpu so it's something, though it's not clear what. It's
> >>> >> hard for me to tell. Perhaps the UART for the console isn't working
> >>> >> correctly?
> >>> >>
> >>> >> -Andrew
> >>> >>
> >>> >> On Tue, Dec 6, 2016 at 2:46 PM,  <alexander.k...@data61.csiro.au> 
> >>> >> wrote:
> >>> >>> Hi Andrew,
> >>> >>>
> >>> >>> It could be because QEMU does not know how much RAM is available.
> >>> >>> Could you try adding "-m size=512M" to your arguments?
> >>> >>>
> >>> >>>  - Alex
> >>> >>>
> >>> >>> 
> >>> >>> From: De

Re: [seL4] seL4 on Zinq7000 on QEMU

2016-12-06 Thread Andrew Gacek
Ok thanks. I've created a pull request for this change:

  https://github.com/seL4/seL4_tools/pull/2

-Andrew

On Tue, Dec 6, 2016 at 5:58 PM,  <alexander.k...@data61.csiro.au> wrote:
> Hi Andrew,
>
> Nice find! U-boot obviously performs some initialisation of the UART on
> our behalf, hence we have not had problems when testing on real
> hardware.
>
> The correct place would be here:
> https://github.com/seL4/seL4_tools/blob/2.0.x-compatible/elfloader-tool/src/arch-arm/plat-zynq7000/platform_init.c#L72
>
> But, it should call out to a dedicated init function in sys_fputc.c
>
> The call to platform_init() would also need to occur a few lines
> earlier, before the first printf:
> https://github.com/seL4/seL4_tools/blob/2.0.x-compatible/elfloader-tool/src/arch-arm/boot.c#L81
>
>  - Alex
>
>
> On Tue, 2016-12-06 at 16:35 -0600, Andrew Gacek wrote:
>> I've found the problem. First, the default UART for zynq7000 is the
>> second one, so I need to run qemu like this:
>>
>>   qemu-system-arm -M xilinx-zynq-a9 -kernel
>> images/capdl-loader-experimental-image-arm-zynq7000 -m size=512M
>> -monitor none -nographic -serial /dev/null -serial stdio
>>
>> Second, the Zynq7000 uart needs to be explicitly enabled. This is done
>> by clearing bit 5 and setting bit 4 of the control register. It looks
>> like seL4 and related tools are not doing this. For now I've done this
>> by modifying
>>
>>   tools/elfloader/src/arch-arm/plat-zynq7000/sys_fputc.c
>>
>> to add
>>
>>uint32_t v = *UART_REG(UART_CONTROL);
>> v |= (1 << 4);
>> v &= ~(1 << 5);
>> *UART_REG(UART_CONTROL) = v;
>>
>> to the __fputc function.
>>
>> This clearly isn't the right spot for it. Where should such initial
>> configuration be done?
>>
>> -Andrew
>>
>>
>> On Tue, Dec 6, 2016 at 3:33 PM, Andrew Gacek <andrew.ga...@gmail.com> wrote:
>> > If I suspend the execution in QEMU, the program counter is at
>> > 0xe00108ec. In the kernel, that is the  method. So
>> > perhaps the system is running, but I'm just not able to see any output
>> > from the elfloader, kernel, etc.
>> >
>> > -Andrew
>> >
>> > On Tue, Dec 6, 2016 at 2:49 PM, Andrew Gacek <andrew.ga...@gmail.com> 
>> > wrote:
>> >> Thanks Alex. That fixes the crash. Now the system runs but just seems
>> >> to hang without doing anything. I don't get any output at all (whereas
>> >> the kzm version spews out a ton of messages). In 'top' I can see it's
>> >> using about 3% cpu so it's something, though it's not clear what. It's
>> >> hard for me to tell. Perhaps the UART for the console isn't working
>> >> correctly?
>> >>
>> >> -Andrew
>> >>
>> >> On Tue, Dec 6, 2016 at 2:46 PM,  <alexander.k...@data61.csiro.au> wrote:
>> >>> Hi Andrew,
>> >>>
>> >>> It could be because QEMU does not know how much RAM is available.
>> >>> Could you try adding "-m size=512M" to your arguments?
>> >>>
>> >>>  - Alex
>> >>>
>> >>> 
>> >>> From: Devel <devel-bounces@sel4.systems> on behalf of Andrew Gacek 
>> >>> <andrew.ga...@gmail.com>
>> >>> Sent: Wednesday, December 7, 2016 2:23 AM
>> >>> To: devel@sel4.systems
>> >>> Subject: [seL4] seL4 on Zinq7000 on QEMU
>> >>>
>> >>> I'm trying to build and emulate a version of seL4 for the zinq7000
>> >>> platform, but it crashes immediately.
>> >>>
>> >>> I've started by taking the camkes tutorial and building it for zinq7000:
>> >>>
>> >>>   repo init -u https://github.com/seL4/camkes-manifest.git
>> >>>   repo sync
>> >>>   make arm_simple_defconfig
>> >>>   make menuconfig # change seL4 platform to zinq7000
>> >>>   make
>> >>>
>> >>> When I try to emulate it, it crashes right away:
>> >>>
>> >>>   qemu-system-arm -M xilinx-zynq-a9 -nographic -kernel
>> >>> images/capdl-loader-experimental-image-arm-zynq7000
>> >>>
>> >>> qemu: fatal: Trying to execute code outside RAM or ROM at 0x1000
>> >>>
>> >>> R00= R01= R02= R03=
>> >>> R04= R05= R06= R07=
>> >>> R0

Re: [seL4] seL4 on Zinq7000 on QEMU

2016-12-06 Thread Andrew Gacek
I've found the problem. First, the default UART for zynq7000 is the
second one, so I need to run qemu like this:

  qemu-system-arm -M xilinx-zynq-a9 -kernel
images/capdl-loader-experimental-image-arm-zynq7000 -m size=512M
-monitor none -nographic -serial /dev/null -serial stdio

Second, the Zynq7000 uart needs to be explicitly enabled. This is done
by clearing bit 5 and setting bit 4 of the control register. It looks
like seL4 and related tools are not doing this. For now I've done this
by modifying

  tools/elfloader/src/arch-arm/plat-zynq7000/sys_fputc.c

to add

   uint32_t v = *UART_REG(UART_CONTROL);
v |= (1 << 4);
v &= ~(1 << 5);
*UART_REG(UART_CONTROL) = v;

to the __fputc function.

This clearly isn't the right spot for it. Where should such initial
configuration be done?

-Andrew


On Tue, Dec 6, 2016 at 3:33 PM, Andrew Gacek <andrew.ga...@gmail.com> wrote:
> If I suspend the execution in QEMU, the program counter is at
> 0xe00108ec. In the kernel, that is the  method. So
> perhaps the system is running, but I'm just not able to see any output
> from the elfloader, kernel, etc.
>
> -Andrew
>
> On Tue, Dec 6, 2016 at 2:49 PM, Andrew Gacek <andrew.ga...@gmail.com> wrote:
>> Thanks Alex. That fixes the crash. Now the system runs but just seems
>> to hang without doing anything. I don't get any output at all (whereas
>> the kzm version spews out a ton of messages). In 'top' I can see it's
>> using about 3% cpu so it's something, though it's not clear what. It's
>> hard for me to tell. Perhaps the UART for the console isn't working
>> correctly?
>>
>> -Andrew
>>
>> On Tue, Dec 6, 2016 at 2:46 PM,  <alexander.k...@data61.csiro.au> wrote:
>>> Hi Andrew,
>>>
>>> It could be because QEMU does not know how much RAM is available.
>>> Could you try adding "-m size=512M" to your arguments?
>>>
>>>  - Alex
>>>
>>> ____
>>> From: Devel <devel-bounces@sel4.systems> on behalf of Andrew Gacek 
>>> <andrew.ga...@gmail.com>
>>> Sent: Wednesday, December 7, 2016 2:23 AM
>>> To: devel@sel4.systems
>>> Subject: [seL4] seL4 on Zinq7000 on QEMU
>>>
>>> I'm trying to build and emulate a version of seL4 for the zinq7000
>>> platform, but it crashes immediately.
>>>
>>> I've started by taking the camkes tutorial and building it for zinq7000:
>>>
>>>   repo init -u https://github.com/seL4/camkes-manifest.git
>>>   repo sync
>>>   make arm_simple_defconfig
>>>   make menuconfig # change seL4 platform to zinq7000
>>>   make
>>>
>>> When I try to emulate it, it crashes right away:
>>>
>>>   qemu-system-arm -M xilinx-zynq-a9 -nographic -kernel
>>> images/capdl-loader-experimental-image-arm-zynq7000
>>>
>>> qemu: fatal: Trying to execute code outside RAM or ROM at 0x1000
>>>
>>> R00= R01= R02= R03=
>>> R04= R05= R06= R07=
>>> R08= R09= R10= R11=
>>> R12= R13= R14= R15=1000
>>> PSR=41d3 -Z-- A svc32
>>> s00= s01= d00=
>>> s02= s03= d01=
>>> s04= s05= d02=
>>> s06= s07= d03=
>>> s08= s09= d04=
>>> s10= s11= d05=
>>> s12= s13= d06=
>>> s14= s15= d07=
>>> s16= s17= d08=
>>> s18= s19= d09=
>>> s20= s21= d10=
>>> s22= s23= d11=
>>> s24= s25= d12=
>>> s26= s27= d13=
>>> s28= s29= d14=
>>> s30= s31= d15=
>>> s32= s33= d16=
>>> s34= s35= d17=
>>> s36= s37= d18=
>>> s38= s39= d19=
>>> s40= s41= d20=
>>> s42= s43= d21=
>>> s44= s45= d22=
>>> s46= s47= d23=
>>> s48= s49= d24=
>>> 

Re: [seL4] seL4 on Zinq7000 on QEMU

2016-12-06 Thread Andrew Gacek
If I suspend the execution in QEMU, the program counter is at
0xe00108ec. In the kernel, that is the  method. So
perhaps the system is running, but I'm just not able to see any output
from the elfloader, kernel, etc.

-Andrew

On Tue, Dec 6, 2016 at 2:49 PM, Andrew Gacek <andrew.ga...@gmail.com> wrote:
> Thanks Alex. That fixes the crash. Now the system runs but just seems
> to hang without doing anything. I don't get any output at all (whereas
> the kzm version spews out a ton of messages). In 'top' I can see it's
> using about 3% cpu so it's something, though it's not clear what. It's
> hard for me to tell. Perhaps the UART for the console isn't working
> correctly?
>
> -Andrew
>
> On Tue, Dec 6, 2016 at 2:46 PM,  <alexander.k...@data61.csiro.au> wrote:
>> Hi Andrew,
>>
>> It could be because QEMU does not know how much RAM is available.
>> Could you try adding "-m size=512M" to your arguments?
>>
>>  - Alex
>>
>> 
>> From: Devel <devel-bounces@sel4.systems> on behalf of Andrew Gacek 
>> <andrew.ga...@gmail.com>
>> Sent: Wednesday, December 7, 2016 2:23 AM
>> To: devel@sel4.systems
>> Subject: [seL4] seL4 on Zinq7000 on QEMU
>>
>> I'm trying to build and emulate a version of seL4 for the zinq7000
>> platform, but it crashes immediately.
>>
>> I've started by taking the camkes tutorial and building it for zinq7000:
>>
>>   repo init -u https://github.com/seL4/camkes-manifest.git
>>   repo sync
>>   make arm_simple_defconfig
>>   make menuconfig # change seL4 platform to zinq7000
>>   make
>>
>> When I try to emulate it, it crashes right away:
>>
>>   qemu-system-arm -M xilinx-zynq-a9 -nographic -kernel
>> images/capdl-loader-experimental-image-arm-zynq7000
>>
>> qemu: fatal: Trying to execute code outside RAM or ROM at 0x1000
>>
>> R00= R01= R02= R03=
>> R04= R05= R06= R07=
>> R08= R09= R10= R11=
>> R12= R13= R14= R15=1000
>> PSR=41d3 -Z-- A svc32
>> s00= s01= d00=
>> s02= s03= d01=
>> s04= s05= d02=
>> s06= s07= d03=
>> s08= s09= d04=
>> s10= s11= d05=
>> s12= s13= d06=
>> s14= s15= d07=
>> s16= s17= d08=
>> s18= s19= d09=
>> s20= s21= d10=
>> s22= s23= d11=
>> s24= s25= d12=
>> s26= s27= d13=
>> s28= s29= d14=
>> s30= s31= d15=
>> s32= s33= d16=
>> s34= s35= d17=
>> s36= s37= d18=
>> s38= s39= d19=
>> s40= s41= d20=
>> s42= s43= d21=
>> s44= s45= d22=
>> s46= s47= d23=
>> s48= s49= d24=
>> s50= s51= d25=
>> s52= s53= d26=
>> s54= s55= d27=
>> s56= s57= d28=
>> s58= s59= d29=
>> s60= s61= d30=
>> s62= s63= d31=
>> FPSCR: 
>> Aborted
>>
>>
>> Is there something I'm doing wrong?
>>
>> Thanks,
>> Andrew
>>
>> ___
>> Devel mailing list
>> Devel@sel4.systems
>> https://sel4.systems/lists/listinfo/devel

___
Devel mailing list
Devel@sel4.systems
https://sel4.systems/lists/listinfo/devel


Re: [seL4] seL4 on Zinq7000 on QEMU

2016-12-06 Thread Andrew Gacek
Thanks Alex. That fixes the crash. Now the system runs but just seems
to hang without doing anything. I don't get any output at all (whereas
the kzm version spews out a ton of messages). In 'top' I can see it's
using about 3% cpu so it's something, though it's not clear what. It's
hard for me to tell. Perhaps the UART for the console isn't working
correctly?

-Andrew

On Tue, Dec 6, 2016 at 2:46 PM,  <alexander.k...@data61.csiro.au> wrote:
> Hi Andrew,
>
> It could be because QEMU does not know how much RAM is available.
> Could you try adding "-m size=512M" to your arguments?
>
>  - Alex
>
> 
> From: Devel <devel-bounces@sel4.systems> on behalf of Andrew Gacek 
> <andrew.ga...@gmail.com>
> Sent: Wednesday, December 7, 2016 2:23 AM
> To: devel@sel4.systems
> Subject: [seL4] seL4 on Zinq7000 on QEMU
>
> I'm trying to build and emulate a version of seL4 for the zinq7000
> platform, but it crashes immediately.
>
> I've started by taking the camkes tutorial and building it for zinq7000:
>
>   repo init -u https://github.com/seL4/camkes-manifest.git
>   repo sync
>   make arm_simple_defconfig
>   make menuconfig # change seL4 platform to zinq7000
>   make
>
> When I try to emulate it, it crashes right away:
>
>   qemu-system-arm -M xilinx-zynq-a9 -nographic -kernel
> images/capdl-loader-experimental-image-arm-zynq7000
>
> qemu: fatal: Trying to execute code outside RAM or ROM at 0x1000
>
> R00= R01= R02= R03=
> R04= R05= R06= R07=
> R08= R09= R10= R11=
> R12= R13= R14= R15=1000
> PSR=41d3 -Z-- A svc32
> s00= s01= d00=
> s02= s03= d01=
> s04= s05= d02=
> s06= s07= d03=
> s08= s09= d04=
> s10= s11= d05=
> s12= s13= d06=
> s14= s15= d07=
> s16= s17= d08=
> s18= s19= d09=
> s20= s21= d10=
> s22= s23= d11=
> s24= s25= d12=
> s26= s27= d13=
> s28= s29= d14=
> s30= s31= d15=
> s32= s33= d16=
> s34= s35= d17=
> s36= s37= d18=
> s38= s39= d19=
> s40= s41= d20=
> s42= s43= d21=
> s44= s45= d22=
> s46= s47= d23=
> s48= s49= d24=
> s50= s51= d25=
> s52= s53= d26=
> s54= s55= d27=
> s56= s57= d28=
> s58= s59= d29=
> s60= s61= d30=
> s62= s63= d31=
> FPSCR: 
> Aborted
>
>
> Is there something I'm doing wrong?
>
> Thanks,
> Andrew
>
> ___
> Devel mailing list
> Devel@sel4.systems
> https://sel4.systems/lists/listinfo/devel

___
Devel mailing list
Devel@sel4.systems
https://sel4.systems/lists/listinfo/devel