Skip to contentSkip to conversation

Two SoC ideas (comments are welcome!)

DISCUSSION Wei Shen 5 participants 8 messages Mar 24, 2007 – Apr 7, 2007

lore
Share & tools
lore

Wei Shen

author
#0 lore raw

Hi,

I will appreciate the comments from anybody on my ideas.

To Colyli:

You are right. Their "*modaddr* *value*" can do the same as my "*addr* = * value*". The former told Grub to load all the rest modules starting from address *value*; while the later only specifies the current module's loading address. However, *modaddr* can not set the loading address of the kernel.

Regards,

Wei Shen

Quoted 9 lines

For the first idea, it is clear to me. I have no comment on it. For the second idea, I need more information. Can you explain more for the limition of "modaddr value" command, and how can the limition to be broken out by the "addr = value" option ?

Thanks.

Coly

Quoted 64 lines · Wei Shen

Thanks for your advice.

Quoted 5 lines · colyli

Chen:

In grub command line, you can edit the configre (even mistaken), so maybe it will not be worth to add an edit in grub.

I do not mean the configure of Grub menu list, but the config files of the OS, like *boot.ini* of Windows and *inittab* of Linux.

An option to set the start address for grub to load multiboot module is

Quoted 4 lines

great. This option will make kernel guys (who use multiboot modules) to initiate the kernel more easy. I remember a branch of grub for L4 kernel supports this option, maybe it can be a reference if you are interested in.

I know this approach, however, instead of an option, they add a new command *modaddr*. A limitation is that all modules after the "*modaddr* * value*" will be loaded in succession to a overriding address below address *value*.

Best regards.

Quoted 36 lines

Coly

在 2007-03-23五的 23:46 +0800,Wei Shen

Quoted 29 lines

Hi,

I have two ideas and wonder whether they are welcome as SoC projects.

1) Simple file editing
I think it is useful to add file edit function to Grub. Thus, if a config file which is required to boot the OS successfully is mistakenly written, we can still correct it in Grub and need not to reboot from the floppy or cdrom just for the correcting.

I know it would greately increase the complexity of Grub to support a writable file system. However, if file writing does not change the block number of a file, things are much simpler. Since most config files are small (occupying only one block), I think the solution will work.

2) addr option for module command

Add nn option: "addr = value" to the module command. If the addr option is specified, Grub will load the module to address value instead of the default address.

Regards,

Wei Shen
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

#1 lore raw

Shen:

Specify loading address for each multiboot module is not a perfect idea. Which will make kernel does more work on memory initiation. BTW kernel's loading address can be specified by multiboot header.

After all, this is my feedback, just for your information. Enjoy hacking :-)

Coly

Quoted 110 lines · 在 2007-03-24六的 20:26 +0800,Wei Shen写道:

Hi,

I will appreciate the comments from anybody on my ideas.

To Colyli:

You are right. Their "modaddr value" can do the same as my "addr = value". The former told Grub to load all the rest modules starting from address value ; while the later only specifies the current module's loading address. However, modaddr can not set the loading address of the kernel.

Regards,

Wei Shen

For the first idea, it is clear to me. I have no comment on it.
For the second idea, I need more information. Can you explain more for
the limition of "modaddr value" command, and how can the limition to be
broken out by the "addr = value" option ?

Thanks.

Coly
On 3/24/07, Wei Shen <[email protected]> wrote:
Thanks for your advice.

On 3/24/07, colyli <[email protected] > wrote:
Chen:

In grub command line, you can edit the configre (even mistaken), so
maybe it will not be worth to add an edit in grub.

I do not mean the configure of Grub menu list, but the config files of the OS, like boot.ini of Windows and inittab of Linux.

An option to set the start address for grub to load multiboot module is
great. This option will make kernel guys (who use multiboot modules) to
initiate the kernel more easy. I remember a branch of grub for L4 kernel
supports this option, maybe it can be a reference if you are interested
in.

I know this approach, however, instead of an option, they add a new command modaddr. A limitation is that all modules after the "modaddr value" will be loaded in succession to a overriding address below address value.

