2 *stdio for Charactor Shell
14 BRACK, BLUE, GREEN, CIAN, RED, MASENTA
15 BRAWN, GLAY, D_GLAY, CH_BLUE, CH_GREE
16 CH_CIAN, PINK, CH_MAS, YELLOW, WHITE
23 int asm_move_cursol(int ebp);
25 unsigned short* screen;
31 return Generate_Scancode_To_ASCII_Code();
33 void scanf(const char* fmt,...)
36 va_start(arg,char*,fmt);
46 int buf=0; char chbuf=0;
92 }else if(chbuf=='\b' && count>=0){
103 char *cmd; cmd=va_arg(arg,char*);
117 }else if(*cmd=='\b' && count>0){
131 va_arg(arg,char)=getchar();
143 code=Generate_Scancode_To_ASCII_Code();
154 code=Generate_Scancode_To_ASCII_Code();
159 void ClearScreen(void)
161 screen=(unsigned short*)0xb8000;
163 while(screen<(unsigned short*)0xc0000)
167 screen=(unsigned short*)0xb8000;
171 void puts(const char* msg)
185 void putchar(const char ch)
188 screen+=(80-X);/*80 charactors * 2byte - X charactors * 2 byte*/
193 *screen++ = (((attr)<<8) | ' ');
194 *screen++ = (((attr)<<8) | ' ');
200 *screen-- = (unsigned short)NUM_NULL;
206 *screen = (unsigned short)NUM_NULL;
210 *screen++ = (((attr)<<8) | ch);
216 void printTASK(const char* msg)
224 void printOK(const char* msg)
240 void printFAIL(const char* msg)
256 void printWARN(const char* msg)
272 void printINFO(const char* msg)
287 char * uint_to_str_big_hex(char *buf, unsigned src, int base) {
292 *p++ = "0123456789ABCDEF"[src%base];
293 } while(src /= base);
299 for(p1=buf, p2=p-1; p1 < p2; p1++, p2--) {
308 char * uint_to_str_small_hex(char *buf, unsigned src, int base) {
313 *p++ = "0123456789abcdef"[src%base];
314 } while(src /= base);
320 for(p1=buf, p2=p-1; p1 < p2; p1++, p2--) {
329 void printf(char* fmt, ...)
331 char **arg = (char **) &fmt;
335 while((c = *fmt++) != 0) {
345 // if value is minus, put '-' in the head
346 if( 0 > *((int *) arg) ) {
348 *((int *) arg) *= -1;
350 p = uint_to_str_small_hex(buf, *((unsigned *) arg++), 10);
354 p = uint_to_str_small_hex(buf, *((unsigned *) arg++), 16);
358 p = uint_to_str_big_hex(buf, *((unsigned *) arg++), 16);