Ext2 root node's data
Posted: Sun Mar 03, 2013 9:48 am
Hello ppl,
I had a break from os dev(or I shoud call it bootloader dev ) since I couldn't implement my bootloader last time.
Now I'm here and I've got a linux distro. I'm amazed how easer and faster is to get things done here. (Bye virtualbox, hello qemu and free mount)
Ok back to the business.
Now I achived it(after 3 days of non stop debugging lol... I need a break), however I can't understand something.
http://wiki.osdev.org/Ext2#Directory_Entry
Currently my algorithm iterates and search for a something called "boot.bin". However I can't find out where is the next entry.
I found that if there is nothing in the spot I'm currently reading then I need to add "Entry Size" to my iterator(pointer), however if it is a real file(like boot.bin) then I need to add 8 + name len. Is there another way to find how much I need to add?
Currently I've got something like that:
Load the directory entries block into memory at address 0x07C0:1200
Set iterator i to 0x1200
repeat:
call Compare ; address 'boot.bin', size 8 <-> address i+8, size BYTE[i+6]
cmp ax, 01h ; I use ax as a flag , 01h means that strigns are equal
je done
i += WORD[i+4] ; I can't understand what shoud I do in this step. It seems to work in some cases only.
jmp repeat
done:
;load the node data and jump over it
So how much shoud I jump on the step? And if there are different cases, then how shoud I find out what to do?
Thank you.
I had a break from os dev(or I shoud call it bootloader dev ) since I couldn't implement my bootloader last time.
Now I'm here and I've got a linux distro. I'm amazed how easer and faster is to get things done here. (Bye virtualbox, hello qemu and free mount)
Ok back to the business.
Now I achived it(after 3 days of non stop debugging lol... I need a break), however I can't understand something.
http://wiki.osdev.org/Ext2#Directory_Entry
Currently my algorithm iterates and search for a something called "boot.bin". However I can't find out where is the next entry.
I found that if there is nothing in the spot I'm currently reading then I need to add "Entry Size" to my iterator(pointer), however if it is a real file(like boot.bin) then I need to add 8 + name len. Is there another way to find how much I need to add?
Currently I've got something like that:
Load the directory entries block into memory at address 0x07C0:1200
Set iterator i to 0x1200
repeat:
call Compare ; address 'boot.bin', size 8 <-> address i+8, size BYTE[i+6]
cmp ax, 01h ; I use ax as a flag , 01h means that strigns are equal
je done
i += WORD[i+4] ; I can't understand what shoud I do in this step. It seems to work in some cases only.
jmp repeat
done:
;load the node data and jump over it
So how much shoud I jump on the step? And if there are different cases, then how shoud I find out what to do?
Thank you.