42 if ((
size_t) offset >=
len)
88 printk(
"vesa: can't map the framebuffer: error %d\n", -err);
129 vesa_var_screeninfo.red = (struct fb_bitfield) {11, 5, 0};
ssize_t iobuf_in(struct iobuf *io, void *dst, size_t n)
Copies bytes from the iobuf's buffer into the kernel, and moves past them.
int printk(const char *fmt,...)
Writes a kernel message, to the message buffer and the consoles.
The boot loader's VBE framebuffer: what VBE said about the card and the mode (dev/fb/vesa/).
struct mode_info_block * mode_info
A framebuffer: its driver, its screen's information, its operations.
int(*) probe(int id, struct fbdev *fb)
ssize_t(*) write(struct fbdev *fb, off_t offset, struct iobuf *io)
struct fb_var_screeninfo * var_screeninfo
struct fb_fix_screeninfo * fix_screeninfo
int(*) map(struct fbdev *fb, struct vm_space *vm_space, struct vm_entry *vm_entry)
A VBE mode's information block.
uint8_t red_field_position
uint8_t blue_field_position
uint8_t green_field_position
uint16_t lin_bytes_per_scanline
A mapping (map entry): a range of an address space, its permissions, and where its pages come from.
uint32_t flags
its permissions and flags (VM_*)
paddr_t paddr
physical memory to map all at once (vm_map()), or 0 for pages that come in on page faults
size_t off
where the mapping starts in its object
An address space: its mappings, and its page tables.
An arena: a range, and its segments.
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,...
static struct fb_fix_screeninfo vesa_fix_screeninfo
static struct fb_var_screeninfo vesa_var_screeninfo
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 struct vm_entry vesa_vm
int vm_map(struct vm_space *vm_space, struct vm_entry *vm_entry)
Maps a map entry's whole range at once: its physical memory (paddr), or new pages of memory if it has...
#define VM_SHARED
shared: a fork doesn't copy it
struct vm_space kvm_space
#define VM_KRW
kernel read/write