Coder Social home page Coder Social logo

chenall / grub4dos Goto Github PK

View Code? Open in Web Editor NEW
640.0 640.0 136.0 10.69 MB

外部命令和工具源码:https://github.com/chenall/grubutils 下载:

Home Page: http://grub4dos.chenall.net

License: GNU General Public License v2.0

Makefile 5.43% Shell 1.58% Assembly 40.21% C 51.93% M4 0.85%

grub4dos's Introduction

grub4dos's People

Contributors

1dot75cm avatar a1ive avatar chenall avatar crass avatar memoarfaa avatar pbatard avatar roytam1 avatar yaya2007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grub4dos's Issues

USB 2.0 driver problem on some computers

Hi.

The USB 2.0 driver from 0.46a works ok on my computer but not that good on others.
For example I get error 82: No USB device found.
After that the USB flash drive can't be accessed anymore. If I try "ls" command I get the errors from screenshot.
However with Plop is ok, but ofcourse it's read-only.
I will still have access to this computer for a few more days (after that I will have to return it to its owner).
I will try to attach the Everest hardware report + the screenshot.
Hope these informations will help you to fix the USB driver.

Grub4dos version: 0.4.6a-2014-11-27

Regards,
David

img0075a

I was unable to attach the Everest hardware report, so you can download it from here:
https://drive.google.com/open?id=0ByKxAD_t9uvLbFh1eHlRUVFrZWc&authuser=0

iftitle and errorcheck off problem 0.4.6a

Bug in 0.4.6a 2015-02-09 (and previous versions) BUG
0.4.5c is OK

I cannot provide a simple test case for this, but it happens when a menu entry fails to run and grub4dos re-displays the menu.

If have a menu with some iftitles - e.g.

iftitle [if exist /bootmgr] fred
xx
xx

if errorcheck is on and a menu entry fails to run, then 'fred' is re-displayed in menu after the menu entry has failed, but if errorcheck is off (e.g. from calling a batch file before returning to the menu) then does not work and menu is not shown.

iftitle [if exist ()/bootmgr] fred
also gives same problem

However, if I use
iftitle [if exist (bd)/bootmgr] fred

then it works and menu is listed even with errorcheck off.

This happens when a menu entry has failed to boot and the menu is re-displayed. I am using a menu in memory configfile (md)0xa000+0x50

0.4.5c works OK and if exist /bootmgr works OK.

cat --length=0 bug with large files

Reported by Steve6375, Apr 26, 2014
What steps will reproduce the problem?

On an NTFS USB HDD

create a 20GB file - /TEST200.IMG
create a 2.5GB file /TEST025.IMG

cat --length=0 /TEST025.IMG && echo fred
cat --length=0 /TEST200.IMG && echo fred

What is the expected output? What do you see instead?

smaller file echo's 'fred' but large 20GB file does not.

What version of the product are you using? On what operating system?
0.45c 2014 version

Please provide any additional information below.

problem with sizes over 0x100000000 4GB ???

Apr 26, 2014 Delete comment #1 Steve6375
PS A file over 4GB does work - for 4572839936 byte file

cat returns filesize is 0x11090000 and echos 'fred'

but 20GB file 21474836480 bytes gives 0x500000000 and does not echo fred

Apr 26, 2014 Delete comment #2 Steve6375
I think but is that it only looks at lower 4 bytes of 8 byte returned value.
Because my file is exactly 0x50,0000,0000 it sees the 0000,0000 as being 0
Apr 26, 2014 Delete comment #3 Steve6375
Note: On an NTFS partition

cat --length=0 /a_folder

displays 'filesize is 0x0' but it is not a file, it is a folder/directory!

On a FAT32 partition, it does not display 'filesize is 0x0' but gives an 'error 1: Filename must be an absolute pathname or a blocklist' message.
Apr 27, 2014 Delete comment #4 Steve6375
If this is difficult to fix, can the result returned just be maximum 3.999GB?

