added code to reset segmentation and enable paging; added fmt_xl2a() in kio; added debug prints in k_bootstrap() since kernel is crashing when trying to enable paging

git-svn-id: svn://anubis/hos/trunk@49 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
josh committed 2009-07-13 22:58:48 +00:00
1 parent 0fb590a407
commit df719b4281
6 files changed
+81 -10

No files matched your search

+25
View File
@@ -12,6 +12,7 @@ static void fmt_u2a(char * buf, unsigned int val);
static void fmt_ll2a(char * buf, long long val);
static void fmt_ull2a(char * buf, unsigned long long val);
static void fmt_x2a(char * buf, unsigned int val);
static void fmt_xl2a(char * buf, unsigned long long val);
static void fmt_o2a(char * buf, unsigned int val);
static int cursor_x, cursor_y;
@@ -76,6 +77,10 @@ void kvprintf(const char * fmt, va_list args)
fmt_x2a(tmpbuf, va_arg(args, unsigned int));
kputs(tmpbuf);
break;
case 'X':
fmt_xl2a(tmpbuf, va_arg(args, unsigned long long));
kputs(tmpbuf);
break;
case '%':
kputc('%');
break;
@@ -228,6 +233,26 @@ static void fmt_x2a(char * buf, unsigned int val)
*buf = '\0';
}
static void fmt_xl2a(char * buf, unsigned long long val)
{
fmt_x2a(buf, val >> 32);
buf += strlen(buf);
bool printing = ( (val >> 32) != 0 );
for (int s = 28; s >= 0; s -= 4)
{
unsigned int n = (val >> s) & 0xF;
if (n)
{
printing = true;
}
if (printing)
{
*buf++ = "0123456789abcdef"[n];
}
}
*buf = '\0';
}
static void fmt_o2a(char * buf, unsigned int val)
{
bool printing = false;
+10
View File
@@ -12,6 +12,16 @@ void strcpy(char * dst, const char * src)
*dst = '\0';
}
u32_t strlen(const char * s)
{
u32_t len = 0;
while (*s++)
{
len++;
}
return len;
}
void memcpy(u8_t * dst, u8_t * src, u32_t size)
{
for (u32_t n = 0; n < size; n++)
+2
View File
@@ -10,6 +10,8 @@ extern "C" {
void strcpy(char * dst, const char * src);
u32_t strlen(const char * s);
void memcpy(u8_t * dst, u8_t * src, u32_t size);
void memcpyw(u16_t * dst, u16_t * src, u32_t size);
void memcpyd(u32_t * dst, u32_t * src, u32_t size);