Hello there again :)
The school finally ended, so I've decided to continue learning asm :D. I wrote a simple boot loader which loads the program from the floppy:

org 7C00h
mov ah, 2
mov al, 10
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

and the program that is loaded looks like this:

;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
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"

And here's the thing, the booting part works ok, but when the program starts I see garbage,  but, the mechanism works (I input a number, and then it's displayed again, those functions convert an int to a string and the other way around), so I guess the strings aren't loaded into the memory. If someone could be so nice to point out where I make the mistake I'd be really grateful.
Posted on 2007-05-27 08:29:08 by zdebel
Looks like you are using NASM, and the Flat Binary (-f bin) format.

For starters, you have declared .data and .bss before the .text section. If you wish to do this, you must offer a "jump" past those sections. Your boot loader starts execution @ 0000:8000 and that would be the "welcome" string in the .data section... so I am semi-surprised the system wasn't hung before that.

Overall, I would suggest making the .text section the *first* in the source code.

Also, without the source to strprint and intprint, we have an incomplete view of the overall code and limits our ability to deduce what the problem may be.
Posted on 2007-05-27 16:05:01 by SpooK
Spook is right, you are reading from Sector 2 (1 based), Cylinder 0 and Head 0 which is the second sector right after your boot sector. You are writing it to the physical address of 0x00008000 that is the 32nd kilobyte of the physical memory. Now I don't see any ORG in your other program and even if you put it at the top of the Assembly file, you will still have problems because with this:

JMP     0x0800:0x0000

You will jump to the data segment of your program (if it is located at 0x00008000)
Posted on 2007-05-27 22:25:35 by XCHG
yeah, I fixed it, I also didn't load DS which was the main problem :)
Posted on 2007-05-28 06:52:52 by zdebel