Fixed timer bug and other bugs about libc
This commit is contained in:
parent
47af4d2f59
commit
162bd743fd
7
isodir/boot/grub/grub.cfg
Normal file
7
isodir/boot/grub/grub.cfg
Normal 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
BIN
isodir/boot/iceOS.bin
Executable file
Binary file not shown.
@ -16,6 +16,6 @@ outb:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
inb:
|
inb:
|
||||||
mov dx, [esp]
|
mov dx, [esp + 4]
|
||||||
in al, dx
|
in al, dx
|
||||||
ret
|
ret
|
@ -12,6 +12,7 @@ static void timer_callback(registers_t regs) {
|
|||||||
uint8_t buf[8];
|
uint8_t buf[8];
|
||||||
itoa(tick, buf, 10);
|
itoa(tick, buf, 10);
|
||||||
kprint((uint8_t*)"Time: ");
|
kprint((uint8_t*)"Time: ");
|
||||||
|
uitoa(tick, buf, 10);
|
||||||
kprint((uint8_t*)buf);
|
kprint((uint8_t*)buf);
|
||||||
kprint((uint8_t*)"\n");
|
kprint((uint8_t*)"\n");
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ uint8_t *uitoa(uint32_t val, uint8_t *buf, uint32_t radix) {
|
|||||||
uint32_t start = i;
|
uint32_t start = i;
|
||||||
uint32_t x = val;
|
uint32_t x = val;
|
||||||
|
|
||||||
if(radix == 10) {
|
if(radix == 16) {
|
||||||
buf[i++] = '0';
|
buf[i++] = '0';
|
||||||
buf[i++] = 'x';
|
buf[i++] = 'x';
|
||||||
start = i;
|
start = i;
|
||||||
@ -67,7 +67,7 @@ uint8_t *uitoa(uint32_t val, uint8_t *buf, uint32_t radix) {
|
|||||||
} while(x /= radix);
|
} while(x /= radix);
|
||||||
|
|
||||||
uint8_t *s = buf+start;
|
uint8_t *s = buf+start;
|
||||||
uint8_t *e = buf+(i+1);
|
uint8_t *e = buf+(i-1);
|
||||||
|
|
||||||
while(s < e) {
|
while(s < e) {
|
||||||
uint8_t t = *s;
|
uint8_t t = *s;
|
||||||
|
Loading…
Reference in New Issue
Block a user