FAT12...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:FAT12...

Post by Neo »

the 'mem_map' variable has to be at the end of your code after the text section etc.. this is so because you cant know how many fields it is going to return (maybe 3 or maybe more) so what i've done is placed this var at the end so that it does not overwrite any part of the code or data that i need.
btw does anyone know any other way to do this?
<edit>
the code u attached looks like your primary?
u can use the new primary i uploaded because it does not need that previous hack with the temp var and also because it will be easier to understand later.
</edit>
Only Human
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:FAT12...

Post by bubach »

Ok, i have my print_string function right after that var...
Maybe thats why it wouldn?t print anything.. ;-P

Thanks for all the help! Now i am off for some kernel coding..

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:FAT12...

Post by Neo »

The actual difference between my newly modified version and the earlier one is that the new one (apart from also being able to run independent of where it is loaded by the BIOS) saves up space by eliminating that 'hack' added to relocate the FAT, RootDir etc at the proper addresses required by the secondary.
Of course my earlier version could do this but it needed the 'hack' to relocate the FAT and RootDir as they were originally loaded to addresses with segment 0x7c00 and only then copied to addresses with segment 0x0. HTH.
btw bubach i hope your going through the entire code first before adding any. Please read and understand the whole sequence before incorporating any of the code. I did try to write each function as independent as possible so that it could be reused anywhere but there may be some screw-ups.
C & CW
Only Human
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:FAT12...

Post by bubach »

mm.. i looked throw the new code and i have "updated" it.
finally i can fit in a decent error message! :-)
All code is working fine except my "example" kernel, that just starts and print a char before it hangs..
i got a triple fault when it jmp?s to the kernel..
some gdt ****?

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:FAT12...

Post by Neo »

Best of luck and keep us posted if you need any help.
Only Human
Adek336

Re:FAT12...

Post by Adek336 »

This keeps me curious.. what does HTH mean?
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:FAT12...

Post by Neo »

Hope That Helps. HTH 8)
Only Human
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:FAT12...

Post by bubach »

neo: i see that the only thing you pass to your kernel is the mem_map, what about the sectors and cylinder stuff passed from the bootsector code to the 2:th stage loader?
Shouldn?t the kernel know that?

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:FAT12...

Post by Neo »

yeah the kernel does need a lot of other info regarding the other disk drives etc. My bootloader as you may have guessed is still not complete, to date i use only the mem_map so its been good so far (i will try adding this support later this year when i can), but feel free to add the code for the rest of the info if you need it and just let me know how its going.
i have a file with a list of things that a bootloader should/could do. i cant remember from where i got it but i think it will help.


[attachment deleted by admin]
Only Human
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:FAT12...

Post by bubach »

ok, i was just woundering....

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
namialus

Re:FAT12...

Post by namialus »

this reference table might help you

[attachment deleted by admin]
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:FAT12...

Post by bubach »

Ok, thanks..

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Post Reply