[Krafton Jungle] PintOS 2.0.0
크래프톤 정글 PintOS
 
Loading...
Searching...
No Matches
vga.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void vga_putc (int)
 

Function Documentation

◆ vga_putc()

void vga_putc ( int  c)
49 {
50 /* Disable interrupts to lock out interrupt handlers
51 that might write to the console. */
52 enum intr_level old_level = intr_disable ();
53
54 init ();
55
56 switch (c) {
57 case '\n':
58 newline ();
59 break;
60
61 case '\f':
62 cls ();
63 break;
64
65 case '\b':
66 if (cx > 0)
67 cx--;
68 break;
69
70 case '\r':
71 cx = 0;
72 break;
73
74 case '\t':
75 cx = ROUND_UP (cx + 1, 8);
76 if (cx >= COL_CNT)
77 newline ();
78 break;
79
80 default:
81 fb[cy][cx][0] = c;
82 fb[cy][cx][1] = GRAY_ON_BLACK;
83 if (++cx >= COL_CNT)
84 newline ();
85 break;
86 }
87
88 /* Update cursor position. */
89 move_cursor ();
90
91 intr_set_level (old_level);
92}
enum intr_level intr_set_level(enum intr_level)
Definition: interrupt.c:130
enum intr_level intr_disable(void)
Definition: interrupt.c:151
intr_level
Definition: interrupt.h:8
#define ROUND_UP(X, STEP)
Definition: round.h:6
static void init(void)
Definition: vga.c:36
#define GRAY_ON_BLACK
Definition: vga.c:21
static size_t cy
Definition: vga.c:18
#define COL_CNT
Definition: vga.c:13
static void cls(void)
Definition: vga.c:96
static void newline(void)
Definition: vga.c:122
static void move_cursor(void)
Definition: vga.c:135
static size_t cx
Definition: vga.c:18
static uint8_t(* fb)[COL_CNT][2]
Definition: vga.c:26
Here is the call graph for this function:
Here is the caller graph for this function: