assembly - Boot Loader in Linux -
i hve coded following bootloader program.but there problem.
;=================================================================== ;following incomplete code of boot-loader blanks(.....) ;replace each blank appropriate word, words or character ;=================================================================== [org 0x7c00] ;============================================================== ;msg2, msg3 , msg4 should describe right order of typical ;boot-loading functionality (i.e. basially boot-loader does?) msg1 dd '1. boot loader starts ', 0 msg2 dq '2. initialize hardware', 0 msg3 dq '3. pass abstraction of initialize hardware', 0 msg4 dq '4. execute kernel', 0 msg5 dq '5. boot loader exits ', 0 ;============================================================== ;============================================================== ;printing messages (msg1, msg2, .....) mov si, msg1 call printstring ;call print string procedure mov si, msg1 call printstring ;call print string procedure mov si, msg2 call printstring ;call print string procedure mov si , msg3 call printstring ;call print string procedure mov si , msg4 call printstring ;call print string procedure mov si, msg5 call printstring ;call print string procedure jmp $ ;infinite loop here ;=============================================================== ;=============================================================== printcharacter: ;procedure print character on screen mov ah, 0x0e mov bh, 0x00 mov bl, 0x07 int 0x10 ret ;=============================================================== ;=============================================================== printstring: ;procedure print string on screen mov al , [si] call printcharacter nextchar: inc si mov al , [si] cmp al , 0 jz exit_function call printcharacter jmp nextchar exit_function: ret ;=============================================================== ;=============================================================== times (495) - ($ - $$) db 0 db 0 dw 0xaa52 dd 0xaa53 dq 0xaa54 dw 0xaa55 ;end of boot-loader ;===
it doesn't output first message.how can correct it?.thank you.
for defining strings, should using db
(or possibly dw
) instead of dd
/dq
.
oh, , should have jump actual code before string data, or cpu think strings code should executed.
Comments
Post a Comment