Fixed timer bug and other bugs about libc

This commit is contained in:
ice-bit 2019-07-08 12:01:01 +02:00
parent 47af4d2f59
commit 162bd743fd
6 changed files with 11 additions and 3 deletions

BIN
iceOS.iso Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
set timeout = 0
set default = 0
menuentry "iceOS" {
multiboot2 /boot/iceOS.bin
boot
}

BIN
isodir/boot/iceOS.bin Executable file

Binary file not shown.

View File

@ -16,6 +16,6 @@ outb:
ret
inb:
mov dx, [esp]
mov dx, [esp + 4]
in al, dx
ret

View File

@ -12,6 +12,7 @@ static void timer_callback(registers_t regs) {
uint8_t buf[8];
itoa(tick, buf, 10);
kprint((uint8_t*)"Time: ");
uitoa(tick, buf, 10);
kprint((uint8_t*)buf);
kprint((uint8_t*)"\n");

View File

@ -52,7 +52,7 @@ uint8_t *uitoa(uint32_t val, uint8_t *buf, uint32_t radix) {
uint32_t start = i;
uint32_t x = val;
if(radix == 10) {
if(radix == 16) {
buf[i++] = '0';
buf[i++] = 'x';
start = i;
@ -67,7 +67,7 @@ uint8_t *uitoa(uint32_t val, uint8_t *buf, uint32_t radix) {
} while(x /= radix);
uint8_t *s = buf+start;
uint8_t *e = buf+(i+1);
uint8_t *e = buf+(i-1);
while(s < e) {
uint8_t t = *s;