FreeRTOS compiler [closed] - rtos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I just started learning FreeRtos. I have started with "Using the FreeRtos Real Time Kernel" pdf book of Richard Barry.
The book has comprehensive examples and I understood the principles very well but I want to be able to compile this examples somewhere.
Now this may sound like a dumb question but I'm totally new to RTOS :D.
What compiler can I use to compile freeRtos code? I have googled a lot and I found some compiler named Watcom and tried to run some code in it but couldn't and could not find any examples on how to use this compiler.
So basically what I would like is some examples of actually someone showing how to run simple freeRtos code in a compiler then run it and see the actual results in a console.
Any links would be appreciated. Thank you for reading!

FreeRTOS supports a large range of compilers. The officially supported compilers for each officially supported port are listed on the Official FreeRTOS Ports page.
You can use any of the compilers listed (and probably more, but they won't be officially supported). In general, you should be able to keep using what you already use, since FreeRTOS typically supports the standard vendor-supplied compiler of whatever platform you are using.

Normally you run a FreeRTOS application in a stand-alone environment - ie, the system boots directly into your application rather then being loaded by an OS (there may be an intermediate bootloader in some cases).
There is no concept of a "console" in FreeRTOS itself; your application must implement support for stdio or low-level I/O, typically via a UART and a terminal emulator running on the development host or by using semi-hosting via your debugger. This is a mater of porting your standard library rather than an issue for FreeRTOS. The standard library should have some sort fo pirting layer (known as "syscalls" in Newlib, or "Retargetting" in ARM/Keil toolchains for example).
FreeRTOS applications are built using cross-development tools rather than hosted development environments. That is the code is build on a development host using a cross-compiler then loaded to the target hardware and executed. There is a Win32 port of FreeRTOS that allows FreeRTOS applications to be built and executed on a Windows host, but the port is only a simulation, and does not provide hard-real-time scheduling. It is useful for development before hardware is available and testing and debugging using the more sophisticated debugging environment provided by Visual Studio that that typically available to embedded targets.
What you would normally do is select a hardware platform that FreeRTOS supports and meets your application needs, then select a toolchain that supports your hardware platform and is in turn supported by FreeRTOS. For most 32 bit platforms and the 8-bit AtmelAVR platform GNU gcc is near ubiquitous, and many proprietary compilers support GNU extensions for compatability. Unless you choose a particularly obscure toolchain/target combination, you are unlikely to not be able to either port to use an existing port of FreeRTOS.

You can use System Workbench for STM32 if you are using a STM32 based board. System Workbench utilized GCC based compiler and it is very enjoyable to use. You can easily download the wholly cross-platform IDE and the compiler tool from the following link:
System Workbench for STM32

Related

Create VST plug-ins [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I want to create a third-party plug-in for Serato (a software for DJs).
I searched in their site and I saw that Serato supports VST (VST2) plug-ins. So my question now is what should I read in order to create a VST plug-in?
Thank you in advance.
A good starting point would be the wikipedia site for VSTs, just to get the basics if you are not familiar with this technology, first you need to know the creators of the VSTs: Steinberg.
VST SDK is a set of C++ classes based around an underlying C API. The
SDK can be downloaded from their website.
Therefore I would recommend starting with something simple. Let’s review a few options:
JUCE
This technology is trending for a few reasons, like their homepage says:
With support for PC, Mac and Linux, JUCE is the perfect tool for
building powerful and complex applications. JUCE also supports the
development of plug-ins: VST, AU and AAX. Run your desktop
applications on mobile! One-click deployment to Android and iOS
(requires Android Studio and XCode) Adjust the user interface of your
application with the Projucer live coding engine Use the best audio
performance available on iOS and Android.
So the pros of this technology are the big community, multi-platform and that is free, at least for non-commercial developments (then if you want to sell it you have to pay). The cons would be that you need to have a little more than the basics of C++ to get started, fortunately there are a lot of tutorials on their page, youtube and the internet, the community is growing so if you have issues you can always ask.
SynthEdit and FL SynthMaker
If you don’t want to get into the code that fast you can start practicing with these, as they don’t require programming expertise, or only a few basics.
SynthEdit is a framework and a visual circuit design that allows you
to create your own synths with only drag & drop without programming.
Therefore giving you the flexibility of using your DSP algorithms
inside the modules.
This is cool if you want to start going quickly, this currently has a cost you can check on their official website.
FL SynthMaker, aka Flowstone, comes free with FL studio. It has a straightforward drag-and-drop graphical interface and a wide range of components. You can use it to code modules and DSP in Ruby and comes with loads of examples to get started quickly and its capacity to assist you in creating a prototype within a short time is a plus.
FLowstone is a programming application that is used to create virtual
instruments effects and computer control of external hardware without
the need to write basic code. The instruments and effects you create
in SynthMaker can be used in FL Studio as 'native' plugins and shared
with other FLowstone users.
MAX MSP
Max, also known as Max/MSP/Jitter, is a visual programming language for music and multimedia developed and maintained by San Francisco-based software company Cycling '74. Over its more than thirty-year history, composers, performers, software designers, researchers, and artists have used it to create recordings, performances, and installations.
The Max program is modular, with most routines existing as shared
libraries. An application programming interface (API) allows
third-party development of new routines (named external objects).
Thus, Max has a large user base of programmers unaffiliated with
Cycling '74 who enhance the software with commercial and
non-commercial extensions to the program. Because of this extensible
design, which simultaneously represents both the program's structure
and its graphical user interface (GUI), Max has been described as the
lingua franca for developing interactive music performance software.
SOUL
The SOUL project is creating a new language and infrastructure for
writing and deploying audio code. It aims to unlock improvements in
latency, performance, portability and ease-of-development that aren't
possible with the current mainstream techniques that are being used.
SOUL unlocks native-level speed, even when hosted from slower, safer
languages. The SOUL language makes audio coding more accessible and
less error-prone, enhancing productivity for both beginners and expert
professionals.
Maximilian
Is a cross-platform and multi-target audio synthesis and signal processing library. It was written in C++ and provides bindings to Javascript. It's compatible with native implementations for MacOS, Windows, Linux and iOS systems, and client-side browser-based applications. The main features are:
sample playback, recording and looping
support for WAV and OGG files.
a selection of oscillators and filters enveloping
multichannel mixing for 1, 2, 4 and 8 channel setups controller
mapping functions
effects including delay, distortion, chorus, flanging granular
synthesis, including time and pitch stretching atom synthesis
real-time music information retrieval functions: spectrum analysis,
spectral features, octave analysis, Bark scale analysis, and MFCCs
example projects for Windows and MacOS, using command line and
OpenFrameworks environments
example projects for Firefox and Chromium-based browsers using the
Web Audio API ScriptProcessorNode (deprecated!)
example projects for Chromium-based browsers using the Web Audio API
AudioWorklet (e.g. Chrome, Brave, Edge, Opera, Vivaldi)
Extras
A few months ago I found this community that is focused on audio programming. They also have a Youtube channel with hundreds of tutorials and a discord server where you can ask questions, and even show your projects or even get a job. If you are interested. It’s called the “The audio Programmer”
Hope this helps you get started. I know there are a lot of option out there and this might confuse you at the beginning but I hope this little guide helps you choose a good starting point depending on your needs and goals since every technology offers different things.

How does the OpenVINO toolkit program the FPGA?

So, I've been meaning to find an answer to this question for about 3 months now. I'm just a beginner to the world of FPGA and hardware programming in general. I've only built the NIOS and tried a few things using quartus and a DE10 standard FPGA (which I don't have access to anymore). So, all I know is that a bitstream or netlist is created to program an FPGA, which I can do from the programmer feature in quartus after the design is complete.
My problem here is, how does OpenVINO manage to program the FPGA while the code is written in python and may use several libraries. I've already ordered OpenVINO starter platform FPGA.. but I need to know how this works. I've only seen like 1 python to HDL synthesizer, which is MyHDL and it looked quite complicated.
OpenVINO FPGA depends on dlaplugin, Intel DLA architecture follows set of configuration methods, can be configured with Deep Learning Suite which is not provided as open source.
Intel FPGA runtime stack need to be installed to program an Intel FPGA.
aocl program device bitstream.aocx
after, dlaplugin helps to run application on FPGA

What is porting in RTOS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I recently started learning about RTOS’s and came across the subject “porting”. I always tought that I could copy the RTOS files from github, paste it in my project and use it without any problems on any device. So I am a little confused about porting. I have two questions:
What is porting in terms of RTOS?
Why do I need porting of RTOS’s?
Thanks in advance,
Arjon
Porting is the act of taking software written to run on one system and modifying it so it runs on another system. From Wikipedia,
In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally designed for
And,
When code is not compatible with a particular operating system or architecture, the code must be [ported] to the new system.
And,
Porting is also the term used when a video game designed to run on one platform, be it an arcade, video game console, or personal computer, is converted to run on a different platform
In other words, you have some software you want to run on a real-time operating system (RTOS). That software was not written to run on RTOS, and will fail unless it is modified accordingly. It must be ported to RTOS before it can run. If you don't port the software, it will not run on the new system.
The nature and scope of those modifications depends on the software and the specific RTOS.
An RTOS interacts directly with processor and platform hardware. When an RTOS is designed to run of different hardware, you necessarily have target specific code to adapt the generic code to the specific hardware and processor architecture.
As a minimum an RTOS requires a system timer generating an interrupt, and to perform context switch it requires direct access to the processor registers in order to restore the context, set the stack pointer for the task to switch to and effect a jump by setting the program counter - that cannot be done with generic code since it requires intimate hardware knowledge.
The "port" of an RTOS requires code written specifically for the target platform including code to handle the timer interrupt, select which timer will be used as the system timer, and effect a context switch. Often much of this code must be written in assembler for direct register access which is necessarily architecture specific.
In addition to the kernel scheduler, depending on the scope of the RTOS in terms of the services it provides, there may be code required to deal with target specific MMU/MPU support and I/O drivers for filesystems, networking etc.

Linux kernel device driver programming [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to learn linux kernel device driver programming. So can anyone please post good tutorials pages or links here. I am new to linux kernel environment. I have searched for it but I don't know how to start and which one to read for easy understanding basics. Thanks in advance.
Depends on your current skills. If you're really new to Linux, perhaps you should start with user space system programming with Advanced Linux Programming. You'll get good knowledge of Unix system calls and other concepts such as signals, processes/threads and so on with this free resource. This is a must (understanding the user space API) if you're developing on the kernel side since the role of a kernel is providing services to users in a secure way.
Otherwise one often cited book is Linux Device Drivers, Third Edition (LDD3). Keep in mind that this edition was written at the time of Linux 2.6.10 and some things changed since then. This article shows the differences as 2.6 evolved (until 2.6.31, that is, so not very useful). I should mention martinezjavier/ldd3, which contains example drivers of LDD3 updated for more recent kernels (thanks to 42n4 for pointing that out).
Another interesting book that's not as often cited is Essential Linux Device Drivers. You won't find a free version of this one, but it still features an interesting approach. What I like about this one is it covers lots of different device types and is up-to-date as of 2.6.24, which is a bit better than LDD.
Finally, one great book about the kernel itself (not specifically for drivers) is Understanding the Linux Kernel, 3rd Edition. This covers in-depth kernel facilities and internal mechanisms. It's up-to-date as of 2.6.11.
As for online tutorials, I found this post on Pete's Blog is a really great example. Not only does it show how to create a character device (the most easy kernel driver type, i.e. the one you should start with), it uses modern Linux kernel features in an easy to understand fashion, including:
use of udev
use of a kernel data structure (FIFO)
use of kernel synchronization (mutex)
use of Sysfs with custom attributes
module options for insmod
Plus: it's aimed at Linux 3.0, which means it's more up-to-date compared to other resources.
You might also like this post about how to create Sysfs entries manually, although the Linux device model will take care of registering your device as a Sysfs entry if you don't need additional nodes or attributes.
Edit: I should add that the best way to learn real Linux device driver programming is to look at actual drivers. There are thousands of drivers in drivers. Start reading and understanding the concept of simple ones like drivers/leds and you will see how rewarding this is.
The site with very important links:
http://elinux.org/Device_drivers
Great tutorial with real examples (ends with an usbpen formatted with our own file system - search for author further articles):
http://www.linuxforu.com/tag/linux-device-drivers-series/
http://sysplay.in/index.php?pagefile=lfy_articles
Source code of famous LDD3 book ported to newest kernels:
https://github.com/martinezjavier/ldd3/
Videos:
https://www.youtube.com/playlist?list=PL16941B715F5507C5
Maybe other cources:
http://www.skilledup.com/courses?keyword=linux+kernel&price_filter=0..0
Some examples:
http://www.staerk.de/thorsten/index.php/My_Tutorials/Writing_Linux_kernel_modules
http://www.freesoftwaremagazine.com/articles/drivers_linux
http://techblog.aasisvinayak.com/kernel-module-programming-tutorial/
http://www.linuxforu.com/2009/05/a-voyage-to-the-kernel-day-11/
Books (without mentioned in this thread LDD3):
http://www.coopj.com/ with an updated source code http://www.coopj.com/LPD/
KernelHacking:
http://kernelnewbies.org/KernelHacking
Visual map of the linux kernel: http://www.makelinux.net/kernel_map/
Linux and kernel books for beginners:
http://www.kroah.com/lkn/
http://swift.siphos.be/linux_sea/
You might be interested in the newly released Linux Driver Templates. As the name suggests, it provides templates and demonstrates frequently used Linux facilities to get started quickly.
I understand it is a delayed response !!
You can pick any book, those are really great books suggested above.
But you need to really work practically. Try to be involved into Kernel as much as possible.
Mostly you need to look into kernel source code itself.
And the most interesting document you can find in Documentation folder under Kernel tree.
best book for learning device driver programming is
"LDD"
Professional Linux Kernel Architecture is a good read also.
The best source is the linux man pages but they are somewhat critical to understand for a beginner, Directly programming device drivers is not a easy task. I recommend you to go through pointers and structures through following books
Basic C Books 1. Programming C - Byron gottfried 2. The C Programming Language - Dennis Ritchie
Intermediate Books 1. Pointers on C Kenneth Reek 2. Expert C Programming Deep Secrets - Linden
Coming to device Drivers I have uploaded the Kernel Source documentation in pdf format https://drive.google.com/folderview?id=0B7iRyndFhHldR3hjOHpOZTdKTjA&usp=sharing Youcan download from this link.
Device Drivers Basics (User mode Programming)
Linux Programming interface - Michael Kerrisk
Beginning Linux Programming Wrox Publishers
Device Drivers (Kernel Deleopment) 1. Linux Kernel Development - Robert Love 2. Linux Kernel Internals - m beck
Device Drivers (Driver Programming) 1. Linux Device Drivers - Third Edition (Free Download is available for 2.6 Kernel) 2. Essential Linux Device Drivers - Venkateswaran
For Basic Driver Knowledge Follow this site http://www.tldp.org/LDP/khg/HyperNews/get/devices/devices.html
My Experience is First of all we must gain a sound knowledge on C Programming, mainly Structures and Pointers before going through Driver Programming otherwise it will be bit cumbersome to understand driver programming.
Comming to Startup :-
User space programming
Basics of gcc generating proprocessed, assembler and object files using gcc commands analysis of object files using different object tools, Basic programming in linux, threads(locks, synchronization techniques), signals, processes(fork, exec), timers(Posix). This will help you lot in understanding kernel concepts.
Kernel Programming
Understanding the kernel source tree, different branches and their importance, using ctags and cscope to browse kernel source code, this will help you in kernel source browsing.
Driver Programming
First of all Learn different driver classes, char, block etc.,
Next learn the device protocols, transmission and reception, the product manual is the best source for going through this.
Then start writing the simple char driver for example RTC (a port mapped device), IOAPIC (A memory mapped device), then go to USB, PCI, Network, I2C, SPI etc., if you want the help you can find the skeleton code for all this in kernel source tree.

Developing an operating system for the x86 architecture [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am planning to develop an operating system for the x86 architecture.
What options of programming languages do I have?
What types of compilers are there available, preferably on a Windows environment?
Are there any good sources that will help me learn more about operating system development?
Is it better to test my operating system on a Virtual Machine or on physical hardware?
Any suggestions?
For my final year project in collage I developed a small x86 OS with a virtual memory manager, a virtual file system and fully preemptive multitasking. I made it open source and the code is heavily commented, check out its source forge page at:
https://github.com/stephenfewer/NoNameOS
From my experience I can recommend the following:
You will need x86 assembly language for various parts, this in unavoidable, but can be kept to a minimum. Fairly quickly you will get running C code, which is a proven choice for OS development. Once you have some sort of memory manager available you can go into C++ if you like (you need some kind of memory manager for things like new and delete).
No matter what language you choose you will still need assembly & C to bring a system from boot where the BIOS leaves you into any useable form.
Ultimately, the primary language you choose will depend on the type of OS you want to develop.
My development environment was the Windows port of the GNU development tools DJGPP along with the NASM assembler. For my IDE I used IBM's Eclipse with the CDT plugin which provides a C/C++ development environment within Eclipse.
For testing I recommend BOCHS, an open source x86 PC emulator. It lets you boot up your OS quickly which is great for testing and can be integrated into eclipse so you can build and run your OS at the push of a button. I would also recommend using both VMWare and a physical PC occasionally as you can pick up on some subtle bugs that way.
P.S. OS development is really fun but is very intensive, mine took the best part of 12 months. My advice is to plan well and your design is key! enjoy :)
Language and compiler depend entirely on what you're attempting to accomplish. I would suggest, though, that you might be approaching the problem from too low a level.
There are materials out there on operating system fundamentals. MIT has OpenCourseware on the subject. Read through Andrew Tannenbaum's Operating Systems series, and look at things like Minix.
Get an idea for what's out there. Start tinkering with things. Borrow ideas, and see where they go. You can reinvent the wheel if you really want, but you'll learn more by building on the works of others.
It doesn't really matter, what language you choose. If the language is Turing-complete, then you can write an OS in it.
However, the expressiveness of the language will make certain kinds of designs very easy or very hard to implement. For example, the "liveliness" and dynamism of the old Smalltalk OSs depends on the fact that they are implemented in Smalltalk. You could do that in C, too, but it would probably be so hard that you wouldn't even think about it. JavaScript or Ruby OTOH would probably be a great fit.
Microsoft Research's Singularity is another example. It simply couldn't be implemented in anything other than Sing#, Spec# and C# (or similar languages), because so much of the architecture is dependent on the static type safety and static verifiability of those languages.
One thing to keep in mind: the design space for OSs implemented in C is pretty much fully explored. There's literally thousands of them. In other languages, however, you might actually discover something that nobody has discovered before! There's only about a dozen or so OSs written in Java, about half a dozen in C#, something on the order of two OSs in Haskell, only one in Python and none in Ruby or JavaScript.
Try writing an OS in Erlang or Io, and see how that influences your thinking about Operating Systems!
There is an OS course offered at the University of Maryland that utilizes GeekOS. This is a small, extensively commented OS designed for educational purposes which can be run using the Bochs or QEMU emulators.
For an example of how it is used in a course, check out a previous offering of the course at the class webpage. There, you will find assignments where you have to add different functionality to GeekOS.
Its a great way to get familiar with a small and simple OS that runs on the x86 architecture.
You might want to look up XINU. it's a tiny OS for x86 that isn't really used for anything other than to be dissected by students.
Use ANSI C, and start off with an emulator.
When you port over to a real machine, there will be some assembler code. Context switching and interrupt handling (for instance) is easier to write in assembler.
Andy Tannenbaum has written a good book on OS. Many other good ones exist.
Good luck! There is nothing quite like haveing written your own OS, however small.
Also check out the OSDev.org which have all information you need to get started.
I've done that once for a 386SX, which was on a PCI board. A good source on how to start a X86 cpu in protected mode is the source code of linux. It's just a few assembly statements. After that you can use gcc to compile your C code. The result is objectcode in ELF format. I wrote my own linker, to make a program out of the objectcode. And yes, it worked! Good luck.
Be sure to check out the answers to my question:
How to get started in operating system development
Without a doubt, I'd use Ada. It's the best general-purpose systems-programming language I have come across, bar none. One example, Ada's much better for specifying bit layout of objects in a record than C. Ada also supports overlaying records on specific memory locations. C requires you to play with pointers to acheive the same effect. That works, but is more error-prone. Ada also has language support for interrupts.
Another: Safety. Ada defaults to bound checking array assignments, but allows you to turn it off when you need it. C "defaults" to no bound checking on arrays,so you have to do it yourself manually whenever you want it. Time has shown that this is not the right default. You will forget one where it is needed. Buffer overflow exploits are the single most common security flaw used by crackers. They have whole websites explainng how to find and use them.
As for learning about doing this, the two books I'm aware of are XINU (Unix backwards, nothing to do with Scientology), and Project Oberon. The first was used in my Operating Systems graduate course, and the second was written by Nikalus Wirth, creator of Pascal.
If you are making a full OS, you will need to use a range of languages. I would expect Assembly, C and C++ at the very least.
I would use a Virtual Machine for most of the testing.
C most probably...all major OS-es have been written in C/C++ or Objective-C(Apple)
If you want write an OS then you need a couple of people. A OS can not write a single people. I think it is better to work on existing OS projects
Reactos --> C, Assembler
SharpOS --> C#
JNode --> Java
This is only a short list of OS projects. How you can see there is a project for every possible language.