Quote:
Zw2312914 have invented a new approach. He make use of the existing features of “default” and “savedefault” command to write an integer value into the file “default”.
Thanks, it works (but you have to add a number (e.g.: 0) in the beginning of the DEFAULT file (replace the first space), else you get an error).
- Ungzip /ubcd/images/fdubcd.igz (rename to fdubcd.img.gz first).
- Edit mount fdubcd.img.
- Add a directory /args/ to the image.
- Rename the DEFAULT file (2048 bytes) of the grub4dos package to grub4dos.arg
- Change the first space in the grub4dos.arg to a 0.
- Make grub4do2.arg and a grub4do3.arg file with the same content.
- Save/unmount the fdubcd.img.
- Gzip fdubcd.img and save as /ubcd/images/fdubcd.igz.
[size="5"]Converting a UBCD entry which uses the freedos image (
fdubcd.igz) and the
ubcdcmd= parameter to grub4dos syntax.[/size]
e.g.:
Code:
MENU LABEL Intel Processor Frequency ID V7.2.20041115 (P3 and below)
TEXT HELP
Reports information about your Intel CPU, including brand name, rated and
tested speed, cache memory, technologies and classification. Supports older
Intel CPU (P3 and below).
ENDTEXT
KERNEL memdisk
APPEND initrd=/ubcd/images/fdubcd.igz ubcdcmd=intelfid
Luckily for us, the “default” and “savedefault” command to write an integer value into a specified file can be done multiple times in the same menu entry.
Make a
menu.lst file:
Code:
# Save the value after the ubcdcmd= parameter in the grub4do*.arg files
# Because the default command only accepts numbers,
# we have to convert all characters of the ubcdcmd parameter
# to ASCII codes (only the 2 cipher ones).
#
# Each grub4do*.arg file can hold 7 ciphers at maximum,
# we can use only 6 of them because when the total number
# starts with a 0, it will be stripped by grub4dos.
# e.g.: "0123456" becomes "123456"
#
# We have 3 files to which we can save the ASCII codes (grub4do*.arg).
# So the maximum parameter name of the ubcdcmd parameter
# must be limited to 9 (3 files * 3 ASCII codes).
# The ubcdcmd parameter contains filenames of files without
# extension in the /ubcd/dosapps/ directory.
# The limit of 9 ASCII codes won't give a problem because
# filenames in dos are limited to 8 characters
# ( + 3 for the extension).
#
#
# Use the the following table to convert the charaters after
# the 'ubcdcmd=' parameter to ASCII codes:
#
###################################################
# 0: 48 A: 65 K: 75 U: 85 #
# 1: 49 B: 66 L: 76 V: 86 #
# 2: 50 C: 67 M: 77 W: 87 #
# 3: 51 D: 68 N: 78 X: 88 #
# 4: 52 E: 69 O: 79 Y: 89 #
# 5: 53 F: 70 P: 80 Z: 90 #
# 6: 54 G: 71 Q: 81 #
# 7: 55 H: 72 R: 82 #
# 8: 56 I: 73 S: 83 #
# 9: 57 J: 74 T: 84 #
###################################################
# We treat small and capital letters the same (A=a=65).
# For dos filenames it doesn't matter if it a small or a capital letter .
title Intel Processor Frequency ID V7.2.20041115 (P3 and below)
find --set-root /ubcd/images/fdubcd.igz
map --mem /ubcd/images/fdubcd.igz (fd0)
map --hook
chainloader (fd0)+1
root (fd0)
# What follows it the replacement of the ubcdcmd=intelfid parameter for grub4dos
# Write the first 3 characters ('int') in ASCII (=737884) /args/grub4dos.arg
default (fd0)/args/grub4dos.arg
savedefault 737884
# Write the next 3 characters ('elf') in ASCII (=697670) /args/grub4do2.arg
default (fd0)/args/grub4do2.arg
savedefault 697670
# Write the last 2 characters ('id') in ASCII (=7368) to /args/grub4do3.arg
default (fd0)/args/grub4do3.arg
savedefault 7368
boot
When you type
vc (F3 to view file content) at the end of the boot process, you can find the right values in the
grub4do*.arg files.
So a script can now read and convert the
ubcdcmd parameter that is needed to unpack and launch the right package from the
/ubcd/dosapps folder.
I am no dosguru so I don't know (yet?) how to do it.
Is there a way to replace (or to add below) the following text with a help text like the
menu.c32 and
vesamenu.c32 of syslinux can do?
Code:
Use the ↑ and ↓ keys to highlight an entry. Press ENTER or 'b' to boot.
Press 'e' to edit the commands before booting, or 'c' for a command line.
@pio: do you know a way to add a help text that gets displayed when you move trough the menu, like