AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
vesa.c File Reference

The VESA framebuffer: the linear framebuffer that the boot loader set up, as /dev/fb0. More...

#include <core/system.h>
#include <dev/fbdev.h>
#include <fs/devfs.h>
#include <video/vesa.h>
#include <mm/vm.h>

Go to the source code of this file.

Functions

static ssize_t fbdev_vesa_write (struct fbdev *fb, off_t offset, struct iobuf *io)
 Writes to the framebuffer at offset, as much as fits before its end.
static int fbdev_vesa_map (struct fbdev *fb, struct vm_space *vm_space, struct vm_entry *vm_entry)
 Maps the framebuffer, or part of it, into a process's address space.
static int fbdev_vesa_prope (int i, struct fbdev *fb)
 Sets up the framebuffer from the mode the boot loader chose: maps it into the kernel's address space, and fills in its screen information for ioctl().

Variables

static char * vmem = (char *) ARCH_VESA_BASE
static struct vm_entry vesa_vm
static size_t len = 0
static struct fb_fix_screeninfo vesa_fix_screeninfo
static struct fb_var_screeninfo vesa_var_screeninfo
struct fbdev fbdev_vesa

Detailed Description

The VESA framebuffer: the linear framebuffer that the boot loader set up, as /dev/fb0.

The boot loader chose the video mode and gave its description (a VBE mode info block). This driver maps the framebuffer into the kernel's address space, at ARCH_VESA_BASE, and describes it with Linux's framebuffer structures. The mode can't be changed. A process can write to the framebuffer, or map it into its own address space (a shared mapping only).

Definition in file vesa.c.

Function Documentation

◆ fbdev_vesa_map()

int fbdev_vesa_map ( struct fbdev * fb,
struct vm_space * vm_space,
struct vm_entry * vm_entry )
static

Maps the framebuffer, or part of it, into a process's address space.

Only a shared mapping is possible (ENOTSUP for a private one), and it must lie within the framebuffer (ENXIO otherwise).

Definition at line 52 of file vesa.c.

References fb, fb_size, fbdev_vesa_map(), vm_entry::flags, vm_entry::off, vm_entry::paddr, PAGE_ROUND, vm_entry::size, vesa_vm, vm_map(), and VM_SHARED.

Referenced by fbdev_vesa_map(), and fbdev_vesa_prope().

◆ fbdev_vesa_prope()

◆ fbdev_vesa_write()

ssize_t fbdev_vesa_write ( struct fbdev * fb,
off_t offset,
struct iobuf * io )
static

Writes to the framebuffer at offset, as much as fits before its end.

Returns how much was written, 0 past the end.

Definition at line 37 of file vesa.c.

References fb, fbdev_vesa_write(), iobuf_in(), len, MIN, and iobuf::resid.

Referenced by fbdev_vesa_prope(), and fbdev_vesa_write().

Variable Documentation

◆ fbdev_vesa

struct fbdev fbdev_vesa
Initial value:
= {
.probe = fbdev_vesa_prope,
.write = fbdev_vesa_write,
}
static int fbdev_vesa_prope(int i, struct fbdev *fb)
Sets up the framebuffer from the mode the boot loader chose: maps it into the kernel's address space,...
Definition vesa.c:73
static ssize_t fbdev_vesa_write(struct fbdev *fb, off_t offset, struct iobuf *io)
Writes to the framebuffer at offset, as much as fits before its end.
Definition vesa.c:37
static int fbdev_vesa_map(struct fbdev *fb, struct vm_space *vm_space, struct vm_entry *vm_entry)
Maps the framebuffer, or part of it, into a process's address space.
Definition vesa.c:52

Definition at line 141 of file vesa.c.

◆ len

size_t len = 0
static

Definition at line 27 of file vesa.c.

Referenced by fbdev_vesa_prope(), and fbdev_vesa_write().

◆ vesa_fix_screeninfo

struct fb_fix_screeninfo vesa_fix_screeninfo
static
Initial value:
= {
.id = "VESA FB",
}

Definition at line 29 of file vesa.c.

Referenced by fbdev_vesa_prope().

◆ vesa_var_screeninfo

struct fb_var_screeninfo vesa_var_screeninfo
static

Definition at line 33 of file vesa.c.

Referenced by fbdev_vesa_prope().

◆ vesa_vm

struct vm_entry vesa_vm
static
Initial value:
= {
.base = ARCH_VESA_BASE,
}
#define ARCH_VESA_BASE
Definition mm.h:44

Definition at line 22 of file vesa.c.

Referenced by fbdev_vesa_map(), and fbdev_vesa_prope().

◆ vmem

char* vmem = (char *) ARCH_VESA_BASE
static

Definition at line 20 of file vesa.c.