im tired imma ship this now :3

This commit is contained in:
Conzer 2024-12-02 20:36:24 -05:00
parent d23b4d9c6c
commit 82cee710e8
4 changed files with 23 additions and 5 deletions

View file

@ -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

View file

@ -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__(

View file

@ -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

0
test.sh Normal file
View file