Skip to main content

Porting Squawk to other devices

5 replies [Last post]
chemoki
Offline
Joined: 2006-12-11
Points: 0

We are thinking to port the Squawk to a ColdFire V1 device from Freescale. It is a 32bit processor with 256kB of Flash and 32kB of RAM.

I have seen that the minimum recommended Flash memory is 512kB, but is it possible to work with 256kB?

Another important aspect, where do we start? I have been looking around the SVN repository, and I have found two directories that I suppose it is the code that has to be ported: arm-bootloader and arm-library. Is this correct?

Thanks in advance,

Jose M.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
eric_arseneau
Offline
Joined: 2004-07-15
Points: 0

It is possible to run in 256K of flash, but its tight. The biggest issue will be deployment time. In order to save time for development, it is sometime desirable to have the VM and library already on device and only deploy the application parts. This model requires that the bootstrap keep all of its public methods and not be trimmed at all and therefore takes more space.

To fit in 256K, it would be required that a trimmed bundle of the bootstrap and application be created and flashed onto device.

The time it takes to flash can be pretty high.

As to where to start, you will need some kind of bootloader that gets the VM started. We have one on Sun SPOT that we could leverage. I will leave it up to Derek to answer this part of the question.

chemoki
Offline
Joined: 2006-12-11
Points: 0

I know someone that died waiting for an answer ;-)

Please, can you give us some more hints?

Thanks in advance,

Jose M.

derek_white
Offline
Joined: 2006-09-08
Points: 0

Doing a "bare metal" port is a complicated project, so it's hard to give really helpful answers.

The first task is to get the machine booted up. Hopefully you can find or already have some code to get a ColdFire up and running some basic code. For the SPOT this code is in the arm-bootloader directory that you found. I'd imagine that most of your bootloader code will be specific to your machine, but you'll need to finally call the Squawk VM, something like we do for the ARM in vmloader.c:runVM().

Next you'll need to supply low-level functionality used by Squawk and the C library. You can use squawk/vmcore/src/rts/gcc-9200/* as a template, but you'll notice that it then includes/links with code in "arm-library". Some of that code is very machine-specific (spi, i2c, secured sillicon support, etc). But there are basic functions (some stubs) that need to be implemented to do things like allocate memory, set timers, write to the serial port, etc.

In arm-library I'd pay particular attention to system.c and syscalls-*.

Let me restate this for clarity. "arm-library" probably implements more than you need. So start with supporting "newlib" (see http://wiki.osdev.org/Porting_Newlib for example), and the code in vmcore/src/rts.

I'll see if we can dig up more documentation on this...

mazx
Offline
Joined: 2008-03-25
Points: 0

I'm contemplating on porting Squawk to Samsung S3C2410A ARM9 CPU board from tincantools.com. The board already comes with APEX bootloader.

Does squawk land itself to being boot-up by 3rd party bootloader (sort of like Linux kernel)? I'm thinking the answer is yes but want to know if there are any issues to be aware off.

I'm assuming that I will need to modify APEX code so it actually is capable of booting SqVM since (i'm speculating here) it's only aware of how to boot Linux kernel. Now, is there anything that needs to be done in SqVM source so it can be boot up by external bootloader?

Any info and/or guidance would be greatly appreciated.

eric_arseneau
Offline
Joined: 2004-07-15
Points: 0

If it already runs Linux, then why not just compile the Linux version and see how it does on there? Try it as a user program and see how it does.

If you want to replace the Linux and have Squawk take over the whole device. Then you need to find out what the APEX bootloader expects of its "main" program. What is the entry point and how do you compile your code such that it is callable from the APEX bootloader.

Does that help?