Linux support for AMP architecture? - linux

When I search about linux kernel, I know that linux support for SMP architecture.
But I don't find any specification about the linux for AMP.
Does linux support for AMP?
Have any documents or specification for descripting about that?
Anyone help?

Linux has the remoteproc subsystem and the closely tied virtio and rpmsg. remoteproc can be use to boot up a firmware blob on the remote core and the communicated with it using rpmsg. Examples of such processors include iMX7 and Vybrid. Vybrid has a Cortex A5 and Cortex M4.
See the documentation on remoteproc. ARM's big.Little might also interest you.

Yes. AMP precedes SMP, and both techs precede Linux.
Asymmetric multi processing was used when 2 Pentium II 33MhZ processors ran in parallel on the same motherboard.
It's an old Operating System, that is still supported in the current Linux kernel, and is in fact getting a face lift since cloud computing (which is essentially the same concept as AMP, but across a network instead of across a motherboard.
There's no recent talks about AMP around Linux devs, but just ask some of the cloud devs they'll talk your ears off about AMP.

Related

How to start developing and debugging the Linux Kernel?

I want to start some Linux development for my research. Writing few simple scheduling algorithms and test them. I have few questions:
1) How do you develop for the linux kernel? IDE? How do you import the kernel files and see how they are related or connected?
2) Once you write your code, how do you simulate/debug it? I mean one can't just build the kernel for 20 - 30 minutes, make a new image and change boot.ini each time. This is a lenghty process plus you can't simulate or debug just observe if it works or not.
3) Is there A guide for starting developing in Linux. I find the lack of documentation surprising
I am developing for ARM-based boards
Excuse my ignorance.
Thanks
How do you develop for Linux kernel?
There are many components in the Linux kernel. Typically, kernel is divided into core and driver parts.
Core includes scheduling, MMU, memory management, process management etc
Drivers includes file system, networking, peripheral device drivers, USB etc
IDE is not a must to develop kernel code. For kernel veterans, VIM/nano is also OK. The development environment is up to you. If you are new to the kernel code, you want to build the function relationship views, some tools can be helpful:
Source Insight (Commercial)
vim + ctags (http://vim.wikia.com/wiki/Single_tags_file_for_a_source_tree)
How to debug it?
There are many Linux favors/distributions. You can use Software emulator or Hardware boards to debug the kernel. Android is based on Linux and there are many mobile phones or development boards that support Android. iOS is also derived from Linux and it is its own debug method.
Where to find the kernel documents?
For kernel part, there are many readme articles in kernel source tree. e.g. http://lxr.free-electrons.com/source/Documentation/debugging-via-ohci1394.txt
printk is powerful enough for newbies.
For ARM part, there are many articles in infocenter.arm.com
Debugging Linux kernels using DS-5
http://infocenter.arm.com/help/topic/com.arm.doc.den0024a/ch18s03s03.html?resultof=%22%6b%65%72%6e%65%6c%22%20

It is possible to combine Linux (one core) and bare-bone firmware (second core) on one dual core computer?

I was checking project Embedded ECG data acquisition system from instructables and there is mension a TODO:
Combining the OS and bare-bone firmware
UNDER CONSTRUCTION
** Since the bootloader only loads one firmware to the Core,
I need to modify the ELF file, to have Linux and bare-bone Core at the same time **
It seems to me as interresting approach how to make full featured Linux and critical realtime OS on one board (for example Raspberry PI). It is really possible? I have heard, that Linux can be setup to not use some cores. But I suppose that Linux use virtual memory and bare-bone firmware does usually not. Can the memory be shared between these OS. What about interruptions? Can these two OS handle interruptions separately? Can boot loader load these two systems to both core at once? I can imagine that one thread in boot loader will skip to address of bare-bone OS. It is correct approach?
Yes, it is possible, even if the full setup is not straightforward.
A couple of examples:
Xilinx released a white paper explaining how to run Linux + FreeRTOS on a dual-core Zynq ARM
Evidence explained how to run Linux + Erika Enterprise RTOS on a dual-core Freescale imx6 ARM
Those examples are based on system partitioning by hard-coding the assignment of the different cores to different OSs.
If your system is capable of hardware-assisted virtualization, you can use an hypervisor for making (and enforcing) such partitioning. You can for example use Siemen's Jailhouse, KVM or Xen.
Kind of. This is what people already do to some extent with network stack / driver. For example IsoStack idea works in a similar way. There's a project which actually implements this on linux by dedicating cores to network cards, but my google-fu is failing me.

What is SoC (system on chip)? Does Renesas V850 have a system on it?

I have experience writing a C program and burning the program into a chip using an IDE provided by the chip manufacturer.
I also heard that there is a concept called SoC, which means an operating system, like Linux, is running on a chip. In this case, I can run my program on the chip just like on a Linux PC.
I don't really know the differences between these two kinds of chips. Are they the same? Can I install Linux on every chip?
And I have to use a chip called Renesas V850 in my work. Which kind of chip is this V850?
SoC is just a marketing term for 'more than a processor on a chip'. It doesn't mean Linux or operating system.
Years ago, each part of a system was on its own chip: processor, serial port, memory, ADC, DAC, etc. You had a PCB and a schematic that tied them all together.
Over time, more and more got integrated into the processor, particularly for application-specific processors and microcontrollers. Today, pretty much only big iron processors like Intel and AMD flagship processors are stand-alone, and even then there's some x86 chip produced that are 'SoC's (like the AMD Geode line, if that's still around). Everything else has USB ports, serial ports, ADCs, DACs, even wireless radios integrated into the same die.
As for 'what is a Renasas v850?' You'd do better to google that and read the product documentation. It isn't an ARM or MIPs core, and it doesn't appear to support the mainline Linux kernel, only μClinux.
The Renesas V850 Wikipedia page states that the Linux kernel support for v850 has been absent since version 2.6.27 (which released in 2008).
Typically, you need to know what group your chip belongs to and to read more about it on Renesas website. They provide all the documentation you may need. There is also a section for application notes and sample code that may also help.

