I am trying investigate various inter-core communication mechanism on my Dual core Arm-Cortex Processor. One of the core is running a baremetal application and another one is running Linux operating system. I just came across the remoteproc framework ( rpmsg) and I could not find much information online. Only information i found was http://lwn.net/Articles/489009/ which is quite less to get started. Is there any one who could help me with this?
I come across the same issue as well. I found some additional resources:
Doc in the kernel tree as always:
https://www.kernel.org/doc/Documentation/remoteproc.txt
OMAP wiki that gives the overview of the design:
http://omappedia.org/wiki/Design_Overview_-_RPMsg
BTW. Thanks for the lwn link. That's quite helpful.
Since Xilinx' Zynq SoC also includes 2 ARM Cortex-A9 cores, they have published an application note in which they make a Linux Kernel communicate with a FreeRTOS system via remoteproc/rpmsg. You can find the document here: PDF
Although the document is quite specific, you might be able to pull out some information. You can download the sources here: Sign in to Download File (a Xilinx account is required). The *.bsp file can be renamed to *.tar.gz which can then be extracted.
If you have any further questions, don't hesitate to ask.
Related
I'd like to start playing with ARM TrustZone, so I'd like to setup a development environment, unfortunatelly I have the feeling I'm still missing something, I don't know how to put everything together.
This is my current picture:
A SoC with a Cortex-A processor is required
is it possible to develop without a board? i.e. emulators?
TrustZone is a Hardware & Software technology
If I get a SoC board, is the hardware part already covered?
The software (OS/Kernel) part may be solved with GlobalPlatform, OpenTEE, etc.
TrustedApplications development
Which IDE's are there?
How are they deployed to the board?
I know this is a quite extensive question, I'll be happy to get links to online material.
Edit:
Some parts of my question were partially answered, but the most important thing hasn't been answered yet: is the picture I detailed correct and complete? Yes/no, why?
And no, this is not a duplicate of Which ARM based development boards should I use?
For emulator, you can use ARM Fast Model (https://developer.arm.com/products/system-design/fast-models) if you have the budget.
QEmu might have some Trustzone support but I am not sure how reliable is the Trustzone implementation (What works on QEmu might not work on real hardware). joakim-bech (one of the lead engineer working on an Open-Source implementation of Trusted OS) said in his stackoverflow response it should work; And he has still confirmed it in the blog post TEE Development With No Hardware - Is That Possible?...
I would recommand you to have a look at the list of platforms supported by Optee - Open Portable Trusted Execution Environment: https://github.com/OP-TEE/optee_os#3-platforms-supported
The answers to your other questions would really depend of the platform you use, your budget, your development environment, etc
For less than $150:
If you want to stick to Windows you might have to build qEmu yourself (qEmu seems to support Windows but I am not sure if the Windows already-built binaries support Trustzone). In term of HW board, I use the Hikey board (currently at $119) for my Trustzone development.
Using Linux for the development will probably save you some time as for this budget you will probably have to use Open-Source solutions that generally primarily support Linux.
To start developing a Trusted App for OP-TEE:
I used this presentation: https://www.slideshare.net/linaroorg/lcu14103-how-to-create-and-run-trusted-applications-on-optee
I updated/improved the original example code, my changes could be found here: https://github.com/oliviermartin/lcu14_optee_hello_world
I am attempting to utilize the arm dsp cores with the Psoc5LP system from cypress. I have found examples at
http://www.disca.upv.es/aperles/arm_cortex_m3/curset/CMSIS/Documentation/DSP/html/arm_fft_bin_example_f32_8c-example.html
Primarily the fft example is what I am interested in replicating, but I am confused slightly on how cores work. I have used the picoblaze core on Xilinx Spartan-6 before but I have never used premade cores, especially for Psoc.
I have looked at the psoc system reference guide and found information on CMSIS under startup and linking, but it does not make full sense to me. could someone please point me in the right direction to get me started? also will I have to download all the files individually that I need such as the arm_math.c for the fft example (if so I think that's the only file I need?), or will I just need to download the CMSIS version 4.3 from arms website
https://silver.arm.com/browse/CMSIS#
I'm trying to implement spectral flux analysis and autocorrelation using these cores and I think they are a good place to start.
Thanks in advance,
Scarlson
You need to download the CMSIS package from the ARM website.
Inside of the package you will find a "CMSIS" folder which you have to copy to your project (Step #1).
Next you have to follow these steps:
http://www.cypress.com/knowledge-base-article/including-cortex-microcontroller-software-interface-standard-cmsis-library
Step #5 seems to be obsolete.
You now have to include the functions you want to use manually (Step #6) into the project.
For FFT this is:
CMSIS\DSP_Lib\Source\CommonTables\arm_common_tables.c (for the
twiddle factor table)
CMSIS\DSP_Lib\Source\TransformFunctions\arm< type >init< format >.c
CMSIS\DSP_Lib\Source\TransformFunctions\arm< type >init< format >.c
Does anyone know how to implement the example of TrustZone running "Secure world" and "Normal world" given on the ARM documentation website below on the ZedBoard? Any documentation on this subject (running TrustZone on the ZedBoard) would be also helpful.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15417.html
The ZedBoard has a Xilinx : Zynq® -7000 All Programmable SoC Dual ARM® Cortex™-A9 MPCore™. More information on the ZedBoard can be found here:
http://www.zedboard.org/content/overview
This is a broad topic. Hopefully some of the following information will help.
First off just to de-jargon a little, SOC == system-on-a-chip.
Digilent, the board's manufacturer, has some support files for your board if you have access to the Xilinx toolchain. So first, if you go to http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,1028&Prod=ZEDBOARD , at the bottom, you will find two files named "Linux Hardware Design for ISE" <version number>.
Also assuming you are using the Xilinx development tools, if you browse to Xilinx/<Version Number>/ISE_DS/EDK/hw/XilinxProcessorIPLib/pcores/axi_interconnect_v1_06_a/doc/ds768_axi_interconnect.pdf , you will find information on the AXI interrupt controller your board uses. This includes the fact that it supports TrustZone and some information on actually using it.
Next, if you go to http://zedboard.org/content/creating-custom-peripheral, you will find some instructions on making a "peripheral" device. I put this in quotes because the device in fact exists completely within the programmable logic; it's not something you plug into the micro usb port or what you'd traditionally think of as a "peripheral".
At the end of the tutorial, there is also a link that will help you read data from your peripheral.
If you repeat all those steps with the system.xmp file included in the zip you initially downloaded, then you'll notice all the heavy lifting has been done for you. You have a plugged in and ready to go interrupt controller on the AXI bus already that works with TrustZone, just ready and waiting for you to hook a little hello world device to it.
But what are you going to do with that hello world device? If you look in the assembly for the tutorial you linked to, you'll see in the comments they talk a lot about something called the "Secure Configuration Register". If you look in your processor's documentation (in the resources section here, http://www.arm.com/products/processors/cortex-a/cortex-a9.php) and search for the term "TrustZone extensions" (currently page 34 although obviously that's subject to change), you'll find a link to another page detailing this register. This is the same register they use in the tutorial, so in theory, if you have a trusted execution environment set up, you can now make the hello world tutorial work (mostly; you're going to likely want to do what they do in assembly with either vhdl or verilog code and just expose the results somewhere easy to read in C).
Now everything I have just mentioned will merely get you access to the TrustZone data in the AXI bus. In order to do anything interesting with this, you are going to have to actually create a secure world and normal world to read from. Otherwise any demo you put together will merely print "Hello from Secure World" (or function incorrectly). So this is where unzipping that tutorial you linked to and really reading their source will pay dividends.
Although my answer up until now is also incomplete, as the Hello World tutorial you linked isn't designed to teach you how to create Normal World (and possibly Monitor World) to begin with. Which it says explicitly in the ReadMe.txt . So reading the source won't help you with that. For that, you're going to need the link http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.prd29-genc-009492c/index.html . There's a lot of info there but it's intended as a reference and the first two chapters, in my humble opinion, are just what I like to call "skipable flavor text". Although if you do have time to waste some of it is fascinating and informative as far as security theory in general. Chapter 3 will begin to teach you how to develop for TrustZone.
But hopefully the information I provided will turn this into less of a permissions problem for you and into more of an education problem. I'm still educating myself on this stuff.
As a out of course project, I am currently developing a kernel in an attempt to better understand all the aspects of an actual OS. So far, I am done setting up a flat physical memory model with support for paging and the basic interrupts (keyboard and perhaps trackpad/mouse next). I thought the step forward would be to implement a filesystem and I am keen about the ext2. I have looked around, even on SO but there isn't anything explicit that answers my questions:
Is it possible to write a driver to access an ext2 filesystem in C or do I need to go lower?
If I plan to access the filesystem off a USB device, I am assuming I will need to get the device driver for USB running first. Any help on this would be greatly appreciated.
I know the code for detecting a filesystem is already available on the MINIX and other kernels but what I really want to know is if I want to build a custom albeit simple filesystem, how do I go about it? I am considering this possibility too.
My apologies if the question and details sound a little ignorant but I am still in the learning process.
Thanks :)
I'll try to give you a few tips/hints - a clear answer isn't that simple:
An ext2 filesystem written in C is just C. C is just a programming language - you can use C++, plain assembly or a few others (A few os'dever use D) - but not a "managed" language etc. But it is important that you have a rock solid understanding of this language. In my opinion assembly is a MUST (Take a look at the scheduler in an operating system -> plain assembly)
Do you really want to write an USB driver ? It isn't "just" a simple USB driver (Layer of abstractions). Why a USB driver and not a floppy disk or CD driver (Believe me - a floppy driver in 32 bit protected mode isn't that hard) ?
Please focus on your project. Of course Linux (Early versions) and Minix have example code, but take care of the design structure (Monolithic/Microkernel or hybrid-kernel) - and don't mix it, write your own code.
Please make on step after the other. You wrote a basic IRQ handling and the plan is to write a keyboard/mouse driver - write the keyboard driver ! Don't dream about loading and executing files (Rom wasn't built in one day).
You have to read documentations, for example the Intel manuals or other "books". A very popular forum is osdev.org - take a look at the wiki. As twalberg said, it's a very huge module - stay focused on the main parts of your operating system.
I know, this is not the answer to your question - but it's important not to go in the wrong direction and dream of a fancy UI or something like this ;)
osdev.org forum
osdev.org wiki
Intel manuals
And a few other books in my book shelf can you find here (Tanenbaum, Silberschatz with Peter Galvin - great books!):
Books
I have been looking for literature covering the mechanics behind a hypervisor/microkernel that explains how it works, the design behind etc but can´t find anything except published cs papers and wikipedia.
I'm very interested in this field and would like to know more, so im wondering if anyone could recommend any literature in this area? The closest that I can think of is books covering operating systems.
I´m mostly interested in the added security benefits a hypervisor can provide for a OS instead of the running several OS´s on top of a hypervisor.
Thanks!
The hypervisor topic is closely knit with the hardware used along with it.
So it is difficult to find out the hypervisor explanation without knowing hardware details.
So if the hypervisor is implemented on ARMv7, you need to look the hypervisor implementation along with the hardware support e.g. virtualization extension or security extension provided by hardware.
A good writeup is available on
genode web page
You will find article on security extension also there.
This documentation is targeted for ARMv7 hardware.
ARMv7 Cortex A : architecture reference manual will provide more details of hardware support required for hypervisor.