i.e.

3GB file >>> 3GB
5GB file >>>> 3.9990GB 0xFFFFFFFF
20GB file >>> 3.999GB 0xFFFFFFFF

That way we know the file is not 0 length at least.

May 8, 2014 Delete comment #5 Steve6375
Any fix for this please?
Jun 10, 2014 Delete comment #6 Steve6375
I wish to compare the file size of two large files.
One is 4.3GB and the other may be larger or smaller.
How can I check to see if the other file is larger or smaller

cat --length=0 /FILE43GB
echo %@RetVal%

does not return correct size.

problem with get_fstype function in grubinst

Hi.

Grubinst and grubinst_gui have a problem: when the partitions are created with FE/FF to "force" bioses to use LBA instead of CHS, they report:

Partition table
bt h0 s0 c0 fs h1 s1 c1 base leng
80 FE FF FF 0E FE FF FF 800 1FF800
00 FE FF FF 07 FE FF FF 200000 F72C57F
grubinst: Bad partition table, if you're sure that the partition list is ok, please run this program again with --skip-mbr-test option.

Such partitions are often used today on USB drives. Other disk utilities don't report this error but they still check the MBR and the partition table for many issues.
The file system detection from grubinst should be changed to do this too.
This way it will be compatible with Bootice too...

The problem appears in the get_fstype function from utils.c >> chk_mbr function >> probe_mbr function.
probe_mbr is returning different error codes (7, 26, ...) >> get_fstype is returning FST_MBR2 type (error) instead of FST_MBR.

The idea is to make sure the file system is MBR and that the MBR and/or the partition table are valid but not showing error for this particular situation.

Could you please modify this function?
Thank you.

I made some changes to utils.c and utils.h to add the FST_EXFAT type. Here are the latest versions: https://drive.google.com/file/d/0ByKxAD_t9uvLeUZCOGlaUkQ0WE0/view?usp=sharing The download link is on top of the page, don't click on the name of the files.

Regards,
David

iftitles are processed very slow (especially on slow storage device(s))

Hi.

I noticed the "iftitle" is very slow when comparing with "title".
So I "dug" a little into the grub4dos source code.

The problem has 2 causes:

  1. Each condition from the iftitles is slowing down the processing speed, especially because there is no cache/buffer between grub4dos code and the storage device(s).
    For example:

iftitle [if exist (bd)/aaa] aaa
...

iftitle [if exist (bd)/bbb] bbb
...

If the information about the contents of the (bd), retrieved by the "if exist (bd)/aaa" condition, is saved into RAM, next time it can be used by "if exist (bd)/bbb" condition. And, of course, it will be a lot faster.
2. Each iftitle is reloading the configuration file, because, I quote: "close the already opened file for safety, in case the builtin->func() below would call grub_open()."
You mean loading another configuration file in the [..]? Seems very unlikely...
LE: But, if it's a function like cat, it should check first if the condition has that function instead of closing/reloading the configuration file in all situations.

Anyway, this is the code (taken from 0.4.6a-2014-11-27 build), stage2.c file:

