PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
#include "devices/vga.h"
#include <round.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include "devices/speaker.h"
#include "threads/io.h"
#include "threads/interrupt.h"
#include "threads/vaddr.h"
Go to the source code of this file.
Macros | |
#define | COL_CNT 80 |
VGA text screen support. More... | |
#define | ROW_CNT 25 |
#define | GRAY_ON_BLACK 0x07 |
Attribute value for gray text on a black background. More... | |
Functions | |
static void | clear_row (size_t y) |
Clears row Y to spaces. More... | |
static void | cls (void) |
Clears the screen and moves the cursor to the upper left. More... | |
static void | newline (void) |
Advances the cursor to the first column in the next line on the screen. More... | |
static void | move_cursor (void) |
Moves the hardware cursor to (cx,cy). More... | |
static void | find_cursor (size_t *x, size_t *y) |
Reads the current hardware cursor position into (*X,*Y). More... | |
static void | init (void) |
Initializes the VGA text display. More... | |
void | vga_putc (int c) |
Writes C to the VGA text display, interpreting control characters in the conventional ways. More... | |
Variables | |
static size_t | cx |
Current cursor position. More... | |
static size_t | cy |
static uint8_t(* | fb )[COL_CNT][2] |
Framebuffer. More... | |
#define COL_CNT 80 |
#define GRAY_ON_BLACK 0x07 |
|
static |
|
static |
Clears the screen and moves the cursor to the upper left.
Definition at line 107 of file vga.c.
References clear_row(), cx, cy, move_cursor(), and ROW_CNT.
Referenced by vga_putc().
|
static |
Initializes the VGA text display.
Definition at line 37 of file vga.c.
References cx, cy, fb, find_cursor(), inited, and ptov().
Referenced by vga_putc().
|
static |
|
static |
Advances the cursor to the first column in the next line on the screen.
If the cursor is already on the last line on the screen, scrolls the screen upward one line.
Definition at line 135 of file vga.c.
References clear_row(), cx, cy, fb, memmove(), and ROW_CNT.
Referenced by vga_putc().
void vga_putc | ( | int | c | ) |
Writes C to the VGA text display, interpreting control characters in the conventional ways.
Definition at line 52 of file vga.c.
References cls(), COL_CNT, cx, cy, fb, GRAY_ON_BLACK, init(), intr_disable(), intr_set_level(), move_cursor(), newline(), ROUND_UP, and speaker_beep().
Referenced by putchar_have_lock().
|
static |
Current cursor position.
(0,0) is in the upper left corner of the display.
Definition at line 19 of file vga.c.
Referenced by cls(), init(), move_cursor(), newline(), and vga_putc().
|
static |
Definition at line 19 of file vga.c.
Referenced by cls(), init(), move_cursor(), newline(), and vga_putc().
Framebuffer.
See [FREEVGA] under "VGA Text Mode Operation". The character at (x,y) is fb[y][x][0]. The attribute at (x,y) is fb[y][x][1].
Definition at line 27 of file vga.c.
Referenced by clear_row(), init(), newline(), and vga_putc().