Quantcast

Running program on bare metal Overo

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running program on bare metal Overo

Xiaorong
Hi All,

I have an Overo Air and a Tobi expansion board. I wonder if I can run  
C or assembly program on bare metal Overo Air (no OS) and how should I  
start? Another question is, can I configure registers in my C or  
assembly program, such as cache configuration? Any suggestion will be  
greatly appreciated!

Thanks in advance,

Xiaoroong


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

bhamadicharef
A VERY interesting topic ... looking forward to read any answers to that !

Brahim

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Abdul
In reply to this post by Xiaorong
Hi I not expert in this but I am trying to accomplish the same thing with a different board. I think what you have to do is  change your boot loader to point at your program  instead of the Linux Kernel so it will execute it after boot loader finished. Keep in mind that you have to memory manage every piece of your data and but I may be completely wrong ;)
Sincerely,
Abdulrahman Alotaibi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Jonathan Kunkee
Hello!

I'm doing this with a different platform presently with a verry shiny
SDK, but the principle is the same and the bootloader does loads of
work for you.

Assuming you can build a standalone binary from either C or assembly
(quite a task in and of itself; you need an ARM compiler like Linaro's
and possibly "mkimage") and that an SD card is sufficient for your
needs, simply place it in the FAT boot partition and direct the
bootloader to load the file into RAM at the address your code expects
to be in (using the "mmc" and "fatload" commands) (assuming your code
isn't in ELF format, but rather in the format it expects itself to be
in memory). After this, there is a command in the bootloader that will
start execution at a specified memory location, and voila your code is
running.

As for doing anything sophisticated like cache configuration or
virtual memory or interrupt handling, that will be part of the ARMv7
instruction set and TI OMAP 3503 documentation. The OMAP series has a
large variety of features, so you will need to read a LOT of
documentation; however, you will find that there is also a lot that
you can ignore.

I apologize if I speak below your level or don't explain very well--I
am just learning this myself.

Best wishes,
Jon Kunkee


Abdul <[hidden email]> wrote:

>
> Hi I not expert in this but I am trying to accomplish the same thing with a
> different board. I think what you have to do is  change your boot loader to
> point at your program  instead of the Linux Kernel so it will execute it
> after boot loader finished. Keep in mind that you have to memory manage
> every piece of your data and but I may be completely wrong ;)
> Sincerely,
> Abdulrahman Alotaibi
>
>
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Kees Jongenburger
In reply to this post by Xiaorong
Hi,

I suggest first reading:
http://www.bravegnu.org/gnu-eprog/

This will give you a good understanding of basic arm assembly and make
you understand how to compile and start a c program that is not linked
to the c library and a bit of basics about creating linker scripts.
After that you could start reading the omap documentation to find
where to load a program in memory and find the UART base address.

The last piece is to understand how to load the program. Best is to
start loading from u-boot as most of the hardware setup will already
have been done. This typically looks like this.

U-Boot# mmc rescan
U-Boot# mmc list
OMAP SD/MMC: 0
U-Boot# mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Partition     Start Sector     Num Sectors     Type
    1                 2048          102400       c
    2               104448         7759872      83
U-Boot# fatls mmc 0:1
    38024   mlo
       56   main.bin
   255256   u-boot.img

3 file(s), 0 dir(s)

U-Boot# fatload mmc 0:1 0x40300000 main.bin
reading main.bin

56 bytes read
U-Boot# go 0x40300010
## Starting application at 0x40300010 ...
Hello ARM



Greetings

On Wed, Sep 19, 2012 at 3:57 AM,  <[hidden email]> wrote:

> Hi All,
>
> I have an Overo Air and a Tobi expansion board. I wonder if I can run
> C or assembly program on bare metal Overo Air (no OS) and how should I
> start? Another question is, can I configure registers in my C or
> assembly program, such as cache configuration? Any suggestion will be
> greatly appreciated!
>
> Thanks in advance,
>
> Xiaoroong
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

James Linder
In reply to this post by Xiaorong

On 19/09/2012, at 4:52 PM, [hidden email] wrote:

> I'm doing this with a different platform presently with a verry shiny
> SDK, but the principle is the same and the bootloader does loads of
> work for you.
>

[snip]

>
> Abdul <[hidden email]> wrote:
>>
>> Hi I not expert in this but I am trying to accomplish the same thing with a
>> different board. I think what you have to do is  change your boot loader to
>> point at your program  instead of the Linux Kernel so it will execute it
>> after boot loader finished. Keep in mind that you have to memory manage
>> every piece of your data and but I may be completely wrong ;)

Guys unless you *really* have a good reason, don't go there! You are talking about a *much* harder task.
If you have sort-of-idealistic ideas about how kewl this would be then play with arduino.
Even look at a phone and elector's usb interface.

The OS does oh so much to hold your hand and with little work mS real time is available.
Of course it would be fun to do, but I'd opine that it is 10x more effort to do bare-metal than unix os.
For simple realtime arduino is easy. Trying to implement say tcp/ip on your bare metal will take until you are old n grey :-)

Ciao
James


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Harvey Chapman-2
In reply to this post by Kees Jongenburger
It might be easier to start by creating a program using U-Boot. It already comes with a couple of example programs (hello world, timer demo) to get you started. It's not purely standalone. The programs have access to the other features of U-Boot.