while (get_line_from_config ((char *) CMDLINE_BUF, NEW_HEAPSIZE, is_preset))
{
    struct builtin *builtin;
    char *cmdline = (char *) CMDLINE_BUF;

    /* Get the pointer to the builtin structure.  */
    builtin = find_command (cmdline);
    errnum = 0;
    if (! builtin)
    /* Unknown command. Just skip now.  */
    continue;

    if ((int)builtin != -1 && builtin->flags == 0)  /* title command */
    {
    if (builtin != &builtin_title)/*If title*/
    {
        unsigned long tmp_filpos;
        unsigned long tmp_drive = saved_drive;
        unsigned long tmp_partition = saved_partition;
        unsigned int rp;
        cmdline = skip_to(1, cmdline);

        /* save original file position. */
        tmp_filpos = (is_preset && preset_menu == (const char *)0x800) ?
                preset_menu_offset : filepos;

        /* close the already opened file for safety, in case 
         * the builtin->func() below would call
         * grub_open(). */
        if (! is_preset || preset_menu != (const char *)0x800)
            grub_close ();

        if (debug_boot)
        {
            putchar_hooked = 0;
            grub_printf("IFTITLE: %s->",cmdline);
            putchar_hooked = (unsigned char*)1;
        }

        rp = builtin->func(cmdline,BUILTIN_IFTITLE);
        saved_drive = tmp_drive;
        saved_partition = tmp_partition;
        current_drive = GRUB_INVALID_DRIVE;
        buf_drive = -1;

        /* re-open the config_file which is still in use by
         * get_line_from_config(), and restore file position
         * with the saved value. */
        if (is_preset)
        {
            open_preset_menu ();
            if (preset_menu == (const char *)0x800)
                preset_menu_offset = tmp_filpos;
            else
                filepos = (unsigned long long)tmp_filpos;
        }
        else
        {
            if (! grub_open (config_file))
            {
                printf ("  Fatal! Re-open %s failed!\n", config_file);
                print_error ();
            }
            filepos = (unsigned long long)tmp_filpos;
        }

        if (debug_boot)
        {
            putchar_hooked = 0;
            grub_printf("  rp=%d\n", rp);
            DEBUG_SLEEP
            putchar_hooked = (unsigned char*)1;
        }

        if (rp)
        {
            cmdline += rp;
        }
        else
        {
            state |= 0x10;
            continue;
        }
    }
    /* Finish the menu init commands or previous menu items.  */

    if (state & 2)
    {
        /* The next title is found.  */
        if (num_entries >= 256)
        break;
        bt += (config_entries[attr] & 1);
        num_entries++;  /* an entry is completed. */
        config_entries[config_len++] = 0;   /* finish the entry. */
        prev_config_len = config_len;
    }
    else if (state & 1)     /* state == 1 */
    {
        /* previous is an invalid title, overwrite it.  */
        config_len = prev_config_len;
    }
    else            /* state == 0 */
    {
        /* The first title. So finish the menu init commands. */
        config_entries[config_len++] = 0;
    }

    /* Reset the state.  */
    state = 1;

    /* Copy title into config area.  */
    {
        int len;
        char *ptr = cmdline;
        while (*ptr && *ptr != ' ' && *ptr != '\t' && *ptr != '=')
        ptr++;
        if (*ptr)
        ptr++;
        attr = config_len;
        if (num_entries < 256)
        {
            titles[num_entries] = config_entries + config_len;
            title_boot[num_entries] = bt;
        }
        config_entries[config_len++] = 0x08;    /* attribute byte */

        len = parse_string (ptr);
        ptr[len] = 0;
        while ((config_entries[config_len++] = *(ptr++)) != 0);
    }
    }
    else if (state & 0x10) /*ignored menu by iftitle*/
    continue;

I erased this:

        /* close the already opened file for safety, in case 
         * the builtin->func() below would call
         * grub_open(). */
        if (! is_preset || preset_menu != (const char *)0x800)
            grub_close ();

and this:

        /* re-open the config_file which is still in use by
         * get_line_from_config(), and restore file position
         * with the saved value. */
        if (is_preset)
        {
            open_preset_menu ();
            if (preset_menu == (const char *)0x800)
                preset_menu_offset = tmp_filpos;
            else
                filepos = (unsigned long long)tmp_filpos;
        }
        else
        {
            if (! grub_open (config_file))
            {
                printf ("  Fatal! Re-open %s failed!\n", config_file);
                print_error ();
            }
            filepos = (unsigned long long)tmp_filpos;
        }

A configuration file with 50 iftitles, previously processed in 31 sec, is now processed in less of a sec (on my USB 1.1).
And I didn't see any errors caused by the "grub_open() calls".

Solutions (you can use one or combinations):

  1. Caching the reading(s) from the storage device(s).
  2. Loading the configuration file in RAM and processing it from there. Even with no iftitles I noticed an improvement in processing speed.
  3. Closing and reopening the configuration file strictly ONLY when is needed and/or modifying grub_open function to be able to open multiple files.

On USB 1.1 it will be a very big improvement in the processing speed. On USB 2.0 it will be smaller, but still worth the work.

Thank you.

Regards,
David

Support of splash (background) images of any size / format / colour depth

Currently there is a nasty behaviour when monitor is set to 800×600 VGA mode, but splash image is 640×480. Then the image is not scaled and there is rubbish pixels on the area around image. More over when I have created 800×600 image, it was actually cropped at 640×480 and again, the area beyond that was rubbish.
Would be nice to have an automatic scaling capability, or at least clean up rubbish when rendering image smaller then video mode.
Support of PNG and/or JPEG is warmly welcomed, as well as colour depth higher than 14 bits.

redirecting echo $[0200] problem

Is there a way to get this to work

echo $[0200]fred > (md)x0300+1

result: cat (md)0x300+1
fred

The $[xxxx] is not redirected to (md)0x300+1 because it is interpreted as a colour command.

USB 4Kbyte sector size

Grub4DOS 0.4.6a now has its own software 'stack' for EHCI MSD,
but - sadly - the impressive USB stuff in asm.S ( by Yaya' ?) /assumes/
sectors are 512 bytes long, whereas many USB storage media
have appeared as 4096 bytes per sector forseveral years now.

Are you working on fixing this ? Grub4DOS's internal "disk int 13h"
for USB should allow for 4K sectors, and the "boot" command
for such a disk should load a full 4,096 bytes sector to memory
at absolute address 00007C00 & transfer control there.

In addition of "chainloading" a MBR or boot sector from the
UMB device, Grub's int 13 BIOS extension would be
usable as a DOS driver substitute when chainloading DOS
-for example- from another, regular disk.

Request: grubinst.exe detection of Removable drive

It is very useful to know if a USB drive is of the Fixed-disk or Removable type (e.g. when booting Windows PE or Windows Install file).
If a USB drive is of the Removable type, Windows will use a \AutoUnattend.xml file automatically (but not if the drive is of the Fixed-disk type)
If a USB drive is of the Removable type, Windows will only be able to access the first partition of the USB drive.
grub4dos cannot detect if a drive is of the Removable type or Fixed-disk type (RMB bit).
Is it possible for grubinst.exe to set a bit or byte in the MBR or PBR grub4dos boot sector to indicate what type of drive it is?
e.g.
Removable = 1 (Removable) , 2 (Fixed-disk) or (xx=anything else=unknown)

It must be compatible with old versions of grub4dos MBR\PBR which should = (unknown).

Then the normal grub4dos menu code or batch code can look at the MBR\PBR and determine the type of USB drive.
DavidB has suggested a scheme
http://reboot.pro/topic/20238-improving-grubinst-and-grubinst-gui-in-windows-and-linux/page-9#entry190809

Does calc | work?

In console
e.g.
calc 4 | 6 ;; echo %@RetVal%

calc 4|6 works, but if there are spaces it doesn't!

help calc
shows spaces between arguments, some things do not work with spaces between operators. e.g.

| % >> <<

but * / - + ^ & work with spaces

grub4dos 0.4.5c 2014-11-15 and 2015-01-10

bios utility and int 13h AH=48 bug?

When making a bios call for int13h AH=48h, the buffer area seems to need to contain non-zero bytes in bytes 0 and 1 of the buffer area

This works:

write 0x60000 0x1212
:: get size of disk from INT 13h AH=48 into memory at DS:SI+10h - edx=80h is hard disk 0, 81h would be hard disk 1
/bios int=0x13 eax=0x4800 edx=0x80 ds=0x6000 esi=0x0
read 0x60010

This fails

write 0x60000 0x12
:: get size of disk from INT 13h AH=48 into memory at DS:SI+10h - edx=80h is hard disk 0, 81h would be hard disk 1
/bios int=0x13 eax=0x4800 edx=0x80 ds=0x6000 esi=0x0
read 0x60010

also write 0x60000 0 causes a fail too.

I cannot work out why??

VIA PCI USB 2.0 controller not detected

= Using a PCI add-on VIA USB 2.0 adapter (PCI id of enhanced controller : 1106-3104)
on an older DELL-Intel motherboard (with Pentium III, i815 ICH2)
= This is NOT detected by Grub4DOS : Error 81 No USB device found !

$[xxxx] and scroll bug

menu.lst
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
echo $[1064] sdssssssssssssssssssssssssssssssssss ;; echo fred
pause

image

problem with the MBR/PBR from latest 0.4.6a versions

It seems that the MBR/PBR from the latest 0.4.6a versions is buggy.

First, bootlace.com still doesn't work when trying to install the PBR on any partition / any drive / any Linux distro I tried:

error bootlace pbr

THe Grub4Dos MBR is not searching the grldr on the next partitions when it reaches an Ext2/exFAT partition without grldr:

grub4dos mbr ext2 part ntfs part
grub4dos mbr exfat part ntfs part

Even if grldr is copied on the exFAT partition, it doesn't load it (exactly the same message as previous).

When using normal MBR + Grub4Dos PBR, it doesn't boot at all on exFAT/EXT2 partitions.

normal mbr grub4dos pbr exfat or fat16 or ext2 part ntfs part

It doesn't matter if grldr is there or not.

The tests were made on real computer, QEMU and VirtualBox.
Also, in the same testing conditions, the MBR/PBR from 0.4.5c version and from the 0.4.6a from BOOTICE are booting ok (except on exFAT of course).

Could you please fix it?
Thank you.

Regards,
David

map --mem and 2xinitrd problem

Archlinux requires two initrd commands, one for cpu and one for initrd image.
Menu below works if map %ISO% (0xff) is used, but if map --mem %ISO% (0xff) is used instead, then it fails (screenshot attached).
If the first initrd /arch/boot/intel_ucode.img is removed, then map --mem causes no problem.
So must be something to do with map --mem and two initrd commands.

VM has 4GB memory available. ISO is 600MB, ucode.img is 684Kb, archiso.img=20MB, vmlinux is 3MB.

title Arch x86
set ISO=/_ISO/MAINMENU/archlinux-2014.11.01-dual.iso
errorcheck on
debug 2
uuid () > nul
set UUID=%?%

map %ISO% (0xff)

map --mem %ISO% (0xff)
map --hook
root (0xff)
echo ROOT = 0xff
kernel /arch/boot/i686/vmlinuz archisobasedir=arch archisolabel=ARCH_201411 img_loop=%ISO% img_dev=/dev/disk/by-uuid/%UUID% earlymodules=loop
echo Kernel loaded
initrd /arch/boot/intel_ucode.img
echo initrd ucode done
initrd /arch/boot/i686/archiso.img
echo initrd archiso.img done

image

command set-ext setting is lost/corrupt

after a call to batch file, one of the CHECK paths is /ggg(md)/LstFExt.g4b ??
and /_ISO/e2b/grub/ggg.g4b has disappeared!

image

Main.g4b

set default extension for executables

command --set-ext=.g4b

set default path for executables

command --set-path=/%grub%
call CountFiles.g4b

CountFiles.g4b

!BAT
echo -n Counting Windows Install ISOs %redir%
insmod /%grub%/LstFExt.g4b > nul
echo -n %redir%

get filecount of WINDOWS ISOs for next WINDOWS menu

debug 3 ;; ggg ;; pause 33c
LstFExt.g4b /_ISO/WINDOWS/XP .iso SILENT
debug 3 ;; ggg ;; pause 33d
...
...

LstFExt.g4b

debug 3 ;; ggg ;; pause LstFextA1 delmod -l %~nx0
delmod -l %~nx0
debug 3 ;; ggg ;; pause LstFextA4

Request: partnew command to support partitions in disk images

.dmg files for installing OS X and other disk images often are just sector-by-sector whole disk images containing an MBR with a partition table and PBR(s).
For instance, if you use dd to copy the /MacOSX.dmg image to a Flash disk and then use dd to make a file starting at LBA 1 (the start of the HFS partition) to make a MacOSXPtn1.img file, and then use partnew (hd0,3) 0xAF /MacOSXPtn1.img then you can chainload from (hd0,3) and it boots fine.
I want to use the partnew command to map one of the partitions inside the disk image file to a primary partition, e.g.
partnew (hd0,3) 0xAF /MacOSX.dmg --source-partition=0

So this will set hd0,3 to point to the place in the /MacOSX.dmg file where the first partition starts.
HFS partitions don't seem to need anything adjusting in the PBR - so this should 'just work'.
However, if a FAT/NTFS partition is recognised, it would be nice to also correct the BPB too.

Or is there a way to do this using existing commands?

Fatal error message on NTFS drives

If accessing valid sectors near the end of an NTFS drive (e.g. within 50 sectors of the end of the physical drive)...
e.g. cat --hex (hd0)0x7740a79+1
you get the error message:
Fatal! Inconsistent data read from (0x80)125045343+127
However, the operation does work OK!
This 'Fatal' message cannot be suppressed, even with debug 0 or debug msg=0.
cat --hex (hd0)0x7740a79+1 > nul does suppress the message.
BUT

debug 0
debug msg=0
cat --hex (hd0)0x7740a79+1 | set A=

does not work correctly.

As the commands actually do work successfully and return the correct sector contents, this message seems to be a warning rather than an error and also should be in the stderr stream or at least suppressed with debug msg=0.

Feature request: auto-hotkey feature based on first letter in a menu

If I have a large menu, I would like a to enable a feature where if a letter is typed, the first menu beginning with that letter is highlighted. If the same letter is typed again, then the next menu entry beginning with that letter is highlighted.
e.g.
titile Ubuntu x86
xxxx
titile Fedora x86
xxxx
titile PClinuxOS x64
xxxx
titile Ubuntu x64
xxxx
titile Fedora v3
xxxx
titile Ubuntu 14.04
xxxx
title ^Ctrl+D Dos
xxx
title Extra software
xxx

so if the user types 'u' the first matching line starting with u (uppercase or lowercase) is selected - e.g. menu 0. Then if the user presses u again, it goes to item menu 3. Then if he presses 'f' it goes to menu 4. If he presses 'f' again, it goes to menu 1, etc.
This is in addition to the hotkey feature. Command keys such as p, b, c and e will only work if SHIFT is pressed. e.g.
e -> Extra software menu selected
E -> edit menu
p -> PClinuxos menu selected
P -> password prompt
b -> no action (no matching menu)
B -> boot current menu entry
CTRL+D or CTRL+d - uses hotkey utility to immediatly run Dos entry

This allows a user to easily navigate a large menu to find an entry.
Is this possible?

"boot -1" should not restore BIOS "number of hard disks"

boot -1
... signals BIOS a "failed" boot attempt, and that the next boot option should now be attempted.

Before giving control back to BIOS however, Grub4DOS will restore the number of hard disks
at absolute address 0x0000475, that is a bug, preventing a legacy OS from "seeing" any added
disks (such as done by: > usb --init )

ls | not working on large exFAT drive

If USB drive formatted as exFAT
if USB drive partition is 2GB or 8GB then batch file works
if USB drive is 128GB or larger then batch file fails
latest grub4dos 0.4.5c tested 2014-10-21

problem is with 2nd ls | call line (line 9)
ls | call :test

I suspect the problem is the error message when partition is accessed by grub4dos
e.g.
ls /
Warning! FAT cluster size(=131072) larger than 32K!
menu.lst test.g4b

!BAT
clear
call :test
debug 0
echo debug=0
ls | call :test
debug 1
echo debug=1
ls | call :test
echo finished!
exit

:test
echo TEST CALLED OK
goto :eof

Can this Warning message be removed - exFAT seems to work OK on large drives as far as I can tell.

Cannot boot Ubuntu using grub4dos batch file

This works in a menu.lst but not in a batch file
archlinux ISO does work, but not Ubuntu.

!BAT
debug 2
set ISOC=/_ISO/MAINMENU/ubuntu-14.04-desktop-i386.iso
map %ISOC% (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed noprompt boot=casper iso-scan/filename=/ubuntu-11.04-desktop-i386.iso quiet splash --
initrd /casper/initrd.lz
boot

image

iftitle changes debug status setting

If a menu has

debug 0
iftitle [if 1==2] xxx

title boot from hdd
debug status && pause

then the debug status is 1 when boot from hdd menu is run

but if I remove the iftitle line or change to title then debug status is 0 when I run menu

i.e. iftitle is changing the debug status

What is the expected output? What do you see instead?

What version of the product are you using
0.4.5c 20141017

insmod\delmod corruption

reproducible but need to load several modules and run a menu ( I cannot make a simple test case yet)
0.4.5c and 0.4.6a give same results

image
image
image

sometimes
delmod
will list the all the text from a batch file
P.S. Help text for delmod could be improved (delmod or delmod -l lists loaded modules)

Setting long variable names are ignored

image

I know variable names are 8 characters max, if 9 chars then it is reduced to 8, but if more than 9 then it is ignored.
I would expect
set AUTOMENUOFF=1
to set as
AUTOMENU=1

This seems inconsistent behaviour?

grub4dos-chenall without preset menu

Is there a technique to get the chenall build of grub4dos to not use a preset menu?

Looking at the source, I see there is a flag to disable during compile time.

https://github.com/chenall/grub4dos/blob/master/build#L78

I don't have a linux machine setup to build, and I am hoping there is a way to disable it without recompiling.

The reason why I need this is because my device has "hotkey" support to recover from OS corruption. My customers will be instructed to press "F12" until the recovery starts. However, if F12 is pressed during boot, the preset menu is shown, requiring the user to "find menu.lst", and THEN press F12.

Thanks in advance!

0.4.6a and exFAT - Warning: messages issue

debug 1
parttype (hd0,3) | set check=

on large 256GB exFAT drive, check is set to '!! number of heads for drive 80 restored from 255 to 256.'

also get 'get-diskinfo ....' messages on ls command if debug 2 or 3 used.
works OK on latest 0.4.5c.

does not work on 2014-11-27 0.4.6a or later (not tried earlier) - e.g. under VBox:
image

I think similar issue was fixed in 0.4.5c.

Also, if use debug 3 then extra messages cause problems:
e.g.
debug 3
parttype (hd0,0) | set check=

image

EXT4 support

Has last version of grub4dos full support of EXT4?

  1. Has last version of grub4dos loader support for installing on EXT4 partition? Can it boot then?
  2. Has last version of grub4dos loader support for boot operating systems from EXT4 partition?

And... Do you understand English? I wrote English message to your email 1 or more year ago. You did not answer.

Request: set -n /p

set /p:3 ask=enter input > nul
always throws a carriage return. If you just remove the carriage return it might break existing code.
Can you add a -n or /n switch to suppress the carriage return please?

also if no text then set /p ask= reports an error. Is it possible to use set /p without any prompt text?

e.g. get input within 3 seconds
echo -n $[0005]Please enter input :
set -n /p:3 ask=

e.g. get password but don't show typed characters
color standard 3
echo -n Password :
color standard 0
set -n /p:3 ask=text > nul
color standard 3

0.4.6a Problem with ISOs on exFAT volumes

This problem does not occur with 0.4.5c (e.g. 2015-01-20)
Using 230GB SSD formatted as exFAT under VBox

fresh boot:
image

if map --hook and ls (0xff)/ we get:
image

but 0.4.5c is OK
image
image

Also NTFS is OK
image

The weird thing is, if I boot to 0.4.5c and then chainloader /grldr_046_2015-01-24 on the exFAT drive - then it works!!!

0.4.6a debug breakpoint on line number issue

If set a breakpoint at 3 (say) then every batch file breaks at line 3.
e.g.
debug /g1.g4b
B:3
E

This breaks in g1.g4b and g2.g4b
image

if breakpoint happens to be in the middle of a large loop in g2.g4b then it is impossible to debug.

grub4dos-chenall without preset menu

Hi.
I don't use pxe and I don't need the preset menu.
I tried to recompile the sources but:

  1. I don't know where/how to modify them;
  2. For now I can't install a different gcc version in my Linux distro. I have 4.7.2 (blacklisted).
    So I have tried this solution #7 for the latest current build (0.4.6a-2014-11-27).
    But it doesn't work, the menu.lst is not automatically loaded anymore, all I get is a prompt where I have to type "configfile /menu.lst".
    Also tried to fill with #0 instead of deleting, no change.

Is there another way...?
Thank you in advance.

Regards,
David

%~x1 doesn't work with very long filenames

grub4dos 0.4.6a 2015-03-24

problem first found with filename string=
WIN8.1_ENT_REVIEW_9600.16384.WINBLUE_RTM.130821-1623_X86FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X86FREE_EN-US_DV5.ISO
also this fails
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678.ISO
fails on 102 characters

This file is OK (101 characters)
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567.ISO

%~n1 %~x1 and %~nx1 seem to be failing if filename is very long

It is only failing in a batch file - I cannot seem to reproduce the problem in a test batch file.

e.g.
win8mn.g4b .automenu WIN8

With files in _ISO\WINDOWS\WIN8 folder

If you download Easy2Boot from www.easy2boot.com, the _ISO\e2b\grub\win8mn.g4b file can be found (without debug code).

image

see makemenu0 line - only %1 is echoed to screen!

image

failed to boot ntldr

Hi.
For some time I wrote and use this script: http://reboot.pro/topic/17264-grub4dos-find-and-boot/page-5#entry173038
It works fine for versions <= 0.4.6a-2014-11-29. But not in versions >= 0.4.6a-2014-12-01.
I have Windows XP installed in the first partition of my internal HDD. The script is generating this menu:

title Boot to Windows XP on second HDD, first partition\nUsually the first internal HDD...
map (hd1) (hd0)
map (hd0) (hd1)
map --rehook
root (hd0,0) > nul
chainloader /ntldr && boot
map (hd1) (hd0)
map (hd0) (hd1)
map --rehook
root (bd) > nul
chainloader (hd1,0)/ntldr

title
root

title Return to main menu...
configfile /menu.lst

It reaches "chainloader /ntldr && boot", for a split second I see "Will boot.." and all I get is a blinking cursor.
Is it a bug or I should adapt the script to the new versions (if so, how?)...?

Regards,
David

cat --hex output has changed

In 20130724

cat --hex --length=16 --skip=446 (hd0)+1

displayed hex characters starting at 1BE
000001BE: 80 20 21 00 07 etc etc

but 20141021 displays starting from 1B0
00001B0: (lots of space here) 80 20 : xxxxxxxxxxxx

This causes problems with compatibility.

Can the old format be restored please so that we can obtain bytes by parsing a line of hex characters.

20140903 works OK, 20140908 has changed cat output

see http://rmprepusb.blogspot.co.uk/2014/10/e2b-157a-new-bug-found-in-new-grub4dos.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.