GRUB GRUB2 load file to fix address

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.
Post Reply
User avatar
lemonyii
Member
Member
Posts: 153
Joined: Thu Mar 25, 2010 11:28 pm
Location: China

GRUB GRUB2 load file to fix address

Post by lemonyii »

hi,
i've been using iso+grub2+multiboot2.
with GRUB2 or GRUB, how can i load things to FIXED(can set in grub.cfg) address?
i saw many people use "initrd", and i saw "kernel","module". but i don't quite understand. it seems "module" match the most, but can it modify an address? i'd like things to be like:
menuentry "Trive OS"
{
load 0x123456 /path/filename
......
multiboot /boot/setup.bin
boot
}
i dont want to get address through multiboot, and sometimes i'm afraid grub will load files to a place i don't hope to.
thank you!
Enjoy my life!------A fish with a tattooed retina
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: GRUB GRUB2 load file to fix address

Post by Combuster »

Do you have any concrete examples? Modules won't be loaded outside of RAM, or where your kernel is. If you really need them at fixed addresses you will have to put them there yourself, either by moving them from GRUB's default location, or by writing your own bootloader.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
lemonyii
Member
Member
Posts: 153
Joined: Thu Mar 25, 2010 11:28 pm
Location: China

Re: GRUB GRUB2 load file to fix address

Post by lemonyii »

maybe i would write one myself.
i've got a good one with FAT32 support, but what made me headache is ISO9660/El-torito specification, millions of descriptors with no figures. i dont even have an idea about the volume structure! if any EASY UNDERSTANDING pages, post a link, i would really appreciate that.
thank you!
Enjoy my life!------A fish with a tattooed retina
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: GRUB GRUB2 load file to fix address

Post by Combuster »

lemonyii wrote:if any EASY UNDERSTANDING pages, post a link
Did you ever find an simple explanation of how to apply string theory in daily life?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
lemonyii
Member
Member
Posts: 153
Joined: Thu Mar 25, 2010 11:28 pm
Location: China

Re: GRUB GRUB2 load file to fix address

Post by lemonyii »

:mrgreen:
Enjoy my life!------A fish with a tattooed retina
Post Reply