From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45562C433F5 for ; Sat, 27 Nov 2021 20:24:23 +0000 (UTC) Received: from localhost ([::1]:43122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr4FC-0001lJ-C0 for qemu-devel@archiver.kernel.org; Sat, 27 Nov 2021 15:24:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr4Ag-0003oM-9n for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: from [2607:f8b0:4864:20::136] (port=33729 helo=mail-il1-x136.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr4Ad-0004u0-N9 for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: by mail-il1-x136.google.com with SMTP id i6so12731574ila.0 for ; Sat, 27 Nov 2021 12:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9lAojg4ZHM7UKvsEnUnT2wI+wj26o0gCpxnY2EoluH8=; b=ZubATuUcRLk6y8WRRuw/Cnp5wNeL6Lt/8JIzT+QaEH0gZQN+rWOr8dbu6+/4ztqEUT +CCoUrPjzbiDh+sp7Qrg8skJbY2glOWEUKYUWurCeOTDyPW9f+GtZyWXJwL0NTctW1fb PHau+X2Jfe+5t68/42YM49rTsHLI+LntdYeRHQcG5kNZgPhwl2QRbEzHFP/IU6tmkpnC Bq/7iqoTMYmCc4i4qrhr9/S26XjmH7hO1wybl7XEyIPGnwdQIKGA9fV/qer0HNfYs5IY 5lEqEpdMkMtK2RxZZFhKKJl2i+w7KGuGV9xqSfYZhgGDQTvEeykZJblxAI+vU5fjX29a hRNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9lAojg4ZHM7UKvsEnUnT2wI+wj26o0gCpxnY2EoluH8=; b=Hp6hHdYINPVHQ1ZybW7PQl3DZ+U1AHe77VJ4I8R826CoLs0I/plgVr10EbCr4HUErl XS3dU/TDsug19wWaIzmK63aRP8ymFtUdTlAJmmoUh1tcv3sgor/WtZskcLwtF/xSnKI8 SnhAz4AvyM1wAmTjVzpIL2V/8UOp8SCFusI0Wq3n5edxd0w+9Gmbm8wGU1J9DuPfNQzn 3X46ZP6O2eP34LQP9sM1ZqmTzvHhKKznEIbaiQYnEvKzNWSZuU3s/KbW7zq3jGbtDLCc hnyXYr+pTdcu2tcXO3AWREuue8uAR1TxHEea1onUVDnshxgJ9HLUooLPUzf2FUtec5PL 2Mtg== X-Gm-Message-State: AOAM531adzw1sgjbUmtbnPXiDUXpNAVda8gF16xTStObS/Z6YE+u9cMM C1gzUdhn3TjZ13Aa8g9O3uUOgvG2mnoQfw8F X-Google-Smtp-Source: ABdhPJwIDQvszE+KBT6DyNw54VC/zHIHmVnTdPuM1s22yF0Xvx0GVvMfhidoVlI4rvDjotcQ4KEdlA== X-Received: by 2002:a92:d7ce:: with SMTP id g14mr37206536ilq.176.1638044378438; Sat, 27 Nov 2021 12:19:38 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h12sm3091632ila.81.2021.11.27.12.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 12:19:38 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH for 7.0 2/5] h.i386: Simple hello-world test for i386 Date: Sat, 27 Nov 2021 13:18:43 -0700 Message-Id: <20211127201846.64187-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com> References: <20211127201846.64187-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::136 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arrowd@freebsd.org, kevans@freebsd.org, richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org, Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" A simple, tiny, statically linked i386 'hello world' test. It uses two system calls (write and exit) and provides a basic sanity check to make sure that the arm bsd-user binary can interpret FreeBSD 32-bit i386 binaries. Signed-off-by: Warner Losh --- tests/bsd-user-smoke/h.i386.S | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/bsd-user-smoke/h.i386.S diff --git a/tests/bsd-user-smoke/h.i386.S b/tests/bsd-user-smoke/h.i386.S new file mode 100644 index 00000000000..0af5a709f15 --- /dev/null +++ b/tests/bsd-user-smoke/h.i386.S @@ -0,0 +1,39 @@ +# Copyright (c) 2021 Warner Losh +# SPDX-License-Identifier: BSD-2-Clause + +#include +#define STDOUT_FILENO 1 + + .text + .file "hello.s" + .globl qemu_start # -- Begin function qemu_start + .p2align 4, 0x90 + .type qemu_start,@function +qemu_start: # @qemu_start +# %bb.0: # %entry + pushl %ebp + movl %esp, %ebp + + # write(1, .L.str, sizeof(.L.str) - 1) + pushl $(.L.strEnd - .L.str - 1) + pushl $.L.str + pushl $STDOUT_FILENO + pushl %eax # dummy return address + movl $SYS_write, %eax + int $0x80 + addl $16, %esp # 3 args + 1 dummy + + # _exit(0) + pushl $0 + pushl %eax # dummy return address + movl $SYS_exit, %eax + int $0x80 +.Lfunc_end0: + .size qemu_start, .Lfunc_end0-qemu_start + # -- End function + .type .L.str,@object # @.str + .section .rodata.str1.1,"aMS",@progbits,1 +.L.str: + .asciz "Hello World\n" +.L.strEnd: + .size .L.str, .L.strEnd - .L.str -- 2.33.0