bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 2/3] multiboot: Support graphic mode preferences


From: Damien Zammit
Subject: [PATCH 2/3] multiboot: Support graphic mode preferences
Date: Thu, 24 Oct 2024 00:11:04 +0000

This change forces multiboot loader to provide video mode info
and also sets the preferred video mode to EGA text to ensure
existing console behaviour still works. 

When support for graphical consoles is provided, we can change
the preferred mode to linear framebuffer.

---
 i386/i386at/boothdr.S              | 24 ++++++++++++++++++------
 i386/include/mach/i386/multiboot.h |  8 ++++++--
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/i386/i386at/boothdr.S b/i386/i386at/boothdr.S
index daaf57db..ff055746 100644
--- a/i386/i386at/boothdr.S
+++ b/i386/i386at/boothdr.S
@@ -1,9 +1,17 @@
 
 #include <mach/machine/asm.h>
+#include <mach/machine/multiboot.h>
 #include <i386/apic.h>
 #include <i386/seg.h>
 #include <i386/i386asm.h>
 
+#ifdef __ELF__
+#define AOUT_KLUDGE    0
+#else
+#define AOUT_KLUDGE    MULTIBOOT_AOUT_KLUDGE
+#endif /* __ELF__ */
+#define MULTIBOOT_FLAGS        MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | 
MULTIBOOT_VIDEO_MODE | AOUT_KLUDGE
+
        /*
         * This section will be put first into .text.  See also i386/ldscript.
         */
@@ -16,12 +24,6 @@ _start:
        jmp     boot_entry
 
        /* MultiBoot header - see multiboot.h.  */
-#define        MULTIBOOT_MAGIC         0x1BADB002
-#ifdef __ELF__
-#define MULTIBOOT_FLAGS                0x00000003
-#else  /* __ELF__ */
-#define MULTIBOOT_FLAGS                0x00010003
-#endif /* __ELF__ */
        P2ALIGN(2)
 boot_hdr:
        .long   MULTIBOOT_MAGIC
@@ -37,7 +39,17 @@ boot_hdr:
        .long   _edata          /* load_end_addr */
        .long   _end            /* bss_end_addr */
        .long   boot_entry      /* entry */
+#else
+        .long  0
+        .long  0
+        .long  0
+        .long  0
+        .long  0
 #endif /* __ELF__ */
+        .long  MULTIBOOT_VIDEO_MODE_TYPE_EGA_TEXT
+        .long  80
+        .long  25
+        .long  MULTIBOOT_VIDEO_PARAM_NO_PREFERENCE
 
 boot_entry:
        movl    $percpu_array - KERNELBASE, %eax
diff --git a/i386/include/mach/i386/multiboot.h 
b/i386/include/mach/i386/multiboot.h
index 87bcd595..8df5261f 100644
--- a/i386/include/mach/i386/multiboot.h
+++ b/i386/include/mach/i386/multiboot.h
@@ -23,8 +23,6 @@
 #ifndef _MACH_I386_MULTIBOOT_H_
 #define _MACH_I386_MULTIBOOT_H_
 
-#include <mach/machine/vm_types.h>
-
 /* The entire multiboot_header must be contained
    within the first MULTIBOOT_SEARCH bytes of the kernel image.  */
 #define MULTIBOOT_SEARCH       8192
@@ -74,6 +72,10 @@
 
 #define MULTIBOOT_VIDEO_PARAM_NO_PREFERENCE    0
 
+#ifndef __ASSEMBLER__
+
+#include <mach/machine/vm_types.h>
+
 /* The mods_addr field above contains the physical address of the first
    of 'mods_count' multiboot_module structures.  */
 struct multiboot_module
@@ -277,4 +279,6 @@ struct multiboot_os_info {
     uint32_t mods_count;
 };
 
+#endif /* __ASSEMBLER__ */
+
 #endif /* _MACH_I386_MULTIBOOT_H_ */
-- 
2.45.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]