[LinksOS CVS Commit]linksos/hal/x86 kstdio.c,NONE,1.1
Status: Inactive
Brought to you by:
terencevs
|
From: <ke...@to...> - 2003-01-03 20:22:31
|
Update of /cvsroot/linksos/linksos/hal/x86 In directory router-internal.tossell.net:/tmp/cvs-serv16785 Added Files: kstdio.c Log Message: Title: kernel stdio Changes: Moved a copy of kstdio.c (kprintf so far) to the x86 hal dir. Effects: Portability dude a=kennyt --- NEW FILE: kstdio.c --- /****************************************************************************\ ** filename: kstdio.c ** ** creation date: 11/29/2002, 0109 MST ** ** author: Charles Banas ** ** version: 0.01 ** ****************************************************************************** ** revision history: ** ** 11/29/2002 - 0109 MST - Charles ** ** added kprintf(). let's see if this baby links, eh. ** \****************************************************************************/ #include "include/kstdio.h" typedef unsigned char u_char; /* this needs to be moved to a "types" header file. */ void kprintf(char* text) /* kernel-mode printf: to be used ONLY within the kernel and ONLY in text-mode. any other mode can be disastrous, as this code does not check what mode it is in. optimization is pointless and makes no sense anyway. version 0.02 will have extended parameters. :) */ { /* write 'text' to screen. */ static char* screen = (char*)0xB8000; int j; static int i = 0; static u_char prev; for(j=0;text[j]!=0;++i,j++) { /* don't be scared. it's kosher. :) */ if (((text[j]==0xa) || (text[j]==0xd)) && ((prev==0xa) || (prev==0xd))) { continue; prev = text[j]; } else if ((text[j]==0xa) || (text[j]==0xd)) { i = i + (0xa0); prev = text[j]; continue; } prev = text[j]; screen[i*2] = text[j]; screen[i*2+1] = 7; } } |