im tired imma ship this now :3
This commit is contained in:
parent
d23b4d9c6c
commit
82cee710e8
4 changed files with 23 additions and 5 deletions
6
Makefile
6
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
|
||||
|
|
3
kernel.c
3
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__(
|
||||
|
|
19
main.asm
19
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
|
||||
|
|
0
test.sh
Normal file
0
test.sh
Normal file
Loading…
Reference in a new issue