Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107634844
D45932.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D45932.diff
View Options
diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h
--- a/stand/common/bootstrap.h
+++ b/stand/common/bootstrap.h
@@ -282,6 +282,7 @@
int tslog_publish(void);
vm_offset_t build_font_module(vm_offset_t);
+vm_offset_t build_splash_module(vm_offset_t);
/* MI module loaders */
#ifdef __elfN
diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c
--- a/stand/common/gfx_fb.c
+++ b/stand/common/gfx_fb.c
@@ -87,6 +87,7 @@
#include <teken.h>
#include <gfx_fb.h>
#include <sys/font.h>
+#include <sys/splash.h>
#include <sys/linker.h>
#include <sys/module.h>
#include <sys/stdint.h>
@@ -3007,3 +3008,50 @@
file_addmetadata(fp, MODINFOMD_FONT, sizeof(fontp), &fontp);
return (addr);
}
+
+vm_offset_t
+build_splash_module(vm_offset_t addr)
+{
+ struct preloaded_file *fp;
+ struct splash_info si;
+ const char *splash;
+ png_t png;
+ uint64_t splashp;
+ int error;
+
+ /* We can't load first */
+ if ((file_findfile(NULL, NULL)) == NULL) {
+ printf("Can not load splash module: %s\n",
+ "the kernel is not loaded");
+ return (addr);
+ }
+
+ fp = file_findfile(NULL, "elf kernel");
+ if (fp == NULL)
+ fp = file_findfile(NULL, "elf64 kernel");
+ if (fp == NULL)
+ panic("can't find kernel file");
+
+ splash = getenv("splash");
+ if (splash == NULL)
+ return (addr);
+
+ /* Parse png */
+ if ((error = png_open(&png, splash)) != PNG_NO_ERROR) {
+ return (addr);
+ }
+
+ si.si_width = png.width;
+ si.si_height = png.height;
+ si.si_depth = png.bpp;
+ splashp = addr;
+ addr += archsw.arch_copyin(&si, addr, sizeof (struct splash_info));
+ addr = roundup2(addr, 8);
+
+ /* Copy the bitmap. */
+ addr += archsw.arch_copyin(png.image, addr, png.png_datalen);
+
+ printf("Loading splash ok\n");
+ file_addmetadata(fp, MODINFOMD_SPLASH, sizeof(splashp), &splashp);
+ return (addr);
+}
diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -390,6 +390,11 @@
/* Pad to a page boundary. */
addr = roundup(addr, PAGE_SIZE);
+
+ addr = build_splash_module(addr);
+
+ /* Pad to a page boundary. */
+ addr = roundup(addr, PAGE_SIZE);
#endif
/* Copy our environment. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 17, 11:36 PM (17 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15844473
Default Alt Text
D45932.diff (2 KB)
Attached To
Mode
D45932: loader: Load a splash screen if "splash" variable is defined
Attached
Detach File
Event Timeline
Log In to Comment