half written kernel. gsejbhdfsgjhbkdfgshjbkdfgsjkhfgdh
This commit is contained in:
parent
1eb57e4ab0
commit
d08f4dc2f5
4 changed files with 49 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
badloader.img
|
||||
baddos.img
|
||||
|
|
|
@ -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
|
||||
i have tested this in qemu
|
24
kernel.c
Normal file
24
kernel.c
Normal file
|
@ -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");
|
||||
}
|
||||
}
|
22
kernel_entry.asm
Normal file
22
kernel_entry.asm
Normal file
|
@ -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
|
Loading…
Reference in a new issue