Skip to content

Commit

Permalink
setup: enable framebuffer initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Feb 21, 2022
1 parent 88e3aea commit bdf6272
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/x86/boot/boot.S
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SECTION(.multiboot, "a", 4)
#define MULTIBOOT_VIDEO_MODE_GFX 0
#define MULTIBOOT_VIDEO_MODE_TEXT 1

#define MULTIBOOT_MODE_TYPE MULTIBOOT_VIDEO_MODE_TEXT
#define MULTIBOOT_MODE_TYPE MULTIBOOT_VIDEO_MODE_GFX

#define MULTIBOOT_HEADER_ADDR 0
#define MULTIBOOT_LOAD_ADDRESS 0
Expand Down
10 changes: 8 additions & 2 deletions common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <smp/mptables.h>
#include <smp/smp.h>

#include <drivers/fb.h>
#include <drivers/hpet.h>
#include <drivers/pic.h>
#include <drivers/pit.h>
Expand Down Expand Up @@ -137,6 +138,8 @@ static void display_cpu_info(void) {
printk("Frequency: %lu MHz\n", freq / MHZ(1));
}

static void display_banner(void) { draw_logo(); }

static void __text_init init_vga_console(void) {
if (!boot_flags.vga)
return;
Expand Down Expand Up @@ -194,6 +197,11 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic,
if (opt_debug)
dump_pagetables();

if (init_framebuffer(mbi))
display_banner();
else
init_vga_console();

init_percpu();

init_traps(get_bsp_cpu_id());
Expand All @@ -213,8 +221,6 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic,
BUG();
}

init_vga_console();

init_apic(get_bsp_cpu_id(), APIC_MODE_XAPIC);

init_tasks();
Expand Down
2 changes: 2 additions & 0 deletions grub/boot/grub/grub.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set timeout=0
set default=0

insmod all_video

serial --speed=115200 --word=8 --parity=no --stop=1
terminal_input --append serial
terminal_output --append serial
Expand Down

0 comments on commit bdf6272

Please sign in to comment.