23 #include "modules/system/vfs/File.h" 24 #include "pedigree/kernel/compiler.h" 25 #include "pedigree/kernel/machine/InputManager.h" 26 #include "pedigree/kernel/process/Mutex.h" 27 #include "pedigree/kernel/processor/MemoryRegion.h" 28 #include "pedigree/kernel/processor/types.h" 29 #include "pedigree/kernel/utilities/Buffer.h" 30 #include "pedigree/kernel/utilities/String.h" 36 #define MAX_TEXTIO_PARAMS 16 37 #define TEXTIO_BUFFER_SIZE 1024 41 #define BLINK_ON_PERIOD 1000 42 #define BLINK_OFF_PERIOD (BLINK_ON_PERIOD / 2) 51 static const int COLOUR_BRIGHT_ADDEND = 8;
73 VgaColour adjustColour(
int colour,
bool up)
77 return static_cast<VgaColour
>(colour + COLOUR_BRIGHT_ADDEND);
81 return static_cast<VgaColour
>(colour - COLOUR_BRIGHT_ADDEND);
87 LineFeedNewLine = 0x1,
107 CharacterSetG0 = 0x1000000,
108 CharacterSetG1 = 0x2000000,
127 bool initialise(
bool bClear =
true);
134 void writeStr(
const char *s,
size_t len);
140 uint64_t location, uint64_t size, uintptr_t buffer,
141 bool bCanBlock =
true);
143 uint64_t location, uint64_t size, uintptr_t buffer,
144 bool bCanBlock =
true);
145 virtual int select(
bool bWriting =
false,
int timeout = 0);
147 virtual void flipThread();
162 void unmarkPrimary();
167 bool isPrimary()
const;
172 void setMode(InputMode mode);
177 InputMode getMode()
const;
180 static const ssize_t BACKBUFFER_COLS_WIDE = 132;
181 static const ssize_t BACKBUFFER_COLS_NORMAL = 80;
182 static const ssize_t BACKBUFFER_ROWS = 25;
184 static const ssize_t BACKBUFFER_STRIDE = BACKBUFFER_COLS_WIDE;
191 void setColour(VgaColour *which,
size_t param,
bool bBright =
false);
195 void doCarriageReturn();
196 void doHorizontalTab();
207 void eraseScreen(uint8_t character);
209 void goHome(ssize_t xmove = 0, ssize_t ymove = 0);
212 void clearBackbuffer();
217 void flip(
bool timer =
false,
bool hideState =
false);
220 uint8_t translate(uint32_t codepoint);
238 bool m_bQuestionMark;
239 ssize_t m_CursorX, m_CursorY;
240 ssize_t m_SavedCursorX, m_SavedCursorY;
241 ssize_t m_ScrollStart, m_ScrollEnd;
242 ssize_t m_LeftMargin, m_RightMargin;
243 size_t m_CurrentParam;
244 size_t m_Params[MAX_TEXTIO_PARAMS];
247 VgaColour m_Fore, m_Back;
251 uint16_t *m_pFramebuffer;
255 char m_TabStops[BACKBUFFER_STRIDE];
304 InputMode m_InputMode;
virtual bool isBytewise() const
virtual int select(bool bWriting=false, int timeout=0)
virtual uint64_t readBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)
Special memory entity in the kernel's virtual address space.
Buffer< char > m_OutBuffer
virtual uint64_t writeBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)