Jump to content











Photo
- - - - -

UBCD5.00 (beta7) grub4dos menu


  • Please log in to reply
127 replies to this topic

#26 caze

caze

    Newbie

  • Members
  • 29 posts

Posted 19 January 2009 - 08:27 PM

jaclaz: have you already written that batch to convert syslinux .cfg menus to menu.lst entries? i would appreciate that very much!
keep on with you great work!! :)

#27 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 19 January 2009 - 08:34 PM

@ caze
A grub4dos menu will be included in the UBCD v5 final. But tinybit needs to implement the "writing-to-file feature" first. So that an easy and clean way exists to pass the ubcdcmd= parameter used by isolinux, to the fdubcd.igz image when booted via grub4dos floppy emulation.

#28 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 19 January 2009 - 08:38 PM

jaclaz: have you already written that batch to convert syslinux .cfg menus to menu.lst entries? i would appreciate that very much!
keep on with you great work!! :)


At the moment it seems like not needed, however there is already a "translation" (static) by ilko:
http://www.boot-land...?...=4486&st=11

Or were you asking for something "not-UBCD" related? :)

jaclaz

#29 caze

caze

    Newbie

  • Members
  • 29 posts

Posted 19 January 2009 - 10:38 PM

sorry if my question was not really precise. also, i am just beginning to look around and had not yet seen the post you just linked to, sorry.

what i would have liked to get was the tiny tool which ilko seemingly already has written and used to produce the menu.lst-style-files which he provides in the link you kindly posted.

this 7z-archive serves my current needs as well, however, so thank you very much.

i understand (rightly, i hope) that the passing of the ubcdcmd= args to memdisk-kernel + dosubcd.igz seems to work, so there would be no more need for me to wait for an argument parser on the ubcd side using the apparently more troublesome way both / the three of you are currently working on. thanks again thus.

EDIT: however, the files by ilko do not yet respect the new features of ubcd50b9.

#30 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 20 January 2009 - 08:27 AM

@ caze
But tinybit needs to implement the "writing-to-file feature" first.


It has already been implemented since 2009-01-11. The newly implemented dd command can be used to duplicate bytes or sectors between two existent files.

#31 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 20 January 2009 - 11:12 AM

It has already been implemented since 2009-01-11. The newly implemented dd command can be used to duplicate bytes or sectors between two existent files.


Which means we should start working? :) :)

@Icecube
I'll start working on the batch cfg2lst.cmd, time permitting.
If you have some time, please see what you can do about this:

As I see it , UBCD uses a very complex method of selecting the various booting options.

Are you in contact with the Author/Authors?

Maybe if someone could explain how all things are interconnected we can find a simple way.

For tthe time being I'll simply write a "conversion" batch.


@caze
Now all you have to do is have some patience. :)
Are you game for troubleshooting ALPHA's, and BETA's of the batch? :)

jaclaz

#32 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 20 January 2009 - 06:38 PM

Which means we should start working? :) :)

jaclaz


Sometimes I have a similar feeling. I feel I am just a horse or a car, and someone is riding or driving me on, with encouragement and praise, rather than using the whip.

#33 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 20 January 2009 - 11:03 PM

It has already been implemented since 2009-01-11. The newly implemented dd command can be used to duplicate bytes or sectors between two existent files.

I though that it wasn't ready because you didn't replayed yet.

Sadly enough, I think it isn't very useful for my purpose :), because it would involve using numbers or making 100 different files with the name of the variable that is passed to ubcdcmd when using memdisk with the right text in them.
e.g. For:
APPEND initrd=/ubcd/images/fdubcd.igz ubcdcmd=bios
We need a file named bios with the contents that we need in the getargs.bat file.
Then we can use the dd command:
dd if=()/ubcd/dosapps/grub4dos/bios of=(fd0)/getargs.bat
((fd0)/getargs.bat is not the right place on the floppy I think, but I am to lazy now to look it up).

It would be more practical if grub4dos supports some kind of echo command that can write to a file.
echo "initrd=/ubcd/images/fdubcd.igz ubcdcmd=bios" > (fd0)/somefile.txt
Where somefile.txt is a existing file of a certain lenght.

Or something (second part) like in my post 22 at:
http://www.boot-land...?...6119&st=20#

@ jaclaz: next week I have finally time.

#34 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 21 January 2009 - 02:35 AM

