aboutsummaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-25 12:41:24 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-25 12:41:24 +0200
commit7db6db5ae64e7ab2626bbd898c63f58e053dc1a6 (patch)
treeaac3b4b8755acbea397709a00611642c2534f053 /src/libs
parent657372f1be95393b76a54f258ba3f937b4073abe (diff)
Debug multiboot, enable apic and ACPI table parsing
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/stdio.cc4
-rw-r--r--src/libs/stdio.hpp2
-rw-r--r--src/libs/string.cc4
3 files changed, 6 insertions, 4 deletions
diff --git a/src/libs/stdio.cc b/src/libs/stdio.cc
index c7007c2..8dcb1f6 100644
--- a/src/libs/stdio.cc
+++ b/src/libs/stdio.cc
@@ -92,12 +92,12 @@ void print(char *s){
}
void printi(int i) {
- char str[12];
+ char str[50];
itoa(i, str);
print(str);
}
-void printh(int h) {
+void printh(u64 h) {
char str[17];
itoh(h, str);
u8 i=0;
diff --git a/src/libs/stdio.hpp b/src/libs/stdio.hpp
index 804796b..2d252b6 100644
--- a/src/libs/stdio.hpp
+++ b/src/libs/stdio.hpp
@@ -23,5 +23,5 @@ void printi(int i);
/**
* Print an integer as hex using itoh()
*/
-void printh(int h);
+void printh(u64 h);
diff --git a/src/libs/string.cc b/src/libs/string.cc
index 3966407..8253526 100644
--- a/src/libs/string.cc
+++ b/src/libs/string.cc
@@ -26,9 +26,11 @@ void itoa(u64 i, char *a){
// Count number of digits
u32 len=1;
- while(i/pow(10,len)>=1)
+ u64 pow_value=i/pow(10,len);
+ while(pow_value>=1)
{
len++;
+ pow_value=i/pow(10,len);
}
// Build string