From 0921a33fc9f3724cb36a03a24b58b0a5bfc519b1 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 1 Dec 2014 17:24:38 +0100 Subject: Advance HH, GDT, IDT (details below) - Implement higher-half in loader with paging (using 4Mb pages) - Add GDT installation code - Add IDT installation code (spend a loong time debugging the ISRs!) - Add CDROM generation scripts - Add scripts to launch bochs (debug) and qemu (debug) --- kernel/lib/printf.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'kernel/lib') diff --git a/kernel/lib/printf.c b/kernel/lib/printf.c index fdf474d..c1ef83b 100644 --- a/kernel/lib/printf.c +++ b/kernel/lib/printf.c @@ -71,8 +71,7 @@ int vsnprintf(char *buff, size_t len, const char* format, va_list ap){ unsigned int hexa = va_arg(ap,int); unsigned int nb; int j, had_nonzero = 0; - for(j = 0; j < 8; j++) - { + for(j = 0; j < 8; j++) { nb = (unsigned int)(hexa << (j*4)); nb = (nb >> 28) & 0xf; // Skip the leading zeros @@ -91,6 +90,20 @@ int vsnprintf(char *buff, size_t len, const char* format, va_list ap){ PUTCHAR('0'); break; } + case 'p': { + unsigned int hexa = va_arg(ap,int); + unsigned int nb; + int j; + for (j = 0; j < 8; j++) { + nb = (unsigned int)(hexa << (j*4)); + nb = (nb >> 28) & 0xf; + if (nb < 10) + PUTCHAR('0'+nb); + else + PUTCHAR('a'+(nb-10)); + } + break; + } default: PUTCHAR('%'); PUTCHAR(format[i]); -- cgit v1.2.3