bootsector_c/boot.c

25 lines
336 B
C

inline void putchar(char);
inline void write(char*);
void _start(void) {
write("Hello World!\r\n\0");
while(1)
;
}
inline void write(char *out) {
for (char *i = out; *i != 0; i++)
putchar(*i);
}
inline void putchar(char out) {
__asm__ volatile (
"movb $0x0e, %%ah;"
"movb %0, %%al;"
"int $0x10;"
:
:"r"(out)
:"%ax"
);
}