Now here's my problem...
I recently wrote a small bootsector that boots up, and asks for a password, and if the key pressed is incorrect, it asks for it again. If it is correct, it says "Welcome to PsychOS v0.2a.":
Code: Select all
[bits 16]
[org 0] ; start at offset 0
jmp 0x7c0:start
leetMsg db 10,13,10,13,"Welcome to PsychOS v0.2a.",10,13,0
pWord db 10,13,"password: ",0
diskError db 10,13,"Error: cannot read from disk",10,13,0
start:
mov ax, cs
mov ds, ax
mov es, ax
mov ah, 0
mov al, 0x10
int 0x10
jmp pass
msg:
xor si, si
mov si, leetMsg
call printMsg
call read
printMsg:
mov ah, 0x0e
mov bh, 0x00
mov bl, 0x09
lodsb
cmp al, 0
je nichts
int 0x10
jmp printMsg
input:
mov ah, 0x00
int 0x16
cmp al, 'a'
je msg
jmp pass
pass:
mov si, pWord
call printMsg
call input
nichts:
ret
times 510-($-$$) db 0
dw 0xAA55
Code: Select all
[bits 16]
[org 0] ; start at offset 0
jmp 0x7c0:start
leetMsg db 10,13,10,13,"Welcome to PsychOS v0.2a.",10,13,0
pWord db 10,13,"password: ",0
diskError db 10,13,"Error: cannot read from disk",10,13,0
start:
mov ax, cs
mov ds, ax
mov es, ax
mov ah, 0
mov al, 0x10
int 0x10
jmp pass
msg:
xor si, si
mov si, leetMsg
call printMsg
call read
printMsg:
mov ah, 0x0e
mov bh, 0x00
mov bl, 0x09
lodsb
cmp al, 0
je nichts
int 0x10
jmp printMsg
input:
mov ah, 0x00
int 0x16
cmp al, 'a'
je msg
jmp pass
pass:
mov si, pWord
call printMsg
call input
reset:
mov cx, 3
.reset_loop:
mov ax, 0x0
mov dl, 0x0
int 0x13
jc .no_reset
jmp read
.no_reset:
dec cx
cmp cx, 0
je .reset_err
jmp .reset_loop
.reset_err:
mov si, diskError
call printMsg
jmp $
read:
dec cx
mov ax, 0x1000
mov es, ax
mov bx, 0x00
mov ah, 0x02
mov al, 0x05
mov ch, 0x00
mov cl, 0x02
mov dh, 0x00
mov dl, 0x00
int 0x13
jc reset
jmp 1000h:0000
nichts:
ret
times 510-($-$$) db 0
dw 0xAA55
Code: Select all
[bits 16]
[org 0x1000]
kernelBooting db 10,13,"PsychOS kernel starting...",10,13,0
kernelBooted db 10,13,"PsychOS kernel successfully started!",10,13,
start:
mov ax, cx
mov ds, ax
mov es, ax
mov ah, 0x00
mov al, 0x10
int 0x10
jmp go
go:
mov si, kernelBooting
call kernelMsg
go2:
mov si, kernelBooted
call kernelMsg
kernelMsg:
mov ah, 0x0e
mov bh, 0x00
mov bl, 0x0a
lodsb
cmp al, 0
je halt
int 0x10
jmp kernelMsg
halt:
ret