summaryrefslogtreecommitdiff
path: root/src/sys/include/io/cons/cons.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-15 03:01:25 -0400
committerIan Moffett <ian@osmora.org>2025-09-15 03:02:27 -0400
commitb736f9f73b44dc6d6bbefdd11eda73abe0e0eea5 (patch)
treeb0b67eb5fa1e584f97c2b01f8b63feedc17e80c4 /src/sys/include/io/cons/cons.h
parent51727d06791a071f1b5d69f6a91345da9776b081 (diff)
kern: cons: Add console string writing routine
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/io/cons/cons.h')
-rw-r--r--src/sys/include/io/cons/cons.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sys/include/io/cons/cons.h b/src/sys/include/io/cons/cons.h
index 3f95cc0..7b0543e 100644
--- a/src/sys/include/io/cons/cons.h
+++ b/src/sys/include/io/cons/cons.h
@@ -32,9 +32,14 @@
#include <sys/types.h>
#include <sys/bootvars.h>
+#include <os/spinlock.h>
struct cons_scr {
+ struct spinlock lock;
struct bootvar_fb fbvars;
+ size_t text_x;
+ size_t text_y;
+ size_t max_col;
uint32_t scr_bg;
uint32_t scr_fg;
};
@@ -51,4 +56,16 @@ extern struct cons_scr g_root_scr;
*/
int cons_init(void);
+/*
+ * Write a string onto the screen
+ *
+ * @scr: Screen to write on
+ * @str: String to write onto the screen
+ * @len: Length of string to write
+ *
+ * Returns the number of bytes written on success,
+ * otherwise a less than zero value to indicate failure.
+ */
+ssize_t cons_putstr(struct cons_scr *scr, const char *str, size_t len);
+
#endif /* !_CONS_CONS_H_ */