It would be more practical if grub4dos supports some kind of echo command that can write to a file.

echo "initrd=/ubcd/images/fdubcd.igz ubcdcmd=bios" > (fd0)/somefile.txt
Where somefile.txt is a existing file of a certain lenght.


At this moment, grub4dos lacks programming features. Maybe you also want to use features like shell variables, etc., but that is not an urgent task for now. Perhaps in the future we could in some way achieve those functions.

For the time being, you may create a file called param.txt, which includes all such strings as "initrd=/ubcd/images/fdubcd.igz ubcdcmd=bios" and so on. And then you may use dd to read the string in param.txt and write it to your destination file.

Note: dd can read and write files byte-by-byte, just by seting bs=1 in the command-line to dd.

#35 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 21 January 2009 - 03:54 PM

I don't need shell variables and the like. I only want to write some text, which is specified at the command line or in the menu.lst file, to a file inside a memory mapped floppy.

So a way similar to the DEFAULT file write approach.
For example write to an existing file of 512 bytes in the memory mapped floppy (which in the case of UBCD will contain 510 spaces and \r\n at the end (0D 0A) to satisfy dos).

writetofile ==> comparable with the default command: file to which you want to write text
savetofile ==> comparable with the savedefault command: all characters that you want to write to the file on 1 line

