Changeset 90
- Timestamp:
- Jun 29, 2017, 11:00:53 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/x86_printf.c
r84 r90 52 52 static void check_scroll() 53 53 { 54 char *base = ( uint64_t)iom_base + (0xB8000 - IOM_BEGIN);54 char *base = (char *)iom_base + (0xB8000 - IOM_BEGIN); 55 55 char *src, *dst; 56 56 size_t i; … … 67 67 } 68 68 69 memset(base, 0, CONS_X_SIZE * 2 * CONS_Y_SIZE); 69 memset(&cons_buffer[0] + (CONS_X_SIZE * 2) * (CONS_Y_SIZE - 1), 70 0, (CONS_X_SIZE * 2)); 70 71 71 72 cons_ptr -= (CONS_X_SIZE * 2); … … 135 136 } 136 137 138 static char alphabet[] = "abcdefghijklmnopqrstuvwxyz"; 139 137 140 void x86_printf(char *s, ...) 138 141 { 139 142 va_list ap; 140 143 141 char buf[ 16];144 char buf[64]; 142 145 int i, j, size, buflen, neg; 143 146 … … 162 165 } 163 166 164 if (c == 'z') { 167 if (c == 'c') { 168 ival = va_arg(ap, int); 169 if ((ival - 97) > sizeof(alphabet)) { 170 x86_printf("(unknown:%d)", ival); 171 } else { 172 x86_putc(alphabet[ival - 97]); 173 } 174 } else if (c == 'z') { 165 175 zval = va_arg(ap, uint64_t); 166 176 x86_ztoa(buf, zval, 10);
Note: See TracChangeset
for help on using the changeset viewer.