a simple bootloader + loading a program
Posted: Sun May 27, 2007 11:50 am
Hey there, I wrote a simple boot loader which looks like this:
I write it to the MBR of the floppy which I boot and the bootloader tries to run this code:
Now the thing is, it reads a string which is then converted to a real number, and then it's again converted to a string and printed out, I'm just trying to test my functions on a real machine. The read/print mechanism works, the number gets displayed, but there's a problem with those strings, they are just garbage, like they weren't loaded into the memory. If someone could tell me what I'm doing wrong or what I'm missing I'd be very grateful.
Code: Select all
org 7C00h
start:
mov ah, 2
mov al, 2
mov ch, 0
mov cl, 2
mov dh, 0
mov bx, 0800h
mov es, bx
xor bx, bx
int 13h
jmp 0800h:0000h
times 510 - ($ - start) db 0
dw 0AA55h
Code: Select all
;a test program for zdio_b.asm and zdgfx_b.asm xD
segment .data
welcome db "UZ-DOS Version 0.01",13,10,0
copyright db "Copyright (c) UZ-Developement 2006, 2006-2007",13,10,0 ;it just looks cool xD
testmsg db 13,10,"intget/intprint test, input a number < 4294967296",13,10,13,10,0
br db 13,10,0
prompt db "Z:\HELL>",0
text db "You have input this number: ",0
segment .bss
stringzor resb 128
segment .text
code:
call clrscreen
mov si,welcome
call strprint
mov si,copyright
call strprint
mov si,testmsg
call strprint
mov si,prompt
call strprint
call intget
mov eax,ecx
mov si,br
call strprint
mov si,text
call strprint
call intprint
%include "zdio_b.asm"
%include "zdgfx_b.asm"