From patchwork Thu Jun 1 15:25:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 769798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wdrlN4xzlz9s89 for ; Fri, 2 Jun 2017 01:25:52 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wdrlN2YSQzDqFr for ; Fri, 2 Jun 2017 01:25:52 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wdrlH0VkpzDq5x for ; Fri, 2 Jun 2017 01:25:46 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F1AD80C0E; Thu, 1 Jun 2017 15:25:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F1AD80C0E Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0F1AD80C0E Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A65F17CF3; Thu, 1 Jun 2017 15:25:44 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 1 Jun 2017 17:25:39 +0200 Message-Id: <1496330742-18181-2-git-send-email-thuth@redhat.com> In-Reply-To: <1496330742-18181-1-git-send-email-thuth@redhat.com> References: <1496330742-18181-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 01 Jun 2017 15:25:45 +0000 (UTC) Subject: [SLOF] [PATCH 1/4] bootmenu: Add framework for a new libbootmenu module X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" Adjust the Makefiles and add bootmenu skeleton files. Signed-off-by: Thomas Huth --- board-qemu/Makefile | 2 +- board-qemu/slof/Makefile | 9 +++++--- lib/Makefile | 2 +- lib/libbootmenu/Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++ lib/libbootmenu/bootmenu.c | 21 +++++++++++++++++++ lib/libbootmenu/bootmenu.code | 20 ++++++++++++++++++ lib/libbootmenu/bootmenu.h | 15 +++++++++++++ lib/libbootmenu/bootmenu.in | 15 +++++++++++++ 8 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 lib/libbootmenu/Makefile create mode 100644 lib/libbootmenu/bootmenu.c create mode 100644 lib/libbootmenu/bootmenu.code create mode 100644 lib/libbootmenu/bootmenu.h create mode 100644 lib/libbootmenu/bootmenu.in diff --git a/board-qemu/Makefile b/board-qemu/Makefile index 7208fcc..61a1367 100644 --- a/board-qemu/Makefile +++ b/board-qemu/Makefile @@ -15,7 +15,7 @@ BOARD_TARGETS = tools_build romfs_build stage1 subdirs SUBDIRS = slof COMMON_LIBS = libc libbootmsg libbases libnvram libelf libhvcall libvirtio \ - libusb libveth libe1k libnet + libusb libveth libe1k libnet libbootmenu all: $(BOARD_TARGETS) $(MAKE) boot_rom.bin diff --git a/board-qemu/slof/Makefile b/board-qemu/slof/Makefile index 02d819b..2263e75 100644 --- a/board-qemu/slof/Makefile +++ b/board-qemu/slof/Makefile @@ -21,7 +21,8 @@ all: version.o Makefile.dep OF.ffs paflof $(SLOFCMNDIR)/xvect.bin CPPFLAGS = -I$(LIBCMNDIR)/libbootmsg -I$(LIBCMNDIR)/libhvcall \ -I$(LIBCMNDIR)/libvirtio -I$(LIBCMNDIR)/libnvram \ -I$(LIBCMNDIR)/libusb -I$(LIBCMNDIR)/libveth \ - -I$(LIBCMNDIR)/libe1k -I$(LIBCMNDIR)/libnet + -I$(LIBCMNDIR)/libe1k -I$(LIBCMNDIR)/libnet \ + -I$(LIBCMNDIR)/libbootmenu SLOF_LIBS = \ $(LIBCMNDIR)/libbootmsg.a \ $(LIBCMNDIR)/libelf.a \ @@ -31,7 +32,8 @@ SLOF_LIBS = \ $(LIBCMNDIR)/libnvram.a \ $(LIBCMNDIR)/libveth.a \ $(LIBCMNDIR)/libe1k.a \ - $(LIBCMNDIR)/libnet.a + $(LIBCMNDIR)/libnet.a \ + $(LIBCMNDIR)/libbootmenu.a BOARD_SLOF_IN = \ $(LIBCMNDIR)/libhvcall/hvcall.in \ $(LIBCMNDIR)/libvirtio/virtio.in \ @@ -42,7 +44,8 @@ BOARD_SLOF_IN = \ $(LIBCMNDIR)/libbases/libbases.in \ $(LIBCMNDIR)/libveth/veth.in \ $(LIBCMNDIR)/libe1k/e1k.in \ - $(LIBCMNDIR)/libnet/libnet.in + $(LIBCMNDIR)/libnet/libnet.in \ + $(LIBCMNDIR)/libbootmenu/bootmenu.in BOARD_SLOF_CODE = $(BOARD_SLOF_IN:%.in=%.code) include $(SLOFCMNDIR)/Makefile.inc diff --git a/lib/Makefile b/lib/Makefile index 6d9db66..a4d4bb2 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -11,7 +11,7 @@ # ****************************************************************************/ SUBDIRS = libc libipmi libbootmsg libbases libnvram libelf libhvcall libvirtio \ - libusb libveth libe1k libbcm libnet + libusb libveth libe1k libbcm libnet libbootmenu all: subdirs diff --git a/lib/libbootmenu/Makefile b/lib/libbootmenu/Makefile new file mode 100644 index 0000000..1ea42b7 --- /dev/null +++ b/lib/libbootmenu/Makefile @@ -0,0 +1,49 @@ +# ***************************************************************************** +# * Copyright (c) 2004, 2008 IBM Corporation +# * All rights reserved. +# * This program and the accompanying materials +# * are made available under the terms of the BSD License +# * which accompanies this distribution, and is available at +# * http://www.opensource.org/licenses/bsd-license.php +# * +# * Contributors: +# * IBM Corporation - initial implementation +# ****************************************************************************/ + +ifndef TOP + TOP = $(shell while ! test -e make.rules; do cd .. ; done; pwd) + export TOP +endif +include $(TOP)/make.rules + +CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/slof -I$(TOP)/include + +SRCS = bootmenu.c + +OBJS = $(SRCS:%.c=%.o) + +TARGET = ../libbootmenu.a + +all: $(TARGET) + +$(TARGET): $(OBJS) + $(AR) -rc $@ $(OBJS) + $(RANLIB) $@ + +clean: + $(RM) $(TARGET) $(OBJS) + +distclean: clean + $(RM) Makefile.dep + + +# Rules for creating the dependency file: +depend: + $(RM) Makefile.dep + $(MAKE) Makefile.dep + +Makefile.dep: Makefile + $(CC) -M $(CPPFLAGS) $(CFLAGS) $(SRCS) > Makefile.dep + +# Include dependency file if available: +-include Makefile.dep diff --git a/lib/libbootmenu/bootmenu.c b/lib/libbootmenu/bootmenu.c new file mode 100644 index 0000000..d8d00cb --- /dev/null +++ b/lib/libbootmenu/bootmenu.c @@ -0,0 +1,21 @@ +/***************************************************************************** + * Boot menu: Displays boot devices and waits for user to select one + * + * Copyright 2017 Red Hat, Inc. + * + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * Thomas Huth, Red Hat Inc. - initial implementation + *****************************************************************************/ + +#include +#include +#include "bootmenu.h" + +void bootmenu(void) +{ +} diff --git a/lib/libbootmenu/bootmenu.code b/lib/libbootmenu/bootmenu.code new file mode 100644 index 0000000..f51784d --- /dev/null +++ b/lib/libbootmenu/bootmenu.code @@ -0,0 +1,20 @@ +/***************************************************************************** + * Boot menu: Glue code to Forth + * + * Copyright 2017 Red Hat, Inc. + * + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * Thomas Huth, Red Hat Inc. - initial implementation + *****************************************************************************/ + +#include "bootmenu.h" + +// ( -- ) +PRIM(boot_X2d_menu) + bootmenu(); +MIRP diff --git a/lib/libbootmenu/bootmenu.h b/lib/libbootmenu/bootmenu.h new file mode 100644 index 0000000..6cef237 --- /dev/null +++ b/lib/libbootmenu/bootmenu.h @@ -0,0 +1,15 @@ +/***************************************************************************** + * Boot menu definitions + * + * Copyright 2017 Red Hat, Inc. + * + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * Thomas Huth, Red Hat Inc. - initial implementation + *****************************************************************************/ + +extern void bootmenu(void); diff --git a/lib/libbootmenu/bootmenu.in b/lib/libbootmenu/bootmenu.in new file mode 100644 index 0000000..5cb120e --- /dev/null +++ b/lib/libbootmenu/bootmenu.in @@ -0,0 +1,15 @@ +/***************************************************************************** + * Boot menu: Definitions for Forth + * + * Copyright 2017 Red Hat, Inc. + * + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * Thomas Huth, Red Hat Inc. - initial implementation + *****************************************************************************/ + +cod(boot-menu)