Date: Sun, 25 May 2014 07:40:30 GMT From: seiya@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r268576 - in soc2014/seiya/bootsplash/sys: boot/forth dev/fb sys Message-ID: <201405250740.s4P7eUk6053543@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: seiya Date: Sun May 25 07:40:30 2014 New Revision: 268576 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=268576 Log: load splash.conf At first, I planed to integrate with https://wiki.freebsd.org/OliverFromme/BootLoader, but I noticed that my bootsplash and the graphical bootloader can live apart. Therefore my bootsplash loads its own config file. Modified: soc2014/seiya/bootsplash/sys/boot/forth/loader.conf soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c soc2014/seiya/bootsplash/sys/sys/kernel.h Modified: soc2014/seiya/bootsplash/sys/boot/forth/loader.conf ============================================================================== --- soc2014/seiya/bootsplash/sys/boot/forth/loader.conf Sun May 25 06:42:43 2014 (r268575) +++ soc2014/seiya/bootsplash/sys/boot/forth/loader.conf Sun May 25 07:40:30 2014 (r268576) @@ -37,6 +37,10 @@ bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path +bsplash_load="NO" # Set this to YES to enable enhanced bootsplash! +bsplash_conf_load="NO" # Set this to YES to enable enhanced bootsplash too! +bsplash_conf_name="/boot/splash/default/splash.conf" # name of configuration file +bsplash_conf_type="bsplash_conf" ############################################################## ### Random number generator configuration ################### Modified: soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c ============================================================================== --- soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Sun May 25 06:42:43 2014 (r268575) +++ soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Sun May 25 07:40:30 2014 (r268576) @@ -31,6 +31,29 @@ #include <sys/module.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/linker.h> + +static int load_config(void) +{ + caddr_t conf; + char* ptr; + + conf = preload_search_by_type("bsplash_conf"); + if(conf == NULL) + return -1; + + ptr = preload_fetch_addr(conf); + + printf("bsplash conf: "); + /* parse config file */ + while(*ptr){ + printf("%c", *ptr); + ptr++; + } + printf("\n"); + + return 0; +} static int modevent(module_t mod, int type, void *data) { @@ -38,6 +61,7 @@ switch ((modeventtype_t)type) { case MOD_LOAD: + load_config(); break; case MOD_UNLOAD: break; Modified: soc2014/seiya/bootsplash/sys/sys/kernel.h ============================================================================== --- soc2014/seiya/bootsplash/sys/sys/kernel.h Sun May 25 06:42:43 2014 (r268575) +++ soc2014/seiya/bootsplash/sys/sys/kernel.h Sun May 25 07:40:30 2014 (r268576) @@ -89,6 +89,7 @@ SI_SUB_DUMMY = 0x0000000, /* not executed; for linker*/ SI_SUB_DONE = 0x0000001, /* processed*/ SI_SUB_TUNABLES = 0x0700000, /* establish tunable values */ + SI_SUB_BOOTSPLASH = 0x0780000, /* bootsplash */ SI_SUB_COPYRIGHT = 0x0800001, /* first use of console*/ SI_SUB_SETTINGS = 0x0880000, /* check and recheck settings */ SI_SUB_MTX_POOL_STATIC = 0x0900000, /* static mutex pool */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405250740.s4P7eUk6053543>