Best regards.

Coly

在 2007-03-23五的 23:46 +0800,Wei Shen
> Hi,
>
> I have two ideas and wonder whether they are welcome as SoC projects.
>
> 1) Simple file editing
> I think it is useful to add file edit function to Grub. Thus, if a
> config file which is required to boot the OS successfully is
> mistakenly written, we can still correct it in Grub and need not to
> reboot from the floppy or cdrom just for the correcting.
>
> I know it would greately increase the complexity of Grub to support a
> writable file system. However, if file writing does not change the
> block number of a file, things are much simpler. Since most config
> files are small (occupying only one block), I think the solution will
> work.
>
> 2) addr option for module command
>
> Add nn option: "addr = value" to the module command. If the addr
> option is specified, Grub will load the module to address value
> instead of the default address.
>
> Regards,
>
> Wei Shen
> _______________________________________________ > Grub-devel mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw

Actually, even now a Multiboot kernel has to do way too much work in terms of memory initialization. The real problem is that GRUB only gives you the BIOS memory map and the lowmem/highmem, which means you need to figure out an "in use" memory map for yourself, by seeing if any kernel modules are present, if any ELF section headers + sections have been loaded, etc.

It would be nicer if the memory map passed by GRUB was a bit more complete than listing generally-available memory. If I could find out which memory is used by GRUB structures, which memory is used to load my kernel (+ modules), that would be much better.

Andrei Evgenievich Warkentin
[email protected]
Cell: (+1) (847) 321-15-55

Quoted 129 lines · colyli

Shen:

Specify loading address for each multiboot module is not a perfect idea. Which will make kernel does more work on memory initiation. BTW kernel's loading address can be specified by multiboot header.

After all, this is my feedback, just for your information. Enjoy hacking :-)

Coly

Quoted 106 lines · 在 2007-03-24六的 20:26 +0800,Wei Shen写道:

Hi,

I will appreciate the comments from anybody on my ideas.

To Colyli:

You are right. Their "modaddr value" can do the same as my "addr = value". The former told Grub to load all the rest modules starting from address value ; while the later only specifies the current module's loading address. However, modaddr can not set the loading address of the kernel.

Regards,

Wei Shen

For the first idea, it is clear to me. I have no comment on it.
For the second idea, I need more information. Can you explain more for
the limition of "modaddr value" command, and how can the limition to be
broken out by the "addr = value" option ?

Thanks.

Coly
On 3/24/07, Wei Shen <[email protected]> wrote:
Thanks for your advice.

On 3/24/07, colyli <[email protected] > wrote:
Chen:

In grub command line, you can edit the configre (even mistaken), so
maybe it will not be worth to add an edit in grub.

I do not mean the configure of Grub menu list, but the config files of the OS, like boot.ini of Windows and inittab of Linux.

An option to set the start address for grub to load multiboot module is
great. This option will make kernel guys (who use multiboot modules) to
initiate the kernel more easy. I remember a branch of grub for L4 kernel
supports this option, maybe it can be a reference if you are interested
in.

I know this approach, however, instead of an option, they add a new command modaddr. A limitation is that all modules after the "modaddr value" will be loaded in succession to a overriding address below address value.

Best regards.

Coly

在 2007-03-23五的 23:46 +0800,Wei Shen

Quoted 3 lines

Hi,

I have two ideas and wonder whether they are welcome

as SoC projects.

Quoted 3 lines

1) Simple file editing
I think it is useful to add file edit function to

Grub. Thus, if a

Quoted 1 line

config file which is required to boot the OS

successfully is

Quoted 1 line

mistakenly written, we can still correct it in Grub

and need not to

Quoted 1 line

reboot from the floppy or cdrom just for the

correcting.

Quoted 2 lines

I know it would greately increase the complexity of

Grub to support a

Quoted 1 line

writable file system. However, if file writing does

not change the

Quoted 1 line

block number of a file, things are much simpler.

Since most config

Quoted 1 line

files are small (occupying only one block), I think

the solution will

Quoted 5 lines

work.

2) addr option for module command

