|
修改为如下,效率高一些:
@@ -3575,7 +3695,8 @@ static int insmod_func(char *arg,int flags)
GRUB_MOD_ADDR = grub_malloc (0x100000); //模块缓存
mod_end = GRUB_MOD_ADDR;
}
- if (substring(skip_to(0,arg) - 4,".mod",1) == 0)
+ if (substring(skip_to(0,arg) - 4,".mod",1) == 0
+ || (arg[0] == '(' && arg[1] == 'm' && arg[2] == 'd' && arg[3] == ')'))
{
if (!command_open(arg,1))
return 0;
@@ -3597,6 +3718,11 @@ static int insmod_func(char *arg,int flags)
//skip grub4dos moduld head.
if (strcmp(p_mod->name.sn,"\x05\x18\x05\x03\xBA\xA7\xBA\xBC") == 0)
++p_mod;
+ else
+ {
+ grub_free(buff);
+ goto external_command;
+ }
while ((char *)p_mod < buff_end && grub_mod_add(p_mod))
{
p_mod = (struct exec_array *)(p_mod->data + p_mod->len);
@@ -3604,6 +3730,8 @@ static int insmod_func(char *arg,int flags)
grub_free(buff);
return 1;
}
+
+external_command:
switch(command_open(arg,0))
{
case 2: |
|