Reorganized source tree. Started using autotools.

This commit is contained in:
2020-07-17 10:03:28 -05:00
parent 36c88daa87
commit 0bb65f2d94
28 changed files with 142 additions and 149 deletions

60
src/tty.hpp Normal file
View File

@@ -0,0 +1,60 @@
#ifndef TTY_H_
#define TTY_H_
#include <stddef.h>
namespace kernel
{
class TTY
{
public:
enum Format
{
Binary,
Decimal,
Hex
};
TTY(char* vga);
TTY& operator<<(Format fmt);
TTY& operator<<(const char* str);
TTY& operator<<(unsigned int n);
TTY& operator<<(int n);
TTY& operator<<(void* n);
TTY& operator<<(char c);
void setWidth(size_t width);
size_t getWidth();
void clear();
private:
TTY& printNumber(unsigned int n, size_t base, size_t width);
TTY& printString(const char* str);
TTY& putChar(char c);
char* vga;
int cursor;
size_t width;
size_t base;
};
}
#endif