aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
authorMarvin Borner2021-04-28 23:12:17 +0200
committerMarvin Borner2021-04-28 23:12:17 +0200
commit04104fc051d44f4f9b3328f29b4be91fa4060f34 (patch)
tree1677c1739c44bd7c7e8722ea00ca3c6b45158c85 /kernel/inc
parent895a58b1b57a0ae8028576404a90f12e0133cf5f (diff)
Started conversion to Grub (#17)
Yes, the CI won't like this.
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/fb.h2
-rw-r--r--kernel/inc/io.h2
-rw-r--r--kernel/inc/mm.h2
-rw-r--r--kernel/inc/multiboot.h124
4 files changed, 127 insertions, 3 deletions
diff --git a/kernel/inc/fb.h b/kernel/inc/fb.h
index 052f3d2..46f9020 100644
--- a/kernel/inc/fb.h
+++ b/kernel/inc/fb.h
@@ -7,6 +7,6 @@
#include <mm.h>
void fb_map_buffer(struct page_dir *dir, struct vid_info *boot) NONNULL;
-void fb_install(struct vid_info *boot) NONNULL;
+void fb_install(void) NONNULL;
#endif
diff --git a/kernel/inc/io.h b/kernel/inc/io.h
index ed7920e..5d51f89 100644
--- a/kernel/inc/io.h
+++ b/kernel/inc/io.h
@@ -16,7 +16,7 @@ struct io_dev {
res (*ready)(void);
};
-void io_install(struct boot_info *boot);
+void io_install(void);
void io_add(enum io_type io, struct io_dev *dev) NONNULL;
// No NONNULL on syscalls
diff --git a/kernel/inc/mm.h b/kernel/inc/mm.h
index e912fec..1652695 100644
--- a/kernel/inc/mm.h
+++ b/kernel/inc/mm.h
@@ -146,6 +146,6 @@ res memory_sys_free(struct page_dir *dir, u32 addr);
res memory_sys_shaccess(struct page_dir *dir, u32 id, u32 *addr, u32 *size);
void memory_user_hook(void);
-void memory_install(struct boot_info *boot) NONNULL;
+void memory_install(void) NONNULL;
#endif
diff --git a/kernel/inc/multiboot.h b/kernel/inc/multiboot.h
new file mode 100644
index 0000000..f9851fb
--- /dev/null
+++ b/kernel/inc/multiboot.h
@@ -0,0 +1,124 @@
+// MIT License, Copyright (c) 2021 Marvin Borner
+
+#ifndef MULTIBOOT_H
+#define MULTIBOOT_H
+
+#define MULTIBOOT_MAGIC 0x2badb002
+#define MULTIBOOT_INFO_MEMORY 0x00000001
+#define MULTIBOOT_INFO_BOOTDEV 0x00000002
+#define MULTIBOOT_INFO_CMDLINE 0x00000004
+#define MULTIBOOT_INFO_MODS 0x00000008
+#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
+#define MULTIBOOT_INFO_ELF_SHDR 0x00000020
+#define MULTIBOOT_INFO_MEM_MAP 0x00000040
+#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
+#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
+#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
+#define MULTIBOOT_INFO_APM_TABLE 0x00000400
+#define MULTIBOOT_INFO_VBE_INFO 0x00000800
+#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
+
+#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
+#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
+#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
+
+#define MULTIBOOT_MEMORY_AVAILABLE 1
+#define MULTIBOOT_MEMORY_RESERVED 2
+#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
+#define MULTIBOOT_MEMORY_NVS 4
+#define MULTIBOOT_MEMORY_BADRAM 5
+
+#include <def.h>
+
+struct multiboot_aout_symbol_table {
+ u32 tabsize;
+ u32 strsize;
+ u32 addr;
+ u32 reserved;
+};
+
+struct multiboot_elf_section_header_table {
+ u32 num;
+ u32 size;
+ u32 addr;
+ u32 shndx;
+};
+
+struct multiboot_info {
+ u32 flags;
+
+ u32 mem_lower;
+ u32 mem_upper;
+
+ u32 boot_device;
+
+ u32 cmdline;
+
+ u32 mods_count;
+ u32 mods_addr;
+
+ union {
+ struct multiboot_aout_symbol_table aout_sym;
+ struct multiboot_elf_section_header_table elf_sec;
+ } u;
+
+ u32 mmap_length;
+ u32 mmap_addr;
+
+ u32 drives_length;
+ u32 drives_addr;
+
+ u32 config_table;
+
+ u32 boot_loader_name;
+
+ u32 apm_table;
+
+ u32 vbe_control_info;
+ u32 vbe_mode_info;
+ u16 vbe_mode;
+ u16 vbe_interface_seg;
+ u16 vbe_interface_off;
+ u16 vbe_interface_len;
+
+ u64 framebuffer_addr;
+ u32 framebuffer_pitch;
+ u32 framebuffer_width;
+ u32 framebuffer_height;
+ u8 framebuffer_bpp;
+ u8 framebuffer_type;
+ union {
+ struct {
+ u32 framebuffer_palette_addr;
+ u16 framebuffer_palette_num_colors;
+ } palette;
+ struct {
+ u8 framebuffer_red_field_position;
+ u8 framebuffer_red_mask_size;
+ u8 framebuffer_green_field_position;
+ u8 framebuffer_green_mask_size;
+ u8 framebuffer_blue_field_position;
+ u8 framebuffer_blue_mask_size;
+ } colors;
+ } framebuffer_colors;
+};
+
+struct multiboot_mmap_entry {
+ u32 size;
+ u64 addr;
+ u64 len;
+ u32 type;
+} PACKED;
+
+struct multiboot_mod_list {
+ u32 mod_start;
+ u32 mod_end;
+
+ u32 cmdline;
+
+ u32 pad;
+};
+
+void multiboot_init(u32 magic, u32 addr);
+
+#endif