Porting PCIe driver from Linux to FreeBSD

I have a fairly large PCIe driver written on/for Linux, now I need to port it on FreeBSD. I don't yet know the BSD version, but I think at this point it's irrelevant, as I'd like to understand in general what major items will have to be modified during the porting efforts.
The good thing is that the driver is partitioned into OS independent "library" layer (OSI) and OS dependent, so it already has a "framework" permitting to port it on other OS-es, and I hope most of the efforts will be focused on OSI side. So far I see the following big chunks of work:
init code, i.e. the OS-specific code that "plugs" the driver into
system (similar to what init_module, cleanup_module does in Linux)
code registering driver in a PCI core subsystem of the kernel
character driver registration code 4) DMA operations
What else should I be paying attention to? This driver is a device doing hardware encryption, so it is offload device (ingress packets from NIC enter system normally and then diverted to the device).
If there are useful web links to description of BSD drivers development/porting (similar to LDD), I'd happily accept it :)
In 2011, Jeff Roberson (and later Mellanox) added some shims to ease porting Linux drivers, which makes most of the code be used as-is, when he ported the Linux InfiniBand drivers to FreeBSD. So, assuming I am some newcomer from Linux driver development world, I'd start by looking at:
https://svnweb.freebsd.org/base/head/sys/ofed/include/linux/
Where you would find implementations of many required Linux driver API and their FreeBSD native counterpart.
There is another quickstart document by John-Mark, here, helpful for those who are already familiar with driver writing.
If you would prefer starting from the beginning, I think the FreeBSD Architecture Handbook would be an useful start point.
Additionally, there is a book by Kirk McKusick, Robert Watson and George Neville-Neil, titled "The Design and Implementation of the FreeBSD Operating System", the latest version at this time is 2nd edition, and the chapter 8 detailed device drivers.
Most device drivers are merely wrappers of hardware operation to fit OS interfaces, so a well layered driver should be relatively easy to port nowadays.
If you have questions, or is a vendor of hardware, you can also join various FreeBSD mailing lists (freebsd-drivers#, etc.).

Benefits of UNIX or UNIX variant on microcontroller?

This may be a foolish question but I've been searching around for some time and don't see a clear answer. I've seen several microcontrollers advertised as running Unix-like software (Linux, Ubuntu) for example, the BeagleBone Black and Arduino Yun. Can someone please explain to me the benefit of this? So far I've used a couple of microcontrollers like the Arduino Uno/Duo, Freescale FRDM and STM32 Discovery which either didn't have this feature or I was not aware of it. I'm starting to see it more and more on newer microcontrollers so I'd like to know what it brings to the table.
Full disclosure: I've had minimal exposure to UNIX and its variants so far so please talk slowly and use small words =)
Hope to hear from you,
Yusif Nurizade
You get complex drivers already included Linux for free (USB, internet protocols, storage media and file systems).
You can use lots of free software for the things not included in the kernel.
It is simpler to develop software on a full OS (easier to debug, look what is going on, change the configuration, etc etc).
The drawback is that the real-time capabilities are generally worse than for some small RTOS, and it needs more resources (a couple of megabytes memory).
In the heart of all Android and iphone is a Embedded Linux System. Without getting too deep
Linux + Java = Android
BSD Unix variant + C/C++/Object C = iOS
Now if you get deeper the above two statement can be argued for accuracy
All Android devices run on ARM based microprocessors. Beaglebone is one such open source hardware platform with can run Android as well as Embedded Linux distribution and even a Ubuntu.
Now (IMHO) Ubuntu is primarily for desktop and server application. Many of the popular computer server farms uses Ubuntu.
Now STM32 is a ARM based CORTEX-M micro control. Once again (IMHO) is mostly used for bare metal embedded applications. I have hard that FreeRTOS can be ported to TM4C123 ARM Cortex-M TM4C123.
Now the advantages of using Linux base micro controller architecture are
OS is free for the most part
Larger community of users
The industry is moving towards open source
Lot of free resources get up to speed
Disadvantage are
Learning curve is pretty steep
Expect to stumble and fall a few time
Below to two good resources to learn Beaglebone open source development
Beaglebone
Introduction to Beaglebone development by Derek Molloy of Dublin City University
HTH and good luck

Resources