Module Name:    src
Committed By:   jmcneill
Date:           Sun Feb  6 23:16:05 UTC 2011

Modified Files:
        src/sys/arch/i386/stand/boot: boot2.c version
        src/sys/arch/i386/stand/lib: bootmod.h exec.c libi386.h

Log Message:
add support for passing image files to the kernel with the 'splash' keyword:

 vesa on;splash /netbsd.jpg;boot -z


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/boot/version
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/lib/bootmod.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/stand/lib/exec.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/lib/libi386.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/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.51 src/sys/arch/i386/stand/boot/boot2.c:1.52
--- src/sys/arch/i386/stand/boot/boot2.c:1.51	Wed Jan  5 23:13:01 2011
+++ src/sys/arch/i386/stand/boot/boot2.c	Sun Feb  6 23:16:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.51 2011/01/05 23:13:01 jakllsch Exp $	*/
+/*	$NetBSD: boot2.c,v 1.52 2011/02/06 23:16:05 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -135,6 +135,7 @@
 	{ "load",	module_add },
 	{ "multiboot",	command_multiboot },
 	{ "vesa",	command_vesa },
+	{ "splash",	splash_add },
 	{ NULL,		NULL },
 };
 

Index: src/sys/arch/i386/stand/boot/version
diff -u src/sys/arch/i386/stand/boot/version:1.13 src/sys/arch/i386/stand/boot/version:1.14
--- src/sys/arch/i386/stand/boot/version:1.13	Wed Jan  5 23:13:01 2011
+++ src/sys/arch/i386/stand/boot/version	Sun Feb  6 23:16:05 2011
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.13 2011/01/05 23:13:01 jakllsch Exp $
+$NetBSD: version,v 1.14 2011/02/06 23:16:05 jmcneill Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -45,3 +45,4 @@
 5.5:	Adjust stack and heap areas to not overlap.
 5.6:	GUID Partition Table support.
 5.7:	Recognize 64-bit LBA from bootxx.
+5.8:	Support for splash images.

Index: src/sys/arch/i386/stand/lib/bootmod.h
diff -u src/sys/arch/i386/stand/lib/bootmod.h:1.3 src/sys/arch/i386/stand/lib/bootmod.h:1.4
--- src/sys/arch/i386/stand/lib/bootmod.h:1.3	Mon May  5 00:12:49 2008
+++ src/sys/arch/i386/stand/lib/bootmod.h	Sun Feb  6 23:16:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootmod.h,v 1.3 2008/05/05 00:12:49 jmcneill Exp $	*/
+/*	$NetBSD: bootmod.h,v 1.4 2011/02/06 23:16:05 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 Jared D. McNeill <jmcne...@invisible.ca>
@@ -32,6 +32,9 @@
 typedef struct boot_module {
 	char			*bm_path;
 	ssize_t			bm_len;
+	uint8_t			bm_type;
+#define	BM_TYPE_KMOD		0x00
+#define	BM_TYPE_IMAGE		0x01
 	struct boot_module	*bm_next;
 } boot_module_t;
 

Index: src/sys/arch/i386/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.45 src/sys/arch/i386/stand/lib/exec.c:1.46
--- src/sys/arch/i386/stand/lib/exec.c:1.45	Sat Oct 30 08:12:43 2010
+++ src/sys/arch/i386/stand/lib/exec.c	Sun Feb  6 23:16:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.45 2010/10/30 08:12:43 jnemeth Exp $	 */
+/*	$NetBSD: exec.c,v 1.46 2011/02/06 23:16:05 jmcneill Exp $	 */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -135,6 +135,7 @@
 static int howto;
 
 static void	module_init(const char *);
+static void	module_add_common(char *, uint8_t);
 
 void
 framebuffer_configure(struct btinfo_framebuffer *fb)
@@ -150,6 +151,18 @@
 void
 module_add(char *name)
 {
+	return module_add_common(name, BM_TYPE_KMOD);
+}
+
+void
+splash_add(char *name)
+{
+	return module_add_common(name, BM_TYPE_IMAGE);
+}
+
+static void
+module_add_common(char *name, uint8_t type)
+{
 	boot_module_t *bm, *bmp;
 	size_t len;
 	char *str;
@@ -167,6 +180,7 @@
 	memcpy(str, name, len);
 	bm->bm_path = str;
 	bm->bm_next = NULL;
+	bm->bm_type = type;
 	if (boot_modules == NULL)
 		boot_modules = bm;
 	else {
@@ -509,7 +523,8 @@
 			strncpy(bi->path, bm->bm_path, sizeof(bi->path) - 1);
 			bi->base = image_end;
 			bi->len = len;
-			bi->type = BI_MODULE_ELF;
+			bi->type = bm->bm_type == BM_TYPE_KMOD ?
+			    BI_MODULE_ELF : BI_MODULE_IMAGE;
 			if ((howto & AB_SILENT) == 0)
 				printf(" \n");
 		}

Index: src/sys/arch/i386/stand/lib/libi386.h
diff -u src/sys/arch/i386/stand/lib/libi386.h:1.33 src/sys/arch/i386/stand/lib/libi386.h:1.34
--- src/sys/arch/i386/stand/lib/libi386.h:1.33	Fri Jun 25 15:35:08 2010
+++ src/sys/arch/i386/stand/lib/libi386.h	Sun Feb  6 23:16:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: libi386.h,v 1.33 2010/06/25 15:35:08 tsutsui Exp $	*/
+/*	$NetBSD: libi386.h,v 1.34 2011/02/06 23:16:05 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -137,6 +137,7 @@
 extern int doserrno;	/* in dos_file.S */
 
 void module_add(char *);
+void splash_add(char *);
 
 struct btinfo_framebuffer;
 void framebuffer_configure(struct btinfo_framebuffer *);

Reply via email to