Module Name:    src
Committed By:   nonaka
Date:           Sat Apr 29 00:05:36 UTC 2017

Modified Files:
        src/sys/arch/i386/stand/efiboot: Makefile.efiboot
        src/sys/arch/i386/stand/efiboot/bootia32: efibootia32.c start.S
        src/sys/arch/i386/stand/efiboot/bootx64: efibootx64.c start.S
        src/sys/sys: bootblock.h

Log Message:
efiboot: Boot parameters can be set via installboot(8).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.2 -r1.3 \
    src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/bootia32/start.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/bootx64/start.S
cvs rdiff -u -r1.57 -r1.58 src/sys/sys/bootblock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot
diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.8 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.9
--- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.8	Sat Apr  8 19:53:21 2017
+++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot	Sat Apr 29 00:05:35 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.8 2017/04/08 19:53:21 christos Exp $
+# $NetBSD: Makefile.efiboot,v 1.9 2017/04/29 00:05:35 nonaka Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -10,7 +10,7 @@ AFLAGS.start.S= ${${ACTIVE_CC} == "clang
 
 SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c
 LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c
-LIBI386SRCS+= bootmenu.c boot_params.S diskbuf.c exec.c menuutils.c
+LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c
 LIBI386SRCS+= panic.c parseutils.c pread.c
 LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c
 LIBI386SRCS+= efimemory.c

Index: src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c
diff -u src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.2 src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.3
--- src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.2	Tue Feb 21 10:53:37 2017
+++ src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c	Sat Apr 29 00:05:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootia32.c,v 1.2 2017/02/21 10:53:37 nonaka Exp $	*/
+/*	$NetBSD: efibootia32.c,v 1.3 2017/04/29 00:05:35 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <non...@netbsd.org>
@@ -30,8 +30,6 @@
 
 #include <sys/bootblock.h>
 
-struct x86_boot_params boot_params;
-
 void startprog32_start(physaddr_t, uint32_t, uint32_t *, physaddr_t,
     physaddr_t, physaddr_t, u_long, void *);
 extern void (*startprog32)(physaddr_t, uint32_t, uint32_t *, physaddr_t,

Index: src/sys/arch/i386/stand/efiboot/bootia32/start.S
diff -u src/sys/arch/i386/stand/efiboot/bootia32/start.S:1.1 src/sys/arch/i386/stand/efiboot/bootia32/start.S:1.2
--- src/sys/arch/i386/stand/efiboot/bootia32/start.S:1.1	Tue Jan 24 11:09:14 2017
+++ src/sys/arch/i386/stand/efiboot/bootia32/start.S	Sat Apr 29 00:05:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: start.S,v 1.1 2017/01/24 11:09:14 nonaka Exp $	*/
+/*	$NetBSD: start.S,v 1.2 2017/04/29 00:05:35 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2008-2010 Rui Paulo <rpa...@freebsd.org>
@@ -29,6 +29,7 @@
  */
 
 #include <machine/asm.h>
+#include <sys/bootblock.h>
 
 	.text
 	.align	16
@@ -72,3 +73,18 @@ END(_start)
 	.long   0
 	.long   10
 	.word   0
+
+	/* boot parameters */
+	.text
+	.code16
+	.align 512
+.Lfake_bootxx:
+	jmp	1f
+	.balign 4
+	.long	X86_BOOT_MAGIC_EFI	/* checked by installboot */
+	.globl _C_LABEL(boot_params)
+_C_LABEL(boot_params):			/* space for patchable variables */
+	.long	1f - boot_params	/* length of this data area */
+#include <boot_params.S>
+	. = .Lfake_bootxx + 0x80	/* Space for patching unknown params */
+1:

Index: src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c
diff -u src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.2 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.3
--- src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.2	Sat Feb 11 10:23:39 2017
+++ src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c	Sat Apr 29 00:05:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootx64.c,v 1.2 2017/02/11 10:23:39 nonaka Exp $	*/
+/*	$NetBSD: efibootx64.c,v 1.3 2017/04/29 00:05:35 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <non...@netbsd.org>
@@ -30,8 +30,6 @@
 
 #include <sys/bootblock.h>
 
-struct x86_boot_params boot_params;
-
 void startprog64_start(physaddr_t, physaddr_t, physaddr_t, u_long,
     void *, physaddr_t);
 extern void (*startprog64)(physaddr_t, physaddr_t, physaddr_t, u_long,

Index: src/sys/arch/i386/stand/efiboot/bootx64/start.S
diff -u src/sys/arch/i386/stand/efiboot/bootx64/start.S:1.1 src/sys/arch/i386/stand/efiboot/bootx64/start.S:1.2
--- src/sys/arch/i386/stand/efiboot/bootx64/start.S:1.1	Tue Jan 24 11:09:14 2017
+++ src/sys/arch/i386/stand/efiboot/bootx64/start.S	Sat Apr 29 00:05:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: start.S,v 1.1 2017/01/24 11:09:14 nonaka Exp $	*/
+/*	$NetBSD: start.S,v 1.2 2017/04/29 00:05:35 nonaka Exp $	*/
 
 /*-
  * Copyright (C) 1999 Hewlett-Packard Co.
@@ -39,6 +39,7 @@
  */
 
 #include <machine/asm.h>
+#include <sys/bootblock.h>
 
 	.text
 	.align 16
@@ -77,3 +78,18 @@ _start:
 	.long   0
 	.long   10
 	.word   0
+
+	/* boot parameters */
+	.text
+	.code16
+	.align 512
+.Lfake_bootxx:
+	jmp	1f
+	.balign 4
+	.long	X86_BOOT_MAGIC_EFI	/* checked by installboot */
+	.globl _C_LABEL(boot_params)
+_C_LABEL(boot_params):			/* space for patchable variables */
+	.long	1f - boot_params	/* length of this data area */
+#include <boot_params.S>
+	. = .Lfake_bootxx + 0x80	/* Space for patching unknown params */
+1:

Index: src/sys/sys/bootblock.h
diff -u src/sys/sys/bootblock.h:1.57 src/sys/sys/bootblock.h:1.58
--- src/sys/sys/bootblock.h:1.57	Sun Sep 14 17:39:06 2014
+++ src/sys/sys/bootblock.h	Sat Apr 29 00:05:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootblock.h,v 1.57 2014/09/14 17:39:06 nonaka Exp $	*/
+/*	$NetBSD: bootblock.h,v 1.58 2017/04/29 00:05:35 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -1089,6 +1089,7 @@ struct x86_boot_params {
 #define	X86_BOOT_MAGIC_2	X86_BOOT_MAGIC(2)	/* bootxx.S */
 #define	X86_BOOT_MAGIC_PXE	X86_BOOT_MAGIC(3)	/* start_pxe.S */
 #define	X86_BOOT_MAGIC_FAT	X86_BOOT_MAGIC(4)	/* fatboot.S */
+#define	X86_BOOT_MAGIC_EFI	X86_BOOT_MAGIC(5)	/* efiboot/start.S */
 #define	X86_MBR_GPT_MAGIC	0xedb88320		/* gpt.S */
 
 		/* values for bp_flags */

Reply via email to