20 lines
390 B
C
20 lines
390 B
C
|
|
#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));
|
|
}
|