Idea: elimination of the normal mode
Hi,
First of all, one of the annoying thing about normal mode is that we have two sets of command, one for rescue mode, one for normal mode. Take a closer look at them, they're very similar, expect for the argument options. If we move the option analyzer from normal.mod to kernel, then we can have one unified set of commands.
About the duplicated commands, we can create a module minicmd to include the most basic command, and allow for overwrite. So, there is a minimal ls command in minicmd which would be embedded in the kernel, but if we need the extra feature, we can load the external ls module.
After resolving the problem of two command sets, I start to wonder if normal mode is necessary at all. In fact, its function can be separated into the following parts:
Interface:
We can support multiple interface. The kernel's interface is a console mode tty interface. Normal mode is the menu interface. But this is not the only option. For example, we can have a simple chooser. The different boot option is output line by line, and we can enter the number to choose them. This interface is very useful in terminal that doesn't support absulote cursor or graphic character. We can also have graphic interface, where the layout is completely decided by the module, not limited by interface of text mode.
Script engine:
We can also support multiple script engines. In kernel, there is just the basic line scanner. The current normal mode engine is bash-like parser. We can add other engines in the future, csh-like or so.
Each engine would have a separate configuration file. The default is a line by line command list used by the kernel scanner. This look some like preset menu of grub legacy. From this file, we load modules that would bring us to normal environment. For example, it may look something like this:
set rdir=/boot/grub
search -s ${rdir}/grub.cfg
insmod bash
insmod text-menu
This file would be embedded in the kernel, as root is yet to be defined. From this file, we set the root environment and load extra module. This would eliminate the need for static grub_prefix.
Signature · 1 line
Bean
Quoted 2 lines · Bean
If we move the option analyzer from normal.mod to kernel, then we can have one unified set of commands.
How much space could this represent?
Quoted 2 lines
About the duplicated commands, we can create a module minicmd to include the most basic command
Then we can't have a rescue shell before heap is initialised and minicmd is loaded. Should we be concerned about this?
Signature · 5 lines
Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What good is a phone call… if you are unable to speak? (as seen on /.)
Quoted 7 lines · Robert Millan
Quoted 3 lines
About the duplicated commands, we can create a module minicmd to include the most basic command
Then we can't have a rescue shell before heap is initialised and minicmd is loaded. Should we be concerned about this?
What would one use that rescue shell for?
Signature · 5 lines
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected] • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866Quoted 8 lines · Stefan Reinauer
Quoted 6 lines · Robert Millan
Quoted 3 lines
About the duplicated commands, we can create a module minicmd to include the most basic command
Then we can't have a rescue shell before heap is initialised and minicmd is loaded. Should we be concerned about this?
What would one use that rescue shell for?
Idea of the rescue shell is load other modules in case grub itself cannot find them. It provides thin layer of tools so user is able to find them.
Personally I would like to keep this functionality in core.img.
Quoted 9 lines · Vesa Jääskeläinen
Quoted 8 lines · Stefan Reinauer
Quoted 7 lines · Robert Millan
Quoted 3 lines
About the duplicated commands, we can create a module minicmd to include the most basic command
Then we can't have a rescue shell before heap is initialised and minicmd
is loaded. Should we be concerned about this?
Quoted 7 lines
Quoted 1 line
What would one use that rescue shell for?
Idea of the rescue shell is load other modules in case grub itself cannot find them. It provides thin layer of tools so user is able to find them.
Personally I would like to keep this functionality in core.img.
So, how is the "rescue shell" different that "grub itself". Why would it find modules that "grub itself" does not find?
Stefan
Signature · 5 lines
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected] • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866Quoted 8 lines · Stefan Reinauer
Quoted 5 lines · Vesa Jääskeläinen
Idea of the rescue shell is load other modules in case grub itself cannot find them. It provides thin layer of tools so user is able to find them.
Personally I would like to keep this functionality in core.img.
So, how is the "rescue shell" different that "grub itself". Why would it find modules that "grub itself" does not find?
User can use ls and insmod commands to load those modules from disk. Most common problem with GRUB legacy is that it just prints GRUB on screen. This will kinda remove that problem as user still has a way to boot his system with some keypresses.
Quoted 6 lines · Vesa Jääskeläinen
Quoted 5 lines · Stefan Reinauer
Quoted 4 lines · Vesa Jääskeläinen
Idea of the rescue shell is load other modules in case grub itself cannot find them. It provides thin layer of tools so user is able to find them.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Personally I would like to keep this functionality in core.img.
So, how is the "rescue shell" different that "grub itself". Why would it find modules that "grub itself" does not find?
User can use ls and insmod commands to load those modules from disk. Most common problem with GRUB legacy is that it just prints GRUB on screen. This will kinda remove that problem as user still has a way to boot his system with some keypresses.
So the rescue shell has filesystems and a shell? Is the "advanced console interface" so huge that it can't live with the shell and the filesystems in the rescue shell?
Signature · 5 lines
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected] • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866Quoted 10 lines · Stefan Reinauer
Quoted 9 lines · Vesa Jääskeläinen
Quoted 8 lines · Stefan Reinauer
Quoted 5 lines · Vesa Jääskeläinen
Idea of the rescue shell is load other modules in case grub itself cannot find them. It provides thin layer of tools so user is able to find them.
Personally I would like to keep this functionality in core.img.
So, how is the "rescue shell" different that "grub itself". Why would it find modules that "grub itself" does not find?
Quoted 7 lines
Quoted 4 lines
User can use ls and insmod commands to load those modules from disk. Most common problem with GRUB legacy is that it just prints GRUB on screen. This will kinda remove that problem as user still has a way to boot his system with some keypresses.
So the rescue shell has filesystems and a shell? Is the "advanced console interface" so huge that it can't live with the shell and the filesystems in the rescue shell?
It has anything what core provides. If by this you get core smaller then I am all for it. If it makes it larger then I would propose to find free space from somewhere else. Core.img just have to be standalone application so user can do recovery if something gets wrong in installation or something else.
I do not know how well grub scripting is integrated to normal mode so check that out first.
Quoted 7 lines · Vesa Jääskeläinen
It has anything what core provides. If by this you get core smaller then I am all for it. If it makes it larger then I would propose to find free space from somewhere else. Core.img just have to be standalone application so user can do recovery if something gets wrong in installation or something else.
I do not know how well grub scripting is integrated to normal mode so check that out first.
Hi,
With my suggestion, core.img would contain:
minicmd + basic console interface + line scanner + fs modules
It would be slightly bigger because we also add the option analyzer. But it may also reduce size due to better function separation.
the line scanner would read a config file, which instruct extra modules to be loaded For example, to archive the same function of normal mode, we need:
advanced console interface + text menu interface + script engine.
Some advantage of this scheme:
1, One set of command. Now, if we want to use command like search, we must also include normal.mod, whose purpose is just to provide the option analyzer.
2, The separation of interface and script engine.
Interface deal with interaction with user, like draw the menu, choose an menu item, edit a string, etc. Script engine is responsible for the interpretation of commands. These two parts are independent, we shouldn't bundle them into a single normal.mod.This would make modules like graphic interface more difficult to implement.
Signature · 1 line
Bean
Quoted 9 lines · Bean
Quoted 7 lines · Vesa Jääskeläinen
It has anything what core provides. If by this you get core smaller then I am all for it. If it makes it larger then I would propose to find free space from somewhere else. Core.img just have to be standalone application so user can do recovery if something gets wrong in installation or something else.
I do not know how well grub scripting is integrated to normal mode so check that out first.
Quoted 6 lines
With my suggestion, core.img would contain:
minicmd + basic console interface + line scanner + fs modules
It would be slightly bigger because we also add the option analyzer. But it may also reduce size due to better function separation.
It total size is smaller I do not care. If not, then I would pass it. I still like the idea to separate rescue mode from "normal" shell mode. This gives user an idea that grub has failed to load more of itself.
I think Robert has from time to time complained that core.img gets too big sometimes to be embedded especially on raid configurations. So increasing size with this does not sound good on my ears.
Quoted 11 lines
the line scanner would read a config file, which instruct extra modules to be loaded For example, to archive the same function of normal mode, we need:
advanced console interface + text menu interface + script engine.
Some advantage of this scheme:
1, One set of command. Now, if we want to use command like search, we must also include normal.mod, whose purpose is just to provide the option analyzer.
Rescue is supposed to be minimal anyway.
Quoted 6 lines
2, The separation of interface and script engine.
Interface deal with interaction with user, like draw the menu, choose an menu item, edit a string, etc. Script engine is responsible for the interpretation of commands. These two parts are independent, we shouldn't bundle them into a single normal.mod.This would make modules like graphic interface more difficult to implement.
Well interaction between textual menu, graphical menu and shell interface will be studied anyway by Colin during his GSoC activities so lets wait what we get from there before jumping too far.
Quoted 5 lines · Robert Millan
Quoted 2 lines · Bean
If we move the option analyzer from normal.mod to kernel, then we can have one unified set of commands.
How much space could this represent?
It won't take much, the code is basically inside normal/arg.c.
Quoted 6 lines
Quoted 3 lines
About the duplicated commands, we can create a module minicmd to include the most basic command
Then we can't have a rescue shell before heap is initialised and minicmd is loaded. Should we be concerned about this?
The rescue shell is still there. It's part of the line by line command scanner.
Signature · 1 line
Bean
Quoted 7 lines · Bean
Quoted 5 lines
Quoted 2 lines
About the duplicated commands, we can create a module minicmd to include the most basic command
Then we can't have a rescue shell before heap is initialised and minicmd is loaded. Should we be concerned about this?
The rescue shell is still there. It's part of the line by line command scanner.
Hi,
Here is another way to look at rescue/normal mode.
rescue mode:
basic console interface + line scanner
normal mode:
advanced console interface (history, completion) + script parser text menu interface + script parser
Signature · 1 line
Bean