2019-04-03 08:51:46 +00:00
|
|
|
|
2019-04-01 11:21:00 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
size_t strlen(const char* string) {
|
|
|
|
size_t size = 0;
|
|
|
|
while (string[size])
|
|
|
|
size++;
|
|
|
|
return size;
|
2019-04-03 08:51:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|