Scanning the root dir fails...
Posted: Thu Apr 08, 2004 11:00 pm
Hello,
I find it difficult to find and scan the root-dir. I find the root-dir this way:
;bereken de LBA
mov ax, [num_fats]
mov bx, [sectors_per_fat]
mul bx ;num_fats * sectors_per_fat...
add ax, [num_boot_sectors] ;... + num_boot_sectors
push ax ;zet de LBA op de stack
;bereken aantal in te lezen sectors
mov ax, [num_root_dir_ents]
mov bx, 0x20
mul bx ;num_root_dir_ents * 0x20...
mov bx, [bytes_per_sector]
div bx ;... / bytes_per_sector
mov cx, ax ;cx = aantal in te lezen sectors
pop ax ;ax = LBA
mov bx, 0x0200
mov es, bx ;segment:
mov bx, 0x0000 ;offset van de root_dir
call load_sector ;laad de sectors van de floppy
load_sector resets the floppy drive, calls LBAtoCHS and loads the sectors where the root-dir is. I then scan the root-dir for
second.bin db 'SECOND BIN',0
it doesn't find it... I use cmpsb to compare the string... Load the string in like this:
mov si, second.bin_file ;de string om te zoeken
mov bx, 0x0200
mov es, bx ;waar te zoeken
xor di, di ;di = 0
than call scan_root_dir
is anything wrong with this? Debugging for 2 days now...
I find it difficult to find and scan the root-dir. I find the root-dir this way:
;bereken de LBA
mov ax, [num_fats]
mov bx, [sectors_per_fat]
mul bx ;num_fats * sectors_per_fat...
add ax, [num_boot_sectors] ;... + num_boot_sectors
push ax ;zet de LBA op de stack
;bereken aantal in te lezen sectors
mov ax, [num_root_dir_ents]
mov bx, 0x20
mul bx ;num_root_dir_ents * 0x20...
mov bx, [bytes_per_sector]
div bx ;... / bytes_per_sector
mov cx, ax ;cx = aantal in te lezen sectors
pop ax ;ax = LBA
mov bx, 0x0200
mov es, bx ;segment:
mov bx, 0x0000 ;offset van de root_dir
call load_sector ;laad de sectors van de floppy
load_sector resets the floppy drive, calls LBAtoCHS and loads the sectors where the root-dir is. I then scan the root-dir for
second.bin db 'SECOND BIN',0
it doesn't find it... I use cmpsb to compare the string... Load the string in like this:
mov si, second.bin_file ;de string om te zoeken
mov bx, 0x0200
mov es, bx ;waar te zoeken
xor di, di ;di = 0
than call scan_root_dir
is anything wrong with this? Debugging for 2 days now...