Embedded Software Colin Walls
Colin Walls has over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, Colin is an embedded software technologist with Mentor … More » A hypervisor on a multicore systemApril 16th, 2020 by Colin Walls
Multicore systems may be configured in a number of different ways. An approach that is useful for many embedded applications is Asymmetrical MultiProcessing [AMP], where each CPU runs its own operating system or may no OS at all. A particular facet of interest is the incorporation of a hypervisor in an AMP system … All embedded systems have finite resources, which need to be managed. It may be argued that this is the crux of what embedded software development is all about. For the purposes of this discussion, I want to consider a hypothetical example system which has a single serial port. There are various ways that this port may be managed, depending on the configuration of software and CPU hardware. On a single core system, the operating system can manage access to the serial port and arbitrate between multiple tasks that might wish to make use of it. There are lots of ways that this might be achieved, and this is a well-trodden path. If the system has multiple, identical cores, it might be useful to configure it as Symmetrical MultiProcessing [SMP] – a single operating system instance running across all the cores. SMP versions of many RTOS products [like Nucleus] are available and Linux with SMP support is also an option. This approach is ideal if the application benefits from the OS being able to distribute CPU power as needed. The OS can manage access to the serial port in much the same way as on a single core system. On many systems SMP is unattractive, because more precise control is required, or the system has so many cores that performance degradation is likely. On others, SMP is impossible, because the cores are not identical. In these cases, an AMP configuration, with a separate OS instance on each core, makes sense. This presents a challenge: how might the single serial port be managed? If all the cores in the system are suitable for running a hypervisor, a possibility is to run it on all of them, with each core’s OS considered to be a “guest”. Access to the serial port may then be managed by the hypervisor. If one or more of the cores are not capable of running a hypervisor, an alternative option is available in the form of a Multicore Framework, perhaps based on OpenAMP. This facilitates management of the smaller core by the hypervisor running elsewhere. Thus, the hypervisor can manage access to the serial port by all the cores in the system, whether they are running the hypervisor or framework. This short video expands on some of these concepts and shows a real application that uses a hypervisor in an AMP system:
|