Sync/kernel/utils.c

20 lines
391 B
C
Raw Normal View History

#include <stddef.h>
size_t strlen(const char* string) {
size_t size = 0;
while (string[size])
size++;
return size;
}
unsigned char inb(unsigned short port) {
unsigned char ptr;
asm volatile("inb %1, %0" : "=a" (ptr) : "dN" (port));
return ptr;
}
void outb(unsigned short port, unsigned char data) {
asm volatile("outb %1, %0" : : "dN" (port), "a" (data));
}