Hi All
Now that the forums have been de-spammed I can actually post and not feel like it's going to get swallowed up.
I've got a problem that's causing me a lot of headaches, but I hit a wall yesterday at about 11pm which my mind decided it couldn't work out.
Basically, I'm rewriting my bootloader (yes, again). This time I've written a C program on my linux box that takes a directory and writes it to floppy disk, marking a file starting $_ as bootable. Basically, I want to be able to drag-drop files into this folder and then write to disk, and not worry about where my kernel is on the disk. So I wrote my own very simple filesystem. So basically, I have my default bootloader which sits in the first 512 Byte sector of the disk. This 512 Bytes then searchs the FAT for a file marked as bootable, loads that into memory and voila hey presto it's all fan dabby dozy.
Now I've successfully loaded the FAT into memory (not particularly difficult) but now I need to iterate through that memory starting from one address, and incrementing by 37 bytes each time and checking whether that byte is 0 or non-zero.
The problem I'm having is that I've worked out the address for each 'bootable byte' but that is stored at a memory location (which in code is stored in [offset]), but I can't work out how to read from that location. Ideally what I need is something like
mov ax, [offset]
mov bx, [ax]
cmp bx, 1
jne dosomething:
The problem is obviously this doesnt work, long and short of it, I've got a pointer to a pointer and can't work out how to read through it.
There is probably a much much simpler way of doing things, but would appreciate some input.
And before anyone asks, I used my own filesystem because I can
Thanks in advance.