http://www.denx.de/wiki/view/DULG/UBootStandalone


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Kees Jongenburger
In reply to this post by Xiaorong
Hi,

I suggest you do the following:
Read http://www.bravegnu.org/gnu-eprog/index.html to get a quick basic
understanding of arm assembly code, linkers and how c code can be
called.
After running and testing the code on qemu add an example of writing
to the serial. e.g write a value at memory address  0x40100000 is the
address FUART still using qemu and the connex target.

If you are running on real hardware best is to start the binary from
u-boot. The basic memory setup and such will already be done. Now you
should have a basic understanding of what you are trying to achieve
and all you need to to is to figure out how where the UART is mapped
on the overo and how to load a program from u-boot. The first you can
read in the TRM documentation and down here you find a way to load
such a program from u-boot.

U-Boot# mmc rescan
U-Boot# mmc list
OMAP SD/MMC: 0
U-Boot# mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Partition     Start Sector     Num Sectors     Type
    1                 2048          102400       c
    2               104448         7759872      83
U-Boot# fatls mmc 0:1
    38024   mlo
       56   main.bin
   255256   u-boot.img

3 file(s), 0 dir(s)

U-Boot# fatload mmc 0:1 0x40300000 main.bin
reading main.bin

56 bytes read
U-Boot# go 0x40300010
## Starting application at 0x40300010 ...
Hello ARM


I hope this helps.

Greetings






On Wed, Sep 19, 2012 at 3:57 AM,  <[hidden email]> wrote:

> Hi All,
>
> I have an Overo Air and a Tobi expansion board. I wonder if I can run
> C or assembly program on bare metal Overo Air (no OS) and how should I
> start? Another question is, can I configure registers in my C or
> assembly program, such as cache configuration? Any suggestion will be
> greatly appreciated!
>
> Thanks in advance,
>
> Xiaoroong
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Jonathan Kunkee
In reply to this post by James Linder
>
> Guys unless you *really* have a good reason, don't go there! You are talking about a *much* harder
> task. If you have sort-of-idealistic ideas about how kewl this would be then play with arduino.
> Even look at a phone and elector's usb interface.
>
> The OS does oh so much to hold your hand and with little work mS real time is available.
> Of course it would be fun to do, but I'd opine that it is 10x more effort to do bare-metal than unix os.
> For simple realtime arduino is easy. Trying to implement say tcp/ip on your bare metal will take until
> you are old n grey :-)
>

I agree wholeheartedly; doing this in production for anything that
actually requires an OMAP is a
monstrous task that Linux has already tackled nicely, including
realtime considerations. Networking?
I shudder to think. Then again, I know a few people that could
probably do it in a week...Needless
to say, they're distracted by much more productive hobbies.

However, if it's not for production, I think that it is pretty easy to
have a good enough reason to play
with it for a while:

* you are a student learning about all the complexity you have mentioned
  (implementing a simple version yourself can give you healthy respect
for a product like uCOS or Linux)
* you think it's really really REALLY kewl
* you're using Xilinx EDK or TI's CodeComposer (for other architectures)

Xioaroong perhaps has some other good reason. Best of luck to him,
especially in deciding to do this
a Better Way(TM). ;)

Kees Jongenburger, thank you for the detailed response. Harvey
Chapman, I think the u-boot
approach is a brilliant one, especially as it comes with serial
support (and networking, if I'm not
mistaken).

My 2 cents,
Jon Kunkee

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Harvey Chapman-2
On Sep 19, 2012, at 1:35 PM, Jonathan Kunkee <[hidden email]> wrote:

> However, if it's not for production, I think that it is pretty easy to
> have a good enough reason to play
> with it for a while:
>
> * you are a student learning about all the complexity you have mentioned
>  (implementing a simple version yourself can give you healthy respect
> for a product like uCOS or Linux)
> * you think it's really really REALLY kewl
> * you're using Xilinx EDK or TI's CodeComposer (for other architectures)

I had a coworker who booted Linux only on one processor in a dual Athlon system. He then wrote a custom bare-metal app for the second processor and used it like a DSP for video encoding.

Harvey
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running program on bare metal Overo

Neil MacMunn
Hi guys,

Great thread! It inspired one of the Gumstix co-op students to start
an article on the wiki. Feel free to add your suggestions.

http://wiki.gumstix.org/index.php?title=Overo_Bare_Metal

-
Neil


On Wed, Sep 19, 2012 at 1:07 PM, Harvey Chapman
<[hidden email]> wrote:

> On Sep 19, 2012, at 1:35 PM, Jonathan Kunkee <[hidden email]> wrote:
>
>> However, if it's not for production, I think that it is pretty easy to
>> have a good enough reason to play
>> with it for a while:
>>
>> * you are a student learning about all the complexity you have mentioned
>>  (implementing a simple version yourself can give you healthy respect
>> for a product like uCOS or Linux)
>> * you think it's really really REALLY kewl
>> * you're using Xilinx EDK or TI's CodeComposer (for other architectures)
>
> I had a coworker who booted Linux only on one processor in a dual Athlon system. He then wrote a custom bare-metal app for the second processor and used it like a DSP for video encoding.
>
> Harvey
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Loading...