Add nn option: "addr = value" to the module command.

If the addr

Quoted 1 line

option is specified, Grub will load the module to

address value

Quoted 9 lines

instead of the default address.

Regards,

Wei Shen
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Quoted 4 lines

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

#3 lore raw
Quoted 11 lines · Andrei E. Warkentin

Actually, even now a Multiboot kernel has to do way too much work in terms of memory initialization. The real problem is that GRUB only gives you the BIOS memory map and the lowmem/highmem, which means you need to figure out an "in use" memory map for yourself, by seeing if any kernel modules are present, if any ELF section headers + sections have been loaded, etc.

It would be nicer if the memory map passed by GRUB was a bit more complete than listing generally-available memory. If I could find out which memory is used by GRUB structures, which memory is used to load my kernel (+ modules), that would be much better.

Could you suggest an example? How should information be passed to make it easy?

Okuji

#4 lore raw

I was thinking something along an array of memory descriptor structs, listing -
- Base
- Length
- Type (Conventional memory, Kernel + Modules, GRUB structures like the MBI
- Attributes (read protected, write protected, cacheability attributes)

The advantages over the old mmap_ entries being that the kernel has a clear idea
of what is available memory, what is memory used by the bootloader (and its structures like the MBI), and what
memory is used by everything associated with the loaded kernel (which includes modules, additional ELF sections and the section headers loaded).

Andrei Evgenievich Warkentin
[email protected]
Cell: (+1) (847) 321-15-55

Quoted 23 lines · Yoshinori K. Okuji
Quoted 11 lines · Andrei E. Warkentin

Actually, even now a Multiboot kernel has to do way too much work in terms of memory initialization. The real problem is that GRUB only gives you the BIOS memory map and the lowmem/highmem, which means you need to figure out an "in use" memory map for yourself, by seeing if any kernel modules are present, if any ELF section headers + sections have been loaded, etc.

It would be nicer if the memory map passed by GRUB was a bit more complete than listing generally-available memory. If I could find out which memory is used by GRUB structures, which memory is used to load my kernel (+ modules), that would be much better.

Could you suggest an example? How should information be passed to make it easy?

Okuji

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

#5 lore raw
Quoted 8 lines · Andrei E. Warkentin

I was thinking something along an array of memory descriptor structs, listing -
- Base
- Length
- Type (Conventional memory, Kernel + Modules, GRUB structures like the MBI
- Attributes (read protected, write protected, cacheability attributes)

Quoted 7 lines

The advantages over the old mmap_ entries being that the kernel has a clear idea
of what is available memory, what is memory used by the bootloader (and its structures like the MBI), and what
memory is used by everything associated with the loaded kernel (which includes modules, additional ELF sections and the section headers loaded).

I understand your idea. This looks good to me. Does anybody object to making this change?

Okuji

#6 lore raw

This is a good idea. The new structures can do what "modaddr" command can, but more flexible.

Coly

Quoted 27 lines · 在 2007-03-28三的 19:45 +0100,Yoshinori K. Okuji写道:
Quoted 8 lines · Andrei E. Warkentin

I was thinking something along an array of memory descriptor structs, listing -
- Base
- Length
- Type (Conventional memory, Kernel + Modules, GRUB structures like the MBI
- Attributes (read protected, write protected, cacheability attributes)

Quoted 7 lines

The advantages over the old mmap_ entries being that the kernel has a clear idea
of what is available memory, what is memory used by the bootloader (and its structures like the MBI), and what
memory is used by everything associated with the loaded kernel (which includes modules, additional ELF sections and the section headers loaded).

I understand your idea. This looks good to me. Does anybody object to making this change?

Okuji

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

#7 lore raw
Quoted 2 lines · coly

This is a good idea. The new structures can do what "modaddr" command can, but more flexible.

It is a bit different. The argument about "modaddr" was to specify explicitly where modules will be loaded, so that an OS image does not have to care about relocations later. On the other hand, even if a boot loader passes information in a more convenient way, an OS image still needs to relocate modules, if modules must reside at certain addresses.

Okuji