menu.lst entry:
[codebox]null byte: \0horizontal tab: \tformfeed: \fnewline: \ncarriage return: \r backslash: \\space: ' ' or \s ==> I invented this one. I think it will be needed if you want to write a space in the beginning of the file for some reason (assuming that grub4dos will remove spaces between savetofile word and the 'beginning' of the argument). It shouldn't be needed for the other spaces on that line. [/codebox]The thing I want is doable with the dd command, but requires much extra files. so the above mentioned way would be easier.@jaclaz and all other personsWhen the freedos image is run with memdisk, you get something similar in the [b]_getargs.bat[/b] file as:[codebox]#Remove all previous *.args files from ./ubcd/menus/grub4dos/ubcdcmd/# Second time you run this part of the script it will clean this directory so in# case that some ubcdcmd parameters are deleted from the isolinux config# file, they don't exist in this folder also)rm ./ubcd/menus/grub4dos/ubcdcmd/*.arg# Get all names of the variables passed to the ubcdcmd= parameterUBCDCMDS=`grep "APPEND initrd=/ubcd/images/fdubcd.igz ubcdcmd=" ./ubcd/menus/isolinux/* ./ubcd/menus/isolinux/hdd/* | cut -d '=' -f3 | tr -d "\r"`# Make all *.arg files which contain the contents that needs to be passed to _getargs.bat inside the memory mapped floppy. for UBCDCMD in $UBCDCMDS do echo -en "@SET initrd=/ubcd/images/fdubcd.igz\r\n@SET ubcdcmd=$UBCDCMD\r\n@SET BOOT_IMAGE=memdisk\r\n@echo A: is MEMDISK\r\n" > ./ubcd/menus/grub4dos/ubcdcmd/$UBCDCMD.argdone[/codebox]You can download the attached file instead if you want (unpack to [b]./ubcd/menus/grub4dos/ubcdcmd/[/b]).Now we can use the dd command in the *.lst files[code]dd if=()/ubcd/menus/grub4dos/ubcdcmd/ranish.arg of=(fd0)/_getargs.bat[/code]
The _getargs.bat is created in Q:\tmp\_getargs.bat (ramdisk drive, not the floppy disk image) by the getargs.com program when you run it with memdisk.
So the code inside the freedos images has to change to copy the _getargs.bat file from the floppy image to the ramdisk (or has to be executed from the floppy image itself).

Attached Files



#36 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 21 January 2009 - 04:56 PM

@jaclaz and all other persons
When the freedos image is run with memdisk, you get something similar in the _getargs.bat file as:

@SET initrd=/ubcd/images/fdubcd.igz

@SET ubcdcmd=ranish

@SET BOOT_IMAGE=memdisk

@echo A: is MEMDISK


Really? :)

http://www.boot-land...?...=6119&st=12

:)

I'll repeat the questions:

I checked the _getargs.bat file generated on Ramdrive in %TMP% when choosing "ranish":

@SET initrd=/ubcd/images/fdubcd.igz

@SET ubcdcmd=ranish

@SET BOOT_IMAGE=memdisk

@echo A: is MEMDISK

Where are the others variable catch from?
Are they needed?


In other words, I know what is the results of running getargs in autoexec.bat . :)

Can someone explain how contents of _getargs.bat are used?

If memdisk is not used should BOOT_IMAGE be set?

If memdisk is not used should initrd be set?


@tinybit
I'll check syntax for grub4dos dd command with some experiments

******************************************************************************
*** New command 'dd' to copy files ***
******************************************************************************

Usage:

dd if=IF of=OF [bs=BS] [count=C] [skip=IN] [seek=OUT]

Copy file IF to OF. BS is blocksize in bytes, default to 512. C is blocks to
copy, default is total blocks in IF. IN specifies number of blocks to skip
when read, default is 0. OUT specifies number of blocks to skip when write,
default is 0. Skipped blocks are not touched. Both IF and OF must exist.

Both IF and OF must have a leading device name, i.e., of the form `(...)'.
You may use `()' for the current root device.

dd can neither enlarge nor reduce the size of OF, the leftover tail of IF
will be discarded. OF cannot be a gzipped file. If IF is a gzipped file,
it will be decompressed automatically when copying.

dd is dangerous, use at your own risk. To be on the safe side, you should
only use dd to write a file in memory.

In some cases when writing a file in NTFS, dd might fail.

If you attempt to write a file that is not in memory by starting dd in a menu,
you will safely be refused :-)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
!!!! Caution! Both IF and OF can be a device name which stands for !!!!
!!!! all the sectors on the device. Take utmost care! !!!!
!!!!______________________________________________________________________!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Could you post some EXAMPLES rather than "plain" syntax?

I.E::
dd if=()/boot/afile.txt of=()/boot/anotherfile.txt bs=1 count=64 skip=128 seek=256

Will copy 64 bytes starting from offset 128 in file ROOT/boot/afile.txt to offset 256 of file ROOT/boot/anotherfile.txt? :)

Are the defaults 0 for skip and seek?
Is bs default 512 bytes?

jaclaz

#37 caze

caze

    Newbie

  • Members
  • 29 posts

Posted 22 January 2009 - 06:08 PM

@jaclaz:

@caze
Now all you have to do is have some patience.
Are you game for troubleshooting ALPHA's, and BETA's of the batch?"

of course i would try to. i seem to be among the unhappy ones for which memdisk does not work. my workaround is using "menu" at dos prompt. already very useful. (i just posted a note on my current situation as a beginner in these things. i would much appreciate it if you could have a look especially on the last few lines there in case you find the time.) (i did not yet understand how you plan to tell dos-/fdubcd what it should do. maybe you write to a file on an emulated ramdrive partition in memory, mapped e.g. as fd1, by adding contents via dd? i'll just wait and see...) good luck.

#38 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 January 2009 - 12:39 PM

@jaclaz:

of course i would try to. i seem to be among the unhappy ones for which memdisk does not work.

That would be a problem. (see below)

(i did not yet understand how you plan to tell dos-/fdubcd what it should do. maybe you write to a file on an emulated ramdrive partition in memory, mapped e.g. as fd1, by adding contents via dd?

That makes a nice, round two of us not knowing how I will do that. :cheers: :cheers:

I have more like an empirical or, if you prefer, heuristical kind of approach, once quickly checked that something should be theoretically possible in some way, I simply try and do it, one way or the other: not much planning ahead.

Result is often old style, slowish, rough, inelegant, but usually it works. :cheers:

If I can make a comparison with firearms, I like to compare my batches to AK47's:
http://en.wikipedia.org/wiki/AK-47
as opposed to smarter, sophisticated, more modern. theoretically better M16's
http://en.wikipedia.org/wiki/M16_rifle

And I like to work in little steps. :cheers:

Now, attached is a preliminary, ALPHA-ALPHA version of the batch that ONLY converts (possibly :cheers:) UBCD syslinux/isolinux .cfg files to grub4dos .lst ones, KEEPING the use of memdisk.

I very quickly tested it on a few .cfg's in ubcd50b7.iso\ubcd\menus\ checking resulting .lst files only visually.

It would be appreciated if anyone could test the batch on ALL .cfg's in the build and test the resulting .lst's with a grub4dos based build.

If everything works allright, which I doubt, or if just a few bugs are found and can be fixed, I will start thinking about another batch to process the .lst's files created by the first to either:
  • ADD for each memdisk entry a correspondent grub4dos "pure" one
  • REPLACE each memdisk entry a correspondent grub4dos "pure" one
then I will think about a way to using dd to pass the parameters....

I already found something that I have no idea on how to "translate" to grub4dos, in main.cfg:
LABEL -

MENU LABEL *Boot next device

TEXT HELP

 Boot next device in the boot sequence. Supporting BIOS required. May not work

 with all systems.

ENDTEXT

LOCALBOOT -1

And this:
CONFIG /pmagic/isolinux.cfg
Which I have to think about a little...., suggestions are welcome...B)

In the .zip file there is also a really quick and dirty other batch, called by the "main" one that will produce a <filename>.txt file with comments stripped off, that should be easier to check/read.

:cheers:

jaclaz

Attached Files



#39 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 23 January 2009 - 01:34 PM

Download ubcd50b10.iso (menus relocated to /ubcd/menus/isolinux/).
The grub4dos menus must be located at /ubcd/menus/grub4dos/.

You can use "boot from first hd" to replace "*Boot next device" if grub4dos doesn't support this. If I remember well, "LOCALBOOT -1" returns -1 to the BIOS (=device not found or no media in drive or something like that. Not all BIOSes support it.

Next beta of UBCD50 will contain the last test version of Parted Magic (or V3.5 ig it is out then).
Download from http://beefdrapes.partedmagic.com

All config files in Parted Magic are located in /boot/ (/boot/isolinux/, /boot/syslinux/, /boot/pxelinux/ and /boot/grub/).
In UBCD, they will be placed in /pmagic/boot/ (so the config files need to be changed a bit).
When you boot Parted Magic on UBCD without iso emulation (normal CD), use /pmagic/boot/grub/menu.lst.
When you boot Parted Magic on UBCD with iso emulation, use /pmagic/boot/grub/grub4dos.lst (this file will have iso_location=/boot/images/ubcd50b11.iso as extra parameter to each entry). This last entry is meant to be used outside the grub4dos menu for UBCD (so in the same menu where you can choose to boot UBCD with iso emulation).

So "CONFIG /pmagic/boot/isolinux/isolinux.cfg" will become "configfile /pmagic/boot/grub/menu.lst".

#40 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 23 January 2009 - 02:35 PM

@jaclaz

Sorry for lacking examples for dd. This dd command is newish and I have no time to check each case about its usage. So no examples are included.

The default bs is 512 bytes, which is the same as dd for UNIX.

@Icecube

I am now doing the work of improving the WRITE command to support the feature of writing a string to a file.

#41 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 January 2009 - 04:16 PM

@icecube
thanks for the hints. B)

Why you would want to add the /isolinux and /grub4dos sub-directories?

I mean, .cfg and .lst files can co-exist in same directory.

However, that's not a problem.

Still, I miss these:

Can someone explain how contents of _getargs.bat are used?

If memdisk is not used should BOOT_IMAGE be set?

If memdisk is not used should initrd be set?


@tinybit
Should we then wait for WRITE?

And is the answer to this:

I.E::
dd if=()/boot/afile.txt of=()/boot/anotherfile.txt bs=1 count=64 skip=128 seek=256

Will copy 64 bytes starting from offset 128 in file ROOT/boot/afile.txt to offset 256 of file ROOT/boot/anotherfile.txt?


a Yes?

:cheers:

jaclaz

#42 caze

caze

    Newbie

  • Members
  • 29 posts

Posted 23 January 2009 - 06:53 PM

hello again. i will have a look at your script.
concerning the larger aim, what i was assuming was that there is nothing like cat in grub4dos and what i was thinking of was something like:

#give me an : h
dd if=abcd of=job bs=1 skip=7 seek=0 count=1
#give me an : e
dd if=abcd of=job bs=1 skip=4 seek=1 count=1
#give me a : l
dd if=abcd of=job bs=1 skip=11 seek=2 count=1
#give me a : l
dd if=abcd of=job bs=1 skip=11 seek=3 count=1
#give me an : o
dd if=abcd of=job bs=1 skip=14 seek=4 count=1

where you have a file named abcd with contents:
abcdefghijklmnopqrstuvwxyz1234567890 ,.!

(it produces a file with name job and content: hello, of course. now this job file would have to be somewhere grub4dos can write to and dosubcd can read from. at least that was my idea of your plan.)

#43 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 24 January 2009 - 09:35 AM

(it produces a file with name job and content: hello, of course. now this job file would have to be somewhere grub4dos can write to and dosubcd can read from. at least that was my idea of your plan.)


Well, you had the right idea of the plan, that kind of trick is widely used in batches for use with ECHO or ECHOO.COM. :cheers:

But you forgot the best part:

#give me an : h

B)

cheerleaders!
:cheers:

Seriously, that approach would take forever, since all that is needed (maybe :cheers: - if someone would answer my questions it would be appreciated) is sometthing like:
@SET ubcdcmd=ranish
the "indexed file" instead of

abcdefghijklmnopqrstuvwxyz1234567890 ,.!

can be something like:

@SET ubcdcmd=ranish
@SET ubcdcmd=intelpiu
@SET ubcdcmd=cpuburn
....


Using dd the target file needs to be pre-existant also:

It has already been implemented since 2009-01-11. The newly implemented dd command can be used to duplicate bytes or sectors between two existent files.

and that is the tricky part, so if tinybit adds a WRITE function it would be far better/easier.

:cheers:

jaclaz

#44 caze

caze

    Newbie

  • Members
  • 29 posts

Posted 24 January 2009 - 10:21 AM

i see now a bit more. thank you. you are of course very right about it being easier to copy longer sections (i did not really mean to suggest to work per-byte :cheers: ). and all being very much easier if there was some write/print/echo function in grub4dos (i assume from your post tinybit is among the developers of grub4dos). the fact that the output file has to preexist is also stated in grub4dos readme. i had overseen that and not studied the previous posts in this thread careful enough. sorry. by the way, it also says that outputfile always stays the same in length. so one probably (?) had to copy 0d0a or some other stopsignal, too. (i also have not yet understood where inputfile and outputfile would be conveniently placed. and sorry again for interrupting your discussion here.)

#45 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 24 January 2009 - 11:23 AM

i see now a bit more. thank you. you are of course very right about it being easier to copy longer sections (i did not really mean to suggest to work per-byte :cheers: ). and all being very much easier if there was some write/print/echo function in grub4dos (i assume from your post tinybit is among the developers of grub4dos). the fact that the output file has to preexist is also stated in grub4dos readme. i had overseen that and not studied the previous posts in this thread careful enough. sorry. by the way, it also says that outputfile always stays the same in length. so one probably (?) had to copy 0d0a or some other stopsignal, too. (i also have not yet understood where inputfile and outputfile would be conveniently placed. and sorry again for interrupting your discussion here.)


Yep B), tinybit is one of the developers of grub4dos, and, without depriving anyone else of his merits, the most "communicative" and "open to suggestions/requests" one. :cheers:

Since the output file in this case is a batch, what you dd to it should be a "line" (terminated by CR+LF) and all the rest could be ":" (colons).
In batch, anything after two colons "::" and until another CR+LF is simply skipped:
http://www.robvander...m/comments.html

Input file is NOT a problem, it can be "embedded" in the grub4dos menu.lst, in the form:

#@SET ubcdcmd=ranish
#@SET ubcdcmd=intelpiu
#@SET ubcdcmd=cpuburn
#....


Creation of output file is the problem......

jaclaz

#46 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 24 January 2009 - 01:27 PM

The write command should making and changing the menus easier.

As far as I know the initrd= parameter is needed. It is used to find the right drive. Because memdisk always will give you this parameter and because the file always exists if the image can be booted in the first place, this is a great way to do it.

See my post and as702 post at: http://www.ultimateb...t...22&start=20
This code should do it (I don't understand it completely because my batch knowledge is poor). This was in one of the revisions of the freedos image, so it can be changed now. I didn't seen as702 yet, but I will ask him, if this is still the case.
:_testdrvshiftshiftif not "%cddrv%"=="" goto _eofif "%1"==""  goto _eofif "%1"==":" goto _eofcall drd.bat %1 -$if errorlevel 255 goto _eofif errorlevel 100 goto _eofgetargs | lmod /l1 /s=/ [$!] | stow drv$$$ >%tmp%\nuldir /s /b %1\*.* | tfind /f1 "%drv$$$%" >%tmp%\nulif not errorlevel 1 set cddrv=%1set drv$$$=goto _eof
I decided to put the grub4dos menu in another directory to keep everything separated and clean.

#47 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 24 January 2009 - 02:04 PM

As far as I know the initrd= parameter is needed. It is used to find the right drive. Because memdisk always will give you this parameter and because the file always exists in the image can be booted in the first place, this is a great way to do it.

OK.
What about:

@SET BOOT_IMAGE=memdisk

:cheers:



See my post and as702 post at: http://www.ultimateb...t...22&start=20
This code should do it (I don't understand it completely because my batch knowledge is poor). This was in one of the revisions of the freedos image, so it can be changed now. I didn't seen as702 yet, but I will ask him, if this is still the case.


This code is about CD drive.

The _getsrgs.bat line "@SET Variable=something" actually sets directly an environment variable, that code snippets re-runs getargs.com.

Never mind, I'll read the batches in UBCD myself.


I decided to put the grub4dos menu in another directory to keep everything separated and clean.

...and unnededly IMHO, and in one single step :cheers::
making this line (beside a few other ones) in my batch invalid in new versions:
SET ConfigfileArg=!ConfigfileArg&#58;.cfg=.lst!

If I add a line, something like:

SET ConfigfileArg=!ConfigfileArg&#58;/isolinux/=/grub4dos/!

I will lose the objective of the batch.

No problem :cheers:, but my original intention was to create something capable of translating "all" (read "most" :cheers:) isolinux/syslinux .cfg files to correspondent grub4dos .lst ones, not "only" UBCD ones, in other words I intended to use the vast number of UBCD .cfg files as a "testing ground" for a "general use" batch.

Same applies to "CONFIG /pmagic/boot/isolinux/isolinux.cfg" becoming "configfile /pmagic/boot/grub/menu.lst".

Which could be managed by an "exception", that would be non working in previous releases of pmagic and will become obsolete/not working as soon as Patrick changes something in it or someone try using a non-grub version of pmagic.

Or I will need to completely parse ALL paths, and let the batch take "decisions". :cheers: I'll think about it.


You can use "boot from first hd" to replace "*Boot next device" if grub4dos doesn't support this. If I remember well, "LOCALBOOT -1" returns -1 to the BIOS (=device not found or no media in drive or something like that. Not all BIOSes support it.


I'll also have to think about it. B)
If bootdevice is CD, First drive will remain (hd0), but not everyone has as boot partition (hd0,0) (it may be (hd0,1), (hd0,2) etc.).
And if UBCD is put on a USB device (stick or HD) and NOT booted with grub4dos and (hd32) mapping? :cheers:

:cheers:

jaclaz

#48 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 24 January 2009 - 03:39 PM

In UBCD50b10.iso it will be:
@SET BOOT_IMAGE=/isolinux/memdisk
In the isolinux menu, "kernel memdisk" changed to "kernel /isolinux/memdisk".
But the BOOT_IMAGE isn't used AFAIK (in case that it is used in the current image, changing the necessary batch files will solve this). So you don't have to worry about it.

No problem :cheers:, but my original intention was to create something capable of translating "all" (read "most" B)) isolinux/syslinux .cfg files to correspondent grub4dos .lst ones, not "only" UBCD ones, in other words I intended to use the vast number of UBCD .cfg files as a "testing ground" for a "general use" batch.

For the universal way, you will need to write another one :cheers: . But I don't have seen any ISO that uses more than one isolinux config, unless they include the other config files in the main isolinux.cfg (like Ubuntu, which use a gfxboot patched isolinux.bin, which isolinux.cfg can't be easily converted to a normal isolinux.cfg file for an unpatched isolinux.bin, when you want to preserve all options (like selecting the keyboard layout and resolution on boottime)). In most examples, your batch has to translate and convert only 1 isolinux.cfg to a menu.lst file (and makes your current line "SET ConfigfileArg=!ConfigfileArg:.cfg=.lst!" useless).

Which could be managed by an "exception", that would be non working in previous releases of pmagic and will become obsolete/not working as soon as Patrick changes something in it or someone try using a non-grub version of pmagic.

Why should you want to use an old version of Parted Magic inside the UBCD iso? If you want to use an old version, just use the Parted Magic iso as a single entity. In the isolinux version of Parted Magic, the grub4dos menu is located at /boot/grub/menu.lst or /boot/grub/grub4dos.lst. In UBCD, it will be located at /pmagic/boot/grub/menu.lst and /pmagic/boot/grub/grub4dos.lst, so even if Patrick changes the location of menu.lst, it won't matter for UBCD.

If bootdevice is CD, First drive will remain (hd0), but not everyone has as boot partition (hd0,0) (it may be (hd0,1), (hd0,2) etc.).
And if UBCD is put on a USB device (stick or HD) and NOT booted with grub4dos and (hd32) mapping? :cheers:

I do know this problem. I have it on my PC when I boot from USB and want to boot from my hard disk afterwards.
That's why Victor chooses to use localboot. Sadly enough it only works on recent (whatever that means) BIOSes.
Maybe tinybit adds it to grub4dos as well. We can also remove this option in the grub4dos menu.

Tuesday, I finally will have time to look deeper into all this stuff.
I hope I can reach as702 to ask him how the last freedos image works exactly. He did change a lot of things with each revision, so the forum posts don't always represent the way it works now.

@tinybit
Let us know something when the write command is fully implemented.

#49 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 24 January 2009 - 04:12 PM

@tinybit
Should we then wait for WRITE?


Already done(2009-01-24), but use it with care, please.

download at http://grub4dos.nufans.net/ or http://download.gna.org/grub4dos/

And is the answer to this:
I.E::
dd if=()/boot/afile.txt of=()/boot/anotherfile.txt bs=1 count=64 skip=128 seek=256

Will copy 64 bytes starting from offset 128 in file ROOT/boot/afile.txt to offset 256 of file ROOT/boot/anotherfile.txt?

a Yes?


Yes.

#50 caze

caze

    Newbie

  • Members
  • 29 posts

Posted 24 January 2009 - 04:55 PM

wow! that is fabulous! thanks a lot! (could you also provide src for this?)
EDIT: you must have done that in the meantime. thank you again!

btw, i had a quick look at the contents of fdubcd.igz. %ubcdcmd% seems to be evaluated in the 2 batches in /LEVEL3/AUTORUN3/BIN in the way of going to %ramdrv% and just executing %ubcdcmd%.
/bin/getargs.com looks for memdisk. if called without parameters, getargs.com outputs all that has been set as memdisk parameters param1=setting1 in the form SET param1=setting1
plus it returns following errorcodes:
0 -> found no memdisk
1 -> found memdisk on A:
2 -> found memdisk on B:
3 -> found memdisk on C:
etc
16 -> inside Windows
if run as getargs [0-9], checks on A:, B: etc and returns 0 -> none, 1-63: sectors, 64-127 LBA
if run as gerargs M:, returns 0-2 for no memdisk or old version and 3-n for "boot loader IDS"

EDIT: see below for one way of mapping.
in case it's okay to change the batches inside fdubcd, what i would be thinking of would be something like the following. EDIT: works for me. changed it a little in the meantime

change /autoexec.bat (using winimage or the tool you prefer) like this:

[codebox]...set _linux=rem here beginning changes for grub4dos fd0 chainloadingset avoid_getargs=0call setargs.batif "%avoid_getargs%"=="1" goto argssetif not exist %ramdrv%\bin\getargs.* goto _ngetargsgetargs >nulif errorlevel 3 if not errorlevel 4 set _memdisk=3if errorlevel 2 if not errorlevel 3 set _memdisk=2if errorlevel 1 if not errorlevel 2 set _memdisk=1:_ngetargsif "%_memdisk%"=="" goto _nmemdskecho AUTOEXEC: MEMDISK(%_memdisk%)getargs M >nulif errorlevel 52 if not errorlevel 53 set _linux=4if errorlevel 51 if not errorlevel 52 set _linux=3if errorlevel 50 if not errorlevel 51 set _linux=2if errorlevel 49 if not errorlevel!50 set _linux=1:argssetrem here end changes for grub4dos fd0 chainloadingif not "%_linux%"=="" echo AUTOEXEC: (%_linux%)LINUX...[/codebox]create a file /bin/setargs.bat with this content:[code]@echo offrem this file sets the parameters needed by fdubcd directlyrem from grob4dus instead of using getargs.comset avoid_getargs=0rem ....................................andmoredots....[/code]then in case we want something from fdubcd, we write to the last file like:[code]write &#40;fd0&#41;/bin/setargs.bat @echo\x20off\nset\x20avoid_getargs=1\nset\x20ubdcdcmd=ranish\nset\x20_memdisk=1\nset\x20_linux=\nrem\x20.....severaldots...&#40;[/code] (?)

EDIT: some errors corrected in the above example.
(please note i am just beginning to understand these things)




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users