-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterminal.h
executable file
·46 lines (34 loc) · 946 Bytes
/
terminal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _KERNEL_TTY_H
#define _KERNEL_TTY_H
#include <stdint.h>
#include <stddef.h>
#include "utils.h"
namespace mOS
{
class Terminal
{
public:
/// Default constructor
Terminal();
~Terminal() = default;
NON_COPYABLE(Terminal);
/// Writes a character to the terminal
/// @param[in] c the character to
void putChar(char c);
/// Writes a string buffer in to the terminal
/// @param[in] data the buffer
/// @param[in] len the size of the buffer
void write(const char* data, size_t len);
/// Writes string to the terminal
/// @param[in] data is the string
void writeString(const char* data);
private:
void clearTerminal();
static uint16_t* const VGAAddress;
size_t m_row;
size_t m_column;
uint8_t m_color;
uint16_t* m_buffer;
};
} // mOS Namespace
#endif