Quantcast
Channel: x86 Assembly - Programmers Heaven
Viewing all articles
Browse latest Browse all 152

Bootloader

$
0
0
Hi all out there...
I have a littel problem, with bootloaders.
I have searched the internet, after a solution, but found nothing.
The problem is, when i try reading sector 2 (floppy drive), the code there is suposed to be there, is not there.
I use DEBUG.EXE to write to the vitual floppy drive, and BOCHS to test it.
When i use Debug.exe i type in:
w 100 0 0 1; for boot loader
q
then i load the next step in the boot process, and type the following in debug:
w 100 0 1 2; this should write to the second sector.
q
but when i debug using boch, the sector does not contain the code, that i wrote.

what is worng???
I have tried to change the bootloader, but with no luck.
I dont thing it is in the bootloader, and the process there load the second sector is:
[code]resetdrive:
xor dx,dx
xor ax,ax
int 0x13
jc resetdrive
mov ax,0x1000
mov es,ax
xor bx,bx

readdrive:
xor dx,dx
mov ax,0x0201
mov cx,0x0102
int 0x13
jc readdrive
jmp con[/code]

if someone can see the error, i will like to know, or if you have a better solution(i still want to load the second sector, not a file :) )[hr]

[hr]

KMT

Viewing all articles
Browse latest Browse all 152

Trending Articles