Port existing C code to ARMv7 [closed] - c

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was recently given the source code for an audio decoder which executes fine with on Windows when compiled with MSVC.
I was assigned the job of porting this decoder (which is written in c) to the ARMv7 platform.
Since I'm totally new to this field, I'm not sure how to go about doing this. I have already googled a lot, but could not find much that applied to my particular case.
Any suggestions about how to pull off such a port would be greatly appreciated.

Compile it and see what breaks is a good place to start.
ARM is a 32 bit target and off-the-shelf ARM based micro-controllers are invariably little-endian like x86, so there are generally few issues porting code.
If the code makes OS calls to Win32, or uses third-party libraries not ported to ARM, then of course you will need to remove those dependencies or port to the target environment. Similarly if the code makes use of the PC based hardware, such as the sound card, that will certainly need to be adapted.
Code and algorithms that simply processes data should port directly if the code quality was sufficiently portable in the first instance. Undefined or implementation defined compiler behaviour however will need to have been be avoided, since this is likley to differ between compilers and targets.

Related

ARM development quickstart [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I want to try developing with ARM platform, particularly I'm interested in bare metal. I'm trying to start that using QEMU but this way of learning lacks comprehensive tutorials and it inevitably adds another level of complexity. Please, suggest a decent ARM development platform that meets the following requirements (sorted by descending importance):
Accompanied with a good step-by-step tutorial.
Provides basic input/output. I want to see some blinking and be able
to press some buttons on it. Additionally, having a digit display
(like on a calculator) or even an lcd display would be wonderful
Provides at least some debugging capabilities.
Modern.
If you want to start of with ARM controllers , you can go for mbed.mbed boards come with LPC
1768 32-bit Arm controller. You need not know much about the underlying hardware to code as there are many builtin api's to work with GPIO's and to interface sensors.
You can follow the mentioned link for the same mbed

Completely general purpose code on a GPU [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I was approached by a client to work on a project that will involve trying to run full scale programs on the GPU with OpenCL.
I have decent knowledge of CUDA and low level machine architecture. As far as I understand, GPU code does not have a call stack, nor does it have pointers, or any unstructured control flow mechanism like goto, exceptions or function pointers.
To me it resembles a rudimentary FORTRAN dialect in terms of semantics.
I know that GPU kernels called from another GPU kernel get inlined like macro expansions, there is no CALL/RET mechanism
As far as I understand, you cannot have a lexically scoped language without a stack and the dialect that OpenCL compiles is a very flat subset of C and similarly CUDA, while allowing templates and stuff, gives us only a very small subset of C++
The client wants to translate from Javascript to C to LLVM and then to OpenCL bytecode, or somehow get full scale programs to run on the GPU, even if they run slowly with no parallelism
Am I right in convincing the client that what he hopes to achieve is technically impossible and not really useful?

Programming an old console, Magnavox Odyssey 2? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Ive been searching around and I couldnt find anything on how to really begin programming for the Odyssey 2. I thought it was be kind of fun to mess around with one, to maybe try and program a simple game. But I wanted to know how I could begin. Like for example what is the console coded with, assembly? C?
Is there any example code online? Are there some tutorials?
I have been trying to find some, but have had no success.
It has only 64-bytes of memory, so yes, you need to use assembly.
There is an open-source, well commented game Kill the attacking aliens which should help you get started. When in doubt, you can also check the source codes of Odyssey² open-source emulators o2em.
There is also a good deal of documentation of the system here (this page in particular).
It has an Intel 8048 CPU, so you're probably pretty much stuck with assembly language -- I don't know of any compilers that target an 8048, and with only a couple hundred bytes of RAM available (only 64 bytes of that for general-purpose use), it doesn't seem like a good target for a compiler either. There are a few 8048 assemblers around, mostly of them freely downloadable. You can also dig up a few Odessey 2 emulators if you do a little looking (again, at least some are free).

Carry Around C Compiler [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm aware that there are programable calculators but are there any calculator sized (prehaps bigger) devices that could compile C code?
Almost anything that has a decent sized processor (32-bit) and an operating system that gcc supports can be made to compile C/C++ etc listed here. The tricky parts are:
You need enough storage to have sufficient libraries etc to make it worthwhile. (RAM may also be an issue in some cases, especially if you try to compile LARGE sections of code).
Getting the code onto the device - if you are just copying files over, then it's no big deal, but if you need to actually type code in, you will need a keyboard and a screen.
I personally prefer to use a device to log into my desktop over the internet. As long as you can convince the machine to run ssh or putty (which should work on a lot of things - I can do it on my feeble Android phone - there are versions of Windows phone, iphone and Nokia/Symbian phones can do it too). Now you can compile code on your desktop machine from wherver you are...
Haven't you heard of the Raspberry Pi?

What free JIT compilers are there today, and which is easier to use? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I will start writing a JIT/interpreter for a small language, and would like to use some of the free JIT tools/libraries available today. What are my options (I only know of libjit, LLVM and GNU lightning), and which would be the easier to use (but not too slow)?
The requiremens would be:
Compiling time is not important
Execution time is important, but so long as using the JIT compiler isn't too hard
Ease of use is important
No garbage collection necessary.
Actually, no run-time environment necessary (I'd really just want the JIT: compile into a memory region, then take the pointer and start executing the generated code)
Development will be done in plain standard C (no C++, no platform-specific features), with pthreads.
Plain standard C with good execution time? you must be looking for LuaJIT(actually dynasm which is the backend, but thats still part of LuaJIT), which is a tracing JIT compiler (where as most of those mentioned are static). It does have garbage collection, but it can easy be taken out or modified (there is a planned overhaul of it soonish), and it has a native FFI, so it can easily do external binding (from a C level, so you don't always have to get into the nitty gritty).
Best part, its totally public domain code, and the code is the documentation (which is nice as its well structured).

Resources