stopping XMK (at microblaze)

F

Frank

Guest
Hi (Mohan and rest ;),

When I have downloaded a bootloader in bram at a microblaze system, I
download by use of the microblaze my application to external SDRAM and after
that the Xilinx Micro Kernel (also to external SDRAM). To start my
application and the kernel I have to jump to the start address of my kernel
(the kernel will automatically run the application). What I want to do is
the following: When running the application, I want to be able to return to
the bootloader in order to download a new application. But just jumping to
the start address of the bootloader is (in my opinion) not enough. The
kernel still keeps running, I guess. How can I make this possible?? Is there
a way to stop the kernel? Or another way to replace the application with a
new one (by using the bootloader). Or is described behaviour not possible
when using the kernel?!

Frank
 
Frank wrote:
What I want to do is
the following: When running the application, I want to be able to return to
the bootloader in order to download a new application. But just jumping to
the start address of the bootloader is (in my opinion) not enough. The
kernel still keeps running, I guess. How can I make this possible?? Is there
a way to stop the kernel? Or another way to replace the application with a
new one (by using the bootloader). Or is described behaviour not possible
when using the kernel?!
Here's one way to do this:
Bootloader0: standalone executable that loads xilkernel.elf and app1.elf and app2.elf, and then jumps to xilkernel's start address
xilkernel.elf: xilkernel executable, transfers control to app1.elf and when it exits, transfers control to app2.elf (process_table has app1.elf at a higher priority than app2.elf)
app1.elf: does something special, then exits
app2.elf: does something else special

If you want to reuse the memory of app1 for app2, recompile a slightly modified bootloader as a xilkernel-based elf file (just like app1.elf) with a different start address and load it along with
app1.elf instead of app2.elf as above. Then when app1.elf exits, the modified bootloader is invoked by the kernel to load app2.elf into the same memory as app1.elf and create a new process for
app2.elf (using process_create()).

--
Mohan
 
Here's one way to do this:
Bootloader0: standalone executable that loads xilkernel.elf and app1.elf
and app2.elf, and then jumps to xilkernel's start address
xilkernel.elf: xilkernel executable, transfers control to app1.elf and
when it exits, transfers control to app2.elf (process_table has app1.elf at
a higher priority than app2.elf)
app1.elf: does something special, then exits
app2.elf: does something else special

If you want to reuse the memory of app1 for app2, recompile a slightly
modified bootloader as a xilkernel-based elf file (just like app1.elf) with
a different start address and load it along with
app1.elf instead of app2.elf as above. Then when app1.elf exits, the
modified bootloader is invoked by the kernel to load app2.elf into the same
memory as app1.elf and create a new process for
app2.elf (using process_create()).
What do you exactly mean with "tranfer control"? In your described solution
both applications (app1.elf and app2.elf) are running at the same time or is
app2.elf not getting any time to run because app1.elf has a higher priority?
I was assuming that both processes would run but the application with the
highest priority was getting more time. But if I understand your solution,
the process with the highest priority is getting ALL the time?!

Another point: what if I want to download multiple times a new application?
Do I have to define a lot of processes and each of them with a priority that
is lower then the previous?

app1, address x, priority highest
app2, address y, priority higher
app3, address z, priority high

At startup (when jumping to the kernel) app1 is executed, then I can
download app2 at address y and exit app1. Now app2 is running. When
downloading again a new application it has to be downloaded to address z and
app2 has to be exited. Is this what you mean? If so, how can I download by
use of the bootloader? Just jump from app1 (or from app2 the second time
downloading) to the bootloader (which is in bram) and exit after
downloading? Does the kernel not complain about this?!

About your suggestion of reusing the memory. Do you mean to have two
bootloaders, one in bram which downloads the kernel, application and a
second bootloader? The second bootloader is then in external sdram and has
lower priority as the application. When exiting the application, this second
bootloader is executed. This second bootloader places the new application
into sdram and executes a process_create?! If it does, it has to be a
process create with a higher priority of itselfs. Is the bootloader
automatically stopped by the kernel in that case?!

Maybe there is a third way to download a new application. I was reading in
the docs and saw that if you have one application, you can make an
executable which contains the kernel stuff and the application. In the
application the user needs to use the system calls with a sys_ prefix
(sys_thread_create for example). In my situation I have only one application
that is running, so perhaps it's a good solution. Now I can download the
complete application (user code + kernel stuff) to sdram and jump to it.
When I want to download a new application, I just jump to the bootloader in
bram and download a new complete application (at the same start address as
the previous one) and jump to it. Is this possible in the described way?
What to do with the xilkernel.elf file (just leave it where it is and don't
use it, I guess)? Do I need some compiler/linker options to get a complete
application or just using the system calls with sys_ prefix is enough?

TIA,
Frank
 

Welcome to EDABoard.com

Sponsor

Back
Top