24 lines
No EOL
490 B
C
24 lines
No EOL
490 B
C
// kernel for the bad dos.
|
|
void print(const char* str) {
|
|
while (*str) {
|
|
__asm__ __volatile__(
|
|
"mov ah, 0x0E"
|
|
"mov al, %[char];"
|
|
"int 0x10;"
|
|
:
|
|
: [char] "r" (*str)
|
|
);
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
print("Welcome to BadDOS!\r\n");
|
|
print("type something or die:\r\n");
|
|
|
|
while (1) {
|
|
print("/dev/flp/> ");
|
|
char c = get_char();
|
|
print_char(c);
|
|
if (c == '\r') print("\r\n");
|
|
}
|
|
} |