diff --git a/boards/qemu-i386/Makefile b/boards/qemu-i386/Makefile deleted file mode 100644 index 003e3fc6e68b..000000000000 --- a/boards/qemu-i386/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -MODULE = board - -DIRS = $(RIOTBOARD)/x86-multiboot-common - -include $(RIOTBASE)/Makefile.base diff --git a/boards/qemu-i386/Makefile.features b/boards/qemu-i386/Makefile.features deleted file mode 100644 index a5dbbfeef7a6..000000000000 --- a/boards/qemu-i386/Makefile.features +++ /dev/null @@ -1,8 +0,0 @@ -# Put defined MCU peripherals here (in alphabetical order) - -# Various other features (if any) - -# The board MPU family (used for grouping by the CI system) -FEATURES_MCU_GROUP = x86 - --include $(RIOTCPU)/x86/Makefile.features diff --git a/boards/qemu-i386/Makefile.include b/boards/qemu-i386/Makefile.include deleted file mode 100644 index a3c5c1e9f632..000000000000 --- a/boards/qemu-i386/Makefile.include +++ /dev/null @@ -1,27 +0,0 @@ -USEMODULE += x86-multiboot-common - -CFLAGS += -march=i686 -mtune=i686 - -TERMPROG = exec $(RIOTBOARD)/qemu-i386/dist/term.py qemu-system-i386 $(BINDIRBASE) $(HEXFILE) - -FLASHER = true - -DEBUGGER = $(TERMPROG) - -all: - -debug-kdbg: DEBUGGER_FLAGS="kdbg -r :1234 -- $(ELFFILE)" -debug-kdbg: debug - -debug-ddd: DEBUGGER_FLAGS="ddd --eval-command='target remote :1234' $(ELFFILE)" -debug-ddd: debug - -debug-tui: DEBUGGER_FLAGS="x-terminal-emulator -e gdb -ex 'target remote :1234' -tui --args $(ELFFILE)" -debug-tui: debug - -debug-gdb: debug -DEBUGGER_FLAGS = "x-terminal-emulator -e gdb -ex 'target remote :1234' --args $(ELFFILE)" - -debug: - -include $(RIOTBOARD)/x86-multiboot-common/Makefile.include diff --git a/boards/qemu-i386/dist/term.py b/boards/qemu-i386/dist/term.py deleted file mode 100755 index f51569536412..000000000000 --- a/boards/qemu-i386/dist/term.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright (C) 2014 René Kijewski -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import atexit -import os -import re -import readline -import socket -import signal -import subprocess -import sys -import termios -import threading - -from datetime import datetime -from shlex import split -from time import time - -try: - from shlex import quote -except ImportError: - from pipes import quote - -def join_quoted(args): - return ' '.join(quote(arg) for arg in args) - - -_null = open(os.devnull, 'wb', 0) - -def get_timestamp(): - return datetime.fromtimestamp(time()).strftime('%Y-%m-%d %H:%M:%S.%f') - -def popen(args, **kw): - return subprocess.Popen(args, stdin=_null, stdout=_null, stderr=_null, **kw) - -def main(QEMU, BINDIRBASE, HEXFILE, DEBUGGER=None): - def run_shell(): - nonlocal result - while 1: - try: - line = input() - if line == 'quit': - result = 0 - raise EOFError() - except EOFError: - qemu.kill() - return - client_file.write((line + '\r\n').encode('UTF-8')) - - def read_terminal(): - for line in client_file: - sys.stderr.write(get_timestamp() + ': ') - sys.stderr.flush() - sys.stdout.write(line.decode('UTF-8', 'replace').rstrip('\r\n') + '\n') - sys.stdout.flush() - - if isinstance(QEMU, str): - QEMU = split(QEMU) - if DEBUGGER and isinstance(DEBUGGER, str): - DEBUGGER = split(DEBUGGER) - - qemu_version = subprocess.check_output(QEMU + ['-version'], stdin=_null, stderr=_null) - qemu_version = re.match(br'.*version ((?:\d+\.?)+).*', qemu_version).group(1).split(b'.') - qemu_version = list(int(v) for v in qemu_version) - - histfile = os.path.join(BINDIRBASE, '.qemu-term.hist') - try: - readline.read_history_file(histfile) - except IOError: - pass - - result = 1 - try: - sock = socket.socket() - sock.settimeout(60) - sock.bind(('', 0)) - sock.listen(1) - host, port = sock.getsockname() - - args = QEMU + [ - '-serial', 'tcp:{}:{}'.format(host, port), - '-nographic', - '-monitor', '/dev/null', - '-kernel', HEXFILE, - ] - if qemu_version >= [2, 1]: - args += ['-m', 'size=512'] - else: - args += ['-m', '512m'] - if DEBUGGER: - args += ['-s', '-S'] - - try: - sys.stderr.write('Starting QEMU: {}\n\n'.format(join_quoted(args))) - qemu = popen(args) - - if DEBUGGER: - ignore_sig_int = lambda: signal.signal(signal.SIGINT, signal.SIG_IGN) - popen(DEBUGGER, preexec_fn=ignore_sig_int) - - client_sock, _ = sock.accept() - client_file = client_sock.makefile('rwb', 1) - sock.close() - - threading.Thread(target=run_shell, daemon=True).start() - threading.Thread(target=read_terminal, daemon=True).start() - - try: - result = qemu.wait() and result - except KeyboardInterrupt: - sys.stderr.write('\nInterrupted ...\n') - result = 0 - finally: - try: - qemu.kill() - except: - pass - finally: - try: - readline.write_history_file(histfile) - except: - pass - - try: - client_sock.close() - except: - pass - return result - - -if __name__ == '__main__': - sys.stderr.write("Type 'exit' to exit.\n") - - atexit.register(termios.tcsetattr, 0, termios.TCSAFLUSH, termios.tcgetattr(0)) - - sys.exit(main(*sys.argv[1:])) diff --git a/boards/qemu-i386/include/board.h b/boards/qemu-i386/include/board.h deleted file mode 100644 index 97badcb8bd6b..000000000000 --- a/boards/qemu-i386/include/board.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2014 René Kijewski - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @defgroup boards_qemu-i386 qemu-i386 - * @ingroup boards - * @brief Dummy board to run x86 port in QEMU - * @{ - * - * @file - * @brief Board specific defines for qemu-i386. - * - * @author René Kijewski - */ - -#ifndef BOARD_H -#define BOARD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name Serial port configuration - * @{ - */ -#define UART_PORT (COM1_PORT) /* IO port to use for UART */ -#define UART_IRQ (COM1_IRQ) /* IRQ line to use for UART */ -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* BOARD_H */ - -/** - * @} - */ diff --git a/boards/qemu-i386/include/cpu_conf.h b/boards/qemu-i386/include/cpu_conf.h deleted file mode 100644 index e49ea0338878..000000000000 --- a/boards/qemu-i386/include/cpu_conf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2014 René Kijewski - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_qemu-i386 - * @{ - * - * @file - * @brief CPU-specific defines for qemu-i386 - * - * @author René Kijewski - */ - -#ifndef CPU_CONF_H -#define CPU_CONF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* FIXME: This file is just a filler. The numbers are entirely random ... */ - -#define THREAD_STACKSIZE_DEFAULT (8192) -#define THREAD_STACKSIZE_IDLE (8192) -#define THREAD_EXTRA_STACKSIZE_PRINTF (8192) -#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (8192) -#define THREAD_STACKSIZE_MINIMUM (8192) - -#ifdef __cplusplus -} -#endif - -#endif /* CPU_CONF_H */ - -/** @} */ diff --git a/boards/qemu-i386/include/periph_conf.h b/boards/qemu-i386/include/periph_conf.h deleted file mode 100644 index 598322a695e6..000000000000 --- a/boards/qemu-i386/include/periph_conf.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2016 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_qemu-i386 - * @{ - * - * @file - * @brief Peripheral configuration for the qemu-i386 - * - * @author Hauke Petersen - */ - -#ifndef PERIPH_CONF_H -#define PERIPH_CONF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* nothing to define here, yet */ - -#ifdef __cplusplus -} -#endif - -#endif /* PERIPH_CONF_H */ -/** @} */ diff --git a/boards/qemu-i386/x86_board_init.c b/boards/qemu-i386/x86_board_init.c deleted file mode 100644 index 64f73a586905..000000000000 --- a/boards/qemu-i386/x86_board_init.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2014 René Kijewski - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_qemu-i386 - * @{ - * - * @file - * @brief Initialization code for the qemu-i386 board - * - * @author René Kijewski - * - * @} - */ - -#include "cpu.h" -#include "x86_ports.h" -#include "x86_reboot.h" - -#define ENABLE_DEBUG (0) -#include "debug.h" - -static bool qemu_shutdown(void) -{ - unsigned old_state = irq_disable(); - - DEBUG("SHUTTING DOWN.\n"); - - /* (phony) ACPI shutdown (http://forum.osdev.org/viewtopic.php?t=16990) */ - /* Works for qemu and bochs. */ - outw(0xB004, 0x2000); - - irq_restore(old_state); - return false; -} - -void x86_init_board(void) -{ - x86_set_shutdown_fun(qemu_shutdown); -}