projects
/
3sys
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vga text output and libc expansion
[3sys]
/
sys1
/
kern
/
src
/
main.c
diff --git
a/sys1/kern/src/main.c
b/sys1/kern/src/main.c
index
b89a98b
..
f0441e5
100644
(file)
--- a/
sys1/kern/src/main.c
+++ b/
sys1/kern/src/main.c
@@
-1,22
+1,22
@@
+#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <string.h>
#include <stdint.h>
-
-void clearscr(void)
-{
- memset((void*)0xb8000, 0, 80 * 25 * 2);
-}
+#include "vga.h"
void drawtext(int x, int y, const char *s)
{
void drawtext(int x, int y, const char *s)
{
- uint16_t *vptr = (uint16_t*)0xb8000 + y * 80 + x;
-
while(*s) {
while(*s) {
- *vptr++ = 0x0c00 | *s++;
+ vga_drawchar(x++, y, *s++);
}
}
void kmain(void)
{
}
}
void kmain(void)
{
- clearscr();
- drawtext(10, 5, "3sys kernel 1");
+ char buf[64];
+
+ vga_reset();
+ vga_setcolor(VGA_YELLOW | VGA_BRIGHT, VGA_BLACK);
+
+ sprintf(buf, "kmain addr: %p", (void*)kmain);
+ drawtext(10, 5, buf);
}
}