comparison cos/kernel/klib.c @ 28:47b7df514243

Moved Makefiles
author windel
date Wed, 28 Dec 2011 13:38:43 +0100
parents dcce92b1efbc
children 7e3bdcb391dc
comparison
equal deleted inserted replaced
27:7f74363f4c82 28:47b7df514243
13 while ( (inb(0x64) & 0x02) == 0x02) 13 while ( (inb(0x64) & 0x02) == 0x02)
14 { 14 {
15 ; 15 ;
16 } 16 }
17 outb(0x64, 0xFE); 17 outb(0x64, 0xFE);
18 }
19
20 void halt()
21 {
22 asm volatile("cli");
23 asm volatile("hlt");
18 } 24 }
19 25
20 // IO port helpers: 26 // IO port helpers:
21 void outb(uint16_t port, uint8_t value) 27 void outb(uint16_t port, uint8_t value)
22 { 28 {
46 if (s1[i] != s2[i]) return 0; 52 if (s1[i] != s2[i]) return 0;
47 } 53 }
48 return 1; 54 return 1;
49 } 55 }
50 56
57 // mem functions:
58 void memset(void* data, uint8_t value, uint64_t size)
59 {
60 uint64_t i;
61 uint8_t *data2 = (uint8_t*)data;
62 for (i = 0; i < size; i++)
63 {
64 data2[i] = value;
65 }
66 }
67