SayoriOS 0.3.3

vbe.c
См. документацию.
1
9 #include "multiboot.h"
10 #include <io/ports.h>
11
12 struct VbeInfoBlock {
13 char VbeSignature[4]; // == "VESA"
14 uint16_t VbeVersion; // == 0x0300 for VBE 3.0
15 uint16_t OemStringPtr[2]; // isa vbeFarPtr
16 uint8_t Capabilities[4];
17 uint16_t VideoModePtr[2]; // isa vbeFarPtr
18 uint16_t TotalMemory; // as # of 64KB blocks
19 uint8_t Reserved[492];
20 } __attribute__((packed)); // 512 b
21
22 struct vbe_mode_info_structure {
23 uint16_t attributes; // deprecated, only bit 7 should be of interest to you, and it indicates the mode supports a linear frame buffer.
24 uint8_t window_a; // deprecated
25 uint8_t window_b; // deprecated
26 uint16_t granularity; // deprecated; used while calculating bank numbers
27 uint16_t window_size;
28 uint16_t segment_a;
29 uint16_t segment_b;
30 uint32_t win_func_ptr; // deprecated; used to switch banks from protected mode without returning to real mode
31 uint16_t pitch; // number of bytes per horizontal line
32 uint16_t width; // width in pixels
33 uint16_t height; // height in pixels
34 uint8_t w_char; // unused...
35 uint8_t y_char; // ...
36 uint8_t planes;
37 uint8_t bpp; // bits per pixel in this mode
38 uint8_t banks; // deprecated; total number of banks in this mode
39 uint8_t memory_model;
40 uint8_t bank_size; // deprecated; size of a bank, almost always 64 KB but may be 16 KB...
41 uint8_t image_pages;
42 uint8_t reserved0;
43
44 uint8_t red_mask;
45 uint8_t red_position;
46 uint8_t green_mask;
47 uint8_t green_position;
48 uint8_t blue_mask;
49 uint8_t blue_position;
50 uint8_t reserved_mask;
51 uint8_t reserved_position;
52 uint8_t direct_color_attributes;
53
54 uint32_t framebuffer; // physical address of the linear frame buffer; write here to draw to the screen
55 uint32_t off_screen_mem_off;
56 uint16_t off_screen_mem_size; // size of memory in the framebuffer but not being displayed on the screen
57 uint8_t reserved1[206];
58 } __attribute__ ((packed));
59
60 void drv_vbe_init(multiboot_header_t *mboot){
62 qemu_log("vbe: init");
63
64 //qemu_log("vbe: point %x",point);
65
66 }
VbeInfoBlock
Definition: vbe.c:12
multiboot_header
Definition: multiboot.h:24
vbe_mode_info_structure
Definition: vbe.c:22
__attribute__
struct VbeInfoBlock __attribute__((packed))
14+
Definition: psf.h:19
drv_vbe_init
void drv_vbe_init(multiboot_header_t *mboot)
Definition: vbe.c:60