Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand add support for passing image files to t...



details:   https://anonhg.NetBSD.org/src/rev/11cd19fb17e0
branches:  trunk
changeset: 761756:11cd19fb17e0
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Feb 06 23:16:05 2011 +0000

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

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

diffstat:

 sys/arch/i386/stand/boot/boot2.c  |   3 ++-
 sys/arch/i386/stand/boot/version  |   3 ++-
 sys/arch/i386/stand/lib/bootmod.h |   5 ++++-
 sys/arch/i386/stand/lib/exec.c    |  19 +++++++++++++++++--
 sys/arch/i386/stand/lib/libi386.h |   3 ++-
 5 files changed, 27 insertions(+), 6 deletions(-)

diffs (121 lines):

diff -r 26d2a3cf571c -r 11cd19fb17e0 sys/arch/i386/stand/boot/boot2.c
--- a/sys/arch/i386/stand/boot/boot2.c  Sun Feb 06 23:14:04 2011 +0000
+++ b/sys/arch/i386/stand/boot/boot2.c  Sun Feb 06 23:16:05 2011 +0000
@@ -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 },
 };
 
diff -r 26d2a3cf571c -r 11cd19fb17e0 sys/arch/i386/stand/boot/version
--- a/sys/arch/i386/stand/boot/version  Sun Feb 06 23:14:04 2011 +0000
+++ b/sys/arch/i386/stand/boot/version  Sun Feb 06 23:16:05 2011 +0000
@@ -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.
diff -r 26d2a3cf571c -r 11cd19fb17e0 sys/arch/i386/stand/lib/bootmod.h
--- a/sys/arch/i386/stand/lib/bootmod.h Sun Feb 06 23:14:04 2011 +0000
+++ b/sys/arch/i386/stand/lib/bootmod.h Sun Feb 06 23:16:05 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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;
 
diff -r 26d2a3cf571c -r 11cd19fb17e0 sys/arch/i386/stand/lib/exec.c
--- a/sys/arch/i386/stand/lib/exec.c    Sun Feb 06 23:14:04 2011 +0000
+++ b/sys/arch/i386/stand/lib/exec.c    Sun Feb 06 23:16:05 2011 +0000
@@ -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");
                }
diff -r 26d2a3cf571c -r 11cd19fb17e0 sys/arch/i386/stand/lib/libi386.h
--- a/sys/arch/i386/stand/lib/libi386.h Sun Feb 06 23:14:04 2011 +0000
+++ b/sys/arch/i386/stand/lib/libi386.h Sun Feb 06 23:16:05 2011 +0000
@@ -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 *);



Home | Main Index | Thread Index | Old Index