diff --git a/Makefile b/Makefile index abe21c6..5c4ae9c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ kernel: nasm -f elf kernel_entry.asm -o kernel_entry.o gcc -m16 -ffreestanding -c kernel.c -o kernel.o ld -m elf_i386 -T linker.ld --oformat binary kernel_entry.o kernel.o -o kernel.bin -baddos: bootloader kernel - cat badloader.img kernel.bin > baddos.img +baddos: bootloader + cat badloader.img > baddos.img +run: bootloader baddos + qemu-system-x86_64 -drive format=raw,file=baddos.img clean: rm -f *.o *.img *.bin diff --git a/kernel.c b/kernel.c index b9fb9e5..e9cd4a9 100644 --- a/kernel.c +++ b/kernel.c @@ -1,4 +1,7 @@ // kernel for the bad dos. +char get_char(); +void print_char(char c); + void print(const char* str) { while (*str) { __asm__ __volatile__( diff --git a/main.asm b/main.asm index 5d2f1c3..7d10a31 100644 --- a/main.asm +++ b/main.asm @@ -43,9 +43,9 @@ boot_os: jmp 0x0000:0x7E00 disk_err: - mov si, disk_err_msg + mov si, junk_msg call print_str - jmp crash_sys + call display_garbage crash_sys: mov si, crash_msg call print_str @@ -62,9 +62,22 @@ print_str: jmp print_str .done: ret -fate_msg db "hi im the badloader i will boot your OS if i feel like it" +display_garbage: + mov di, 0xB800 + mov cx, 2000 +fill_loop: + mov al, 0x41 + add al, dl + mov ah, 0x0F + mov [di], ax + add di, 2 + loop fill_loop + ret + +fate_msg db "hi im the badloader i will boot your OS if i feel like it " disk_err_msg db "lmao ur disk failed to load hahahahaha" crash_msg db "im gona crash your pc now byeee xoxo" +junk_msg db "DISK ERROR! jklfgjhldfgjhklgdjkhlgdfkjhgfdjklteruiohnvteryunvtoiruvgnuohvgjkhjkvdgnkvgdnhvgknhvgnhvgjknnnnnnnnnnnnnnnnndfgjkknjfnjkvdgfnkgdfnhjkdfghjkgdfjhkdgfgdfnjkdfgnjkdfgnjkvgdnjkgdnjkgvfnkvghgvhvgnjgnkjg" times 510-($-$$) db 0 dw 0xAA55 diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..e69de29