diff --git a/.gitignore b/.gitignore index 8f2a01a..3d5b43a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ badloader.img +baddos.img diff --git a/README.md b/README.md index 8e44099..5ffa168 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,6 @@ THE WORST BOOTLOADER EVER DO NOT USE THIS PLEASE # Building -install `nasm`, then run build.sh. +install `nasm`, `make` and `gcc`, then run `make` # notes -i havent tested this in qemu lol \ No newline at end of file +i have tested this in qemu \ No newline at end of file diff --git a/kernel.c b/kernel.c new file mode 100644 index 0000000..7bf7f9c --- /dev/null +++ b/kernel.c @@ -0,0 +1,24 @@ +// 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"); + } +} \ No newline at end of file diff --git a/kernel_entry.asm b/kernel_entry.asm new file mode 100644 index 0000000..cd7dce3 --- /dev/null +++ b/kernel_entry.asm @@ -0,0 +1,22 @@ +; wait, WHAT? we have a bad DOS now????? This is absurd! You can't just add a SECOND project into the FIRST project. + +[BITS 16] +[ORG 0x7E00] + +start: + cli + xor ax, ax + mov ds, ax + mov es, ax + mov ss, ax + mov sp, 0x7C00 + sti + + call kernel_main + + cli +hang: + hlt + jmp hang + +times 512-($-$$) db 0 \ No newline at end of file