1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:37:34 +00:00

Ports: Add a QEMU port

This commit is contained in:
Tim Schumacher 2022-04-22 04:52:55 +02:00 committed by Brian Gianforcaro
parent 5835373fc6
commit a813b941b8
5 changed files with 119 additions and 0 deletions

View file

@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Thu, 5 May 2022 18:49:17 +0200
Subject: [PATCH] Add build system support for SerenityOS
---
configure | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/configure b/configure
index 7c08c18..3177605 100755
--- a/configure
+++ b/configure
@@ -496,6 +496,8 @@ elif check_define __NetBSD__; then
targetos=netbsd
elif check_define __APPLE__; then
targetos=darwin
+elif check_define __serenity__; then
+ targetos=serenity
else
# This is a fatal error, but don't report it yet, because we
# might be going to just print the --help text, or it might
@@ -509,6 +511,7 @@ mingw32="no"
bsd="no"
linux="no"
solaris="no"
+serenity="no"
case $targetos in
windows)
mingw32="yes"
@@ -565,6 +568,9 @@ linux)
linux="yes"
vhost_user=${default_feature:-yes}
;;
+serenity)
+ serenity="yes"
+;;
esac
if test ! -z "$cpu" ; then

View file

@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Thu, 5 May 2022 18:50:31 +0200
Subject: [PATCH] Extend short scan sets into the full list
We don't support the (apparently nonstandard) short variant of scan
sets, so extend them into a full list manually.
---
chardev/char.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chardev/char.c b/chardev/char.c
index 0169d8d..03ce487 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -382,11 +382,11 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
if (strstart(filename, "vc", &p)) {
qemu_opt_set(opts, "backend", "vc", &error_abort);
if (*p == ':') {
- if (sscanf(p+1, "%7[0-9]x%7[0-9]", width, height) == 2) {
+ if (sscanf(p+1, "%7[0123456789]x%7[0123456789]", width, height) == 2) {
/* pixels */
qemu_opt_set(opts, "width", width, &error_abort);
qemu_opt_set(opts, "height", height, &error_abort);
- } else if (sscanf(p+1, "%7[0-9]Cx%7[0-9]C", width, height) == 2) {
+ } else if (sscanf(p+1, "%7[0123456789]Cx%7[0123456789]C", width, height) == 2) {
/* chars */
qemu_opt_set(opts, "cols", width, &error_abort);
qemu_opt_set(opts, "rows", height, &error_abort);

View file

@ -0,0 +1,14 @@
# Patches for qemu on SerenityOS
## `0001-Add-build-system-support-for-SerenityOS.patch`
Add build system support for SerenityOS
## `0002-Extend-short-scan-sets-into-the-full-list.patch`
Extend short scan sets into the full list
We don't support the (apparently nonstandard) short variant of scan
sets, so extend them into a full list manually.