This commit splits the 'locore' and 'main' memory regions into
separate executable images and specifies the 'locore' as the boot
kernel, in order to prevent the QEMU direct multiboot kernel loader
from overwriting the BIOS and option ROM areas located in between
the two memory regions.
The Zephyr x86-64 kernel image consists of two discontiguous load
memory regions: 'locore' at 0x8000 and 'main' at 0x100000, but the
QEMU treats these as single contiguous memory region starting at
0x8000 and ending at (0x100000 + MAIN_IMAGE_SIZE - 1).
This results in the direct multiboot kernel loader overwriting the
BIOS and option ROM areas as part of the kernel loading process, and
causes any writable system regions to be corrupted (e.g. KVMVAPIC ROM).
By splitting the two discontiguous memory regions into separate images
and specifying only the boot image (i.e. 'locore') as the '-kernel',
it is possible to work around the QEMU direct kernel loading design
limitation.
This workaround is required to support the QEMU v4.2.0 and above.
For more details, refer to the issue zephyrproject-rtos/sdk-ng#168.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The current QEMU console configuration directly connects the console
serial port to the backend using '-serial' option.
This is less than ideal because only single console instance can be
connected to a backend and aggregation of multiple console outputs is
not possible (e.g. multiple console serial ports and semihosting
console to single console backend).
In order to solve this problem, single multiplexed chardev console
backend is declared and all consoles are connected to it.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Renode 1.8 introduced a behaviour change in which it automatically
launches the telnet monitor on the TCP port 1234 by default.
In order to prevent sanitycheck failures from multiple renode instances
attempting to listen on the TCP port 1234 simultaneously, this commit
disables renode telnet monitor by specifying '--port -2' (a negative
number lower than -1 is required to disable telnet monitor because of
the way renode command line parser is implemented).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.
() Removes the x86_64:x32 architecture and SoC, and replaces
them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Instead, use the QEMU_KERNEL_FILE facility to perform the
change in a new file zephyr-qemu.elf. This is what will
be sent to the emulator.
Fixes an issue where opening zephyr.elf in GDB would treat
it as a 32-bit binary instead of what it actually is,
forcing the user to override the arch setting.
Fixes: #19734
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This was a very early test and got bitrotten inside a esp32-only
whitelist. Make it run generically.
SMP must be forced off by the test (it's commonly a platform default).
Add a build-time failure when the configuration is single-CPU, for
clarity.
Filter the test likewise so it runs on all supported systems.
Also, the key argument to the CPU startup function is vestigial and
the test was being too strict by requiring it to be non-zero.
Finally, the qemu command line needs to predicate the "-smp" argument
on CONFIG_MP_NUM_CPUS and not just CONFIG_SMP so we have an extra CPU
to test against.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add qemu_x86_long board (with CONFIG_X86_LONGMODE=y) for testing.
This requires adding support to soc/ia32 for long mode (trivial),
and adding a quick 64- to 32-bit ELF conversion before invoking
QEMU, which apparently doesn't like 64-bit kernel files.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Now when SMP support for ARC is available we may introduce a simulation
platform which might be used for testing & development for SMP setups.
One important note is stand-alone nSIM (as well as its "Free" flavour)
doesn't support SMP simulation so we have to switch to use of nSIM via
proprietary MetaWare debugger [1] and so:
1. We introduce new emulation target "mdb"
2. It's only possible to run that platform for those who
have MetaWare tools installed and valid license.
Though QEMU port for ARC is in work at the moment and once we
open that port and it has SMP support we'll switch to it and everybody
will be able to try ARC HS with SMP.
[1] https://www.synopsys.com/dw/ipdir.php?ds=sw_metaware
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
The xlnx-zcu102 qemu machine is the only one that supports a Cortex-R
processor. However, its main CPUs are Cortex A53s which requires the
aarch64 qemu binary to run.
Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
ARC nSIM simulates pretty much any modern ARC core,
moreover it emulates a lot of different core features so
it is possible to play with them even wo real hardware.
Thus we add yet another ARC core family to be used on simulated
nSIM board.
For now it's just a basic configuration with ARC UART for
smoke-testing of Zephyr on ARC HS CPUs.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
No need to do this in arch code, all qemu variants speak the same
command line and the kconfig values we need are easily available.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
By default Renode is searched for in the system PATH.
The PID is stored in renode.pid - the application must be killed with a
signal after a test.
With the XWT gui layer disabled all UART output is directed to the
stdout.
Signed-off-by: Dawid Wojciechowski <dwojciechowski@internships.antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
This patch adds a x86_64 architecture and qemu_x86_64 board to Zephyr.
Only the basic architecture support needed to run 64 bit code is
added; no drivers are added, though a low-level console exists and is
wired to printk().
The support is built on top of a "X86 underkernel" layer, which can be
built in isolation as a unit test on a Linux host.
Limitations:
+ Right now the SDK lacks an x86_64 toolchain. The build will fall
back to a host toolchain if it finds no cross compiler defined,
which is tested to work on gcc 8.2.1 right now.
+ No x87/SSE/AVX usage is allowed. This is a stronger limitation than
other architectures where the instructions work from one thread even
if the context switch code doesn't support it. We are passing
-no-sse to prevent gcc from automatically generating SSE
instructions for non-floating-point purposes, which has the side
effect of changing the ABI. Future work to handle the FPU registers
will need to be combined with an "application" ABI distinct from the
kernel one (or just to require USERSPACE).
+ Paging is enabled (it has to be in long mode), but is a 1:1 mapping
of all memory. No MMU/USERSPACE support yet.
+ We are building with -mno-red-zone for stack size reasons, but this
is a valuable optimization. Enabling it requires automatic stack
switching, which requires a TSS, which means it has to happen after
MMU support.
+ The OS runs in 64 bit mode, but for compatibility reasons is
compiled to the 32 bit "X32" ABI. So while the full 64 bit
registers and instruction set are available, C pointers are 32 bits
long and Zephyr is constrained to run in the bottom 4G of memory.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Networking apps may require these rules (as echo apps) even on
non-Ethernet based configuration.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Introduce new Kconfig option for selecting either slip or ethernet
connectivity to host.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The 'run' target was missing it's dependency on the executable and
thereby behaving incorrectly.
This fixes#10639 .
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Support using an alternate QEMU path for when we want to use a qemu
version not available in the SDK.
To use the alternate qemu version, export QEMU_BIN_PATH and point it
to the bin directory which contains the qemu executables.
For example:
export QEMU_BIN_PATH=/usr/local/bin
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Create a net sample to setup a multi-node RPL mesh network using QMEU.
To enable this, it was necessary implement a hw filter on IEEE 802.15.4
UART Pipe driver and create a QEMU pipe management on cmake.
This sample use a tool developed on zephyr net-tools repository called
virtual-hub.
Signed-off-by: Pedro Martucci <pedropaulomartucci@gmail.com>
Instead of accessing the environment variable ZEPHYR_BASE every time we
require accessing the source code root, use an intermediate variable
that has OS path separators correctly set to '/' to avoid issues on
Windows.
Note: This removes the ZEPHYR_SOURCE_DIR CMake variable. External
applications using that will need to change to use the new ZEPHYR_BASE
variable.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
I don't know why we have been passing "-serial none" to qemu but it
does not seem to be doing anything useful. So I propose we remove it.
According to the qemu documenation it should be disabling all serial
ports;
"-serial dev
Redirect the virtual serial port to host character device dev. The
default device is vc in graphical mode and stdio in non graphical
mode.
This option can be used several times to simulate up to 4 serial
ports.
Use -serial none to disable all serial ports."
But when we use "-serial none", we always combine it with "-serial
pipe", or "-serial unix", to redirect the serial port, so clearly it
is not disabling all serial ports as it attempting to do.
"-serial none" was first introduced to Zephyr in this commit:
0b54f984b8
As far I can tell, pinging an echo_server works fine without it, so I
suspect that our second -serial flag is overriding it and that it has
no effect.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Using the '\$' technique to accept make variables corrupts Ninja build
systems, so avoid using it when generating Ninja files. Not using it
with Ninja means we need to come up with some other mechanism to
support build-time configuration of the QEMU CLI with Ninja.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
To indicate the generated binary is executable on the host, add .exe
extension to the generated ELF file.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
All runner logic was implemented in qemu.cmake, remove the generic stuff
and make qemu.cmake qemu specific.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds support of 'make run' to the native port allowing us to run
applications natively on the host instead of qemu.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Right now we are hardcoded to only qemu, with the native port, we make
this more generic and support this in a plugin mode where a running has
its own cmake definitons implementing the various targets.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>