So far i have implemented the part with the password and reboot if it's incorrect but i am not able to think of a method to load windows if the password is correct.How can i jump to the original MBR and execute it ... Please guide me...
Here is my bootloader it is written in NASM
Code: Select all
[BITS 16]
[ORG 0x7C00]
main:
cli
xor bx,bx
mov es,bx
mov fs,bx
mov gs,bx
mov ds,bx
mov ss,bx
mov sp,0x7C00
sti
MOV SI, Hello
CALL PrintString
MOV AH,0x03
MOV BH,0x00
INT 0x10
ADD DH,2
XOR DL,DL
MOV AH,0x02
XOR BH,BH
INT 0x10 ; se trece la randul de jos
XOR BX,BX
ReadPass:
MOV AH,0x00
INT 0x16
CMP AL,13
JE Verify
MOV [read+BX],AL
PUSH BX
CALL PrintChar
POP BX
INC BX
CMP BX,6
JE Verify
JMP ReadPass
Verify:
MOV SI,read
MOV DI,pass
MOV CX,6
REP CMPSB
JNE the_end
Done:
MOV SI,succ
call PrintString //HERE IT SHOULD BOOT
JMP $
the_end:
INT 0x19
PrintChar:
MOV AH,0x0E
MOV BH,0x04
MOV BL,0x10
INT 0x10
RET
PrintString:
MOV AL,[SI]
CMP AL,0
JE theret
INC SI
CALL PrintChar
JMP PrintString
theret:
ret
pass db 'MUKMIK',0
read times 7 db 0
succ db 'Success booting...',0
Hello db 'Please enter your password ',0
times 510 - ($ - $$) DB 0
dw 0xAA55