started adding a vesa fb

This commit is contained in:
Morten Delenk 2017-04-28 21:04:33 +00:00
parent dfd6e90200
commit e8d09031cb
4 changed files with 35 additions and 12 deletions

View file

@ -92,7 +92,7 @@
#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
#ifndef ASM_FILE
#define multiboot_PACKED __attribute__((packed))
typedef unsigned char multiboot_uint8_t;
typedef unsigned short multiboot_uint16_t;
typedef unsigned int multiboot_uint32_t;
@ -230,7 +230,7 @@ struct multiboot_mmap_entry {
#define MULTIBOOT_MEMORY_NVS 4
#define MULTIBOOT_MEMORY_BADRAM 5
multiboot_uint32_t type;
} GRUB_PACKED;
} multiboot_PACKED;
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
struct multiboot_mod_list {
@ -248,15 +248,15 @@ typedef struct multiboot_mod_list multiboot_module_t;
/* APM BIOS info. */
struct multiboot_apm_info {
grub_uint16_t version;
grub_uint16_t cseg;
grub_uint32_t offset;
grub_uint16_t cseg_16;
grub_uint16_t dseg;
grub_uint16_t flags;
grub_uint16_t cseg_len;
grub_uint16_t cseg_16_len;
grub_uint16_t dseg_len;
multiboot_uint16_t version;
multiboot_uint16_t cseg;
multiboot_uint32_t offset;
multiboot_uint16_t cseg_16;
multiboot_uint16_t dseg;
multiboot_uint16_t flags;
multiboot_uint16_t cseg_len;
multiboot_uint16_t cseg_16_len;
multiboot_uint16_t dseg_len;
};
#endif /* ! ASM_FILE */

View file

@ -1,8 +1,22 @@
#include <config.h>
#include <multiboot.h>
#ifndef ENABLE_FRAMEBUFFER
#include "../../../hw/pc/cgaterm/cgaterm.hpp"
#else
#include "../../../hw/pc/vesafb/vesafb.hpp"
#endif
#include <base.hpp>
static multiboot_info_t *mb_info;
#ifndef ENABLE_FRAMEBUFFER
CGATerm term;
#else
VESAfb term(mb_info);
#endif
void main();
extern "C" void start() { main(); }
extern "C" void start(int eax, multiboot_info_t *ebx) {
mb_info = ebx;
main();
}
void drivers_init() {
setMainTTY(&term);
--term;

View file

@ -7,8 +7,16 @@ _start:
jmp _start2
.align MULTIBOOT_HEADER_ALIGN
.int MULTIBOOT_HEADER_MAGIC
#ifndef ENABLE_FRAMEBUFFER
.int 0x0
.int -(MULTIBOOT_HEADER_MAGIC)
#else
.int 0x7
.int -(MULTIBOOT_HEADER_MAGIC+0x7)
.int 0,0,0,0,0
.int 0
.int 1024, 768, 24
#endif
.align MULTIBOOT_HEADER_ALIGN
.extern start
_start2:

View file

@ -2,6 +2,7 @@ config["ENABLE_FRAMEBUFFER"] = get_yes_no("Use VESA Framebuffer?", True)
if config["ENABLE_FRAMEBUFFER"]:
config["ENABLE_FRAMEBUFFER_UNICODE"] = get_yes_no("Enable full Unicode BMP font (Adds around 1MB to binary)", False)
if config["ENABLE_FRAMEBUFFER"]:
add_driver(True, "framebuffer")
add_driver(False, "vesafb")
else:
add_driver(False, "cgaterm")