summaryrefslogtreecommitdiff
path: root/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel.c')
-rw-r--r--kernel.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/kernel.c b/kernel.c
deleted file mode 100644
index 8e59664..0000000
--- a/kernel.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#define NB_COLS 80
-#define NB_ROWS 25
-
-/* XXX doest not always handle memory overlaps */
-static void my_memmove(void *dest, const void *src, size_t n)
-{
- for (size_t i = 0; i < n; ++i) {
- dest[i] = src[i];
- }
-}
-
-static void my_memset(void *dest, int c, size_t n)
-{
- for (size_t i = 0; i < n; ++i) {
- dest[i] = c;
- }
-}
-
-int printk(const char *str)
-{
- static char *offset = (char *) 0xb8000;
- static char *addr = offset;
- int count = 0;
-
- for (int i = 0; str[i]; ++i) {
- if ((long)addr >= 0xb8000 + NB_COLS * NB_ROWS) {
- /* shift up */
- addr -= NB_COLS;
- my_memmove(offset, offset + NB_COLS, NB_COLS * (NB_ROWS - 1));
- my_memset(offset + NB_COLS * (NB_ROWS - 1), ' ', NB_ROWS);
- }
-
- *addr++ = str[i]
- ++count;
-
- }
-
- return count;
-}
-
-int main(void)
-{
-}