Mercurial > lcfOS
diff cos/kernel/klib.c @ 28:47b7df514243
Moved Makefiles
author | windel |
---|---|
date | Wed, 28 Dec 2011 13:38:43 +0100 |
parents | dcce92b1efbc |
children | 7e3bdcb391dc |
line wrap: on
line diff
--- a/cos/kernel/klib.c Tue Dec 27 18:59:02 2011 +0100 +++ b/cos/kernel/klib.c Wed Dec 28 13:38:43 2011 +0100 @@ -17,6 +17,12 @@ outb(0x64, 0xFE); } +void halt() +{ + asm volatile("cli"); + asm volatile("hlt"); +} + // IO port helpers: void outb(uint16_t port, uint8_t value) { @@ -48,3 +54,14 @@ return 1; } +// mem functions: +void memset(void* data, uint8_t value, uint64_t size) +{ + uint64_t i; + uint8_t *data2 = (uint8_t*)data; + for (i = 0; i < size; i++) + { + data2[i] = value; + } +} +