Jump to content











Photo

problem boot Freedos (kernel.sys) from grub4dos


  • Please log in to reply
18 replies to this topic

#1 schumy

schumy

    Member

  • Members
  • 97 posts
  •  
    Italy

Posted 03 March 2013 - 03:01 AM

Hi all

 

I have create a file .iso (boot grub4dos)

and have append in the root all the files of freedos (kernel.sys command.com etc etc)

 

in menu.lst is write:

title Boot FreeDOS
chainloader /kernel.sys

 

but not work

 

the kernel.sys boot, but say this error:

 

- InitDiskBad or missing Command Interpreter: command.com /P /E:256

Enter the full shell command line:

 

 

help please

thanks

 



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 March 2013 - 12:39 PM

Hi all

 

I have create a file .iso (boot grub4dos)

and have append in the root all the files of freedos (kernel.sys command.com etc etc)

 

in menu.lst is write:

title Boot FreeDOS
chainloader /kernel.sys

 

but not work

 

the kernel.sys boot, but say this error:

 

- InitDiskBad or missing Command Interpreter: command.com /P /E:256

Enter the full shell command line:

 

 

help please

thanks

Well, you are falling in a "common" misunderstanding.

 

There is NO CDFS filesystem support in the FreeDOS kernel (as well as there is none in MS-DOS' one).

 

Simply the kernel cannot find the file command.com (as it resides in an unknown filesystem).

 

You need to use a floppy, super-floppy or HD-like image booting FreeDOS, which kernel ONLY supports FAT12/16 and FAT32.

 

The CDFS filesystem support is added through an external driver such as SHSUCDX (for "real" CD's) or the other "companion apps":

http://www.oocities....ucdx/index.html

but this support is added by executing Autoexec.bat and Config.sys (which are executed by command.com when loading), I hope you can see the CATCH22 here ;).

 

:cheers:

Wonko



#3 schumy

schumy

    Member

  • Members
  • 97 posts
  •  
    Italy

Posted 03 March 2013 - 01:50 PM

thanks for answer

 

but how can I create a HD-like image for booting freedos?



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 March 2013 - 02:22 PM

thanks for answer

 

but how can I create a HD-like image for booting freedos?

WHY EXACTLY you need a HD-like image?

WHY the (much simpler) floppy image won't do for you?

 

Anyway, the simpler way is detailed here (just use Freedos instead of MS-DOS):

http://reboot.pro/to...able-dos-image/

 

:cheers:

Wonko



#5 schumy

schumy

    Member

  • Members
  • 97 posts
  •  
    Italy

Posted 04 March 2013 - 12:20 AM

I need of hd-like image because must append 12mb of files



#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 04 March 2013 - 11:41 AM

Can you explain some more details please.

You say you want to create an ISO file - but why? Are you trying to make a bootable CD?

 

 

One easy way to make and test a hard disk image is to use RMPrepUSB

 

1. Format a USB Flash drive as FAT16  (no overrides) and minimum capacity that you need - e.g.  12MB

2. Add freedos files as required + Install grub4dos using RMPrepUSB

3. Test using RMPrepUSB  F11  QEMU test button

4. When it is all working, use RMPrepUSB  Disk->File  to make an image file - e.g. hdd.img

5. Save hdd.img to your hard disk

 

To use the hdd.img, make a slightly larger USB Flash drive volume (say 14MB - it is easier if you have another USB flash drive to do this with), then

add the hdd.img file and install grub4dos and add this menu.lst file.

Test using RMPrepUSB  F11.

 

title HDD.img\nFreeDOS hard disk image file
map --mem /hdd.img (hd0) || map /hdd.img (hd0)
map --hook
#look for a file inside the image and set device as the root device
find --set-root /kernel.sys
#load and boot using DOS bootloader
chainloader ()/kernel.sys

 

now make your ISO file by following these instructions and using the makegrub4dosiso.cmd script.
Test using RMPrepUSB  CTRL+F11
Finally burn your CD.
 
P.S. You may also find this useful.


#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 March 2013 - 11:54 AM

Just for the record - the actual limit for a floppy disk image (remaining bootable as an El-Torito floppy emulation image) has been found to be 37,748,736 bytes:

http://www.msfn.org/...oppy-emulation/

 

 

 

 

Which media type do you need for a super-floppy larger than the 2.88 Mb?
Standard ones are:

  • 0x00 - No Emulation
  • 0x01 - 1.2 Mb floppy
  • 0x02 - 1.44 diskette
  • 0x03 - 2.88 diskette
  • 0x04 - Hard disk emulation

 

0x03: 1024*2*36 * 512 = 37,748,736
0x02: 1024*2*18 * 512 = 18,874,368
0x01: 1024*2*15 * 512 = 15,728,640

 

:cheers:

Wonko



#8 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 04 March 2013 - 12:04 PM

Also, (on the topic of floppies, superfloppies, Dos), was gonna post elsewhere,

 

from dos + grub.exe, you can

(using Chenall FAT tool)

 

Map (md) 0x300+0x1000000 (fd1) (check sizes, see posts below)

map --hook

fat mkfs (fd1)

fat mkfile size=10000 (fd1)/img

map --mem (fd1)/img (fd0)

map --hook

fat mkfs (fd0)

 

(see sizes in Wonko's post)

(md) is multiple 32. Fat filesize is in bytes.

 

Edit

No need to map --mem, the img, as you wanna be able to save changes..

 

Edit, posted elsewhere.

 

Edit, but I think Schumy you are working from Windows, so, consider this just as "additional info", or

 "future ref".



#9 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 04 March 2013 - 06:16 PM

Hi Bertrand

I tried your commands above but I am not having much luck.

The number in 

 

map (md) 0x300+0x1000000 (fd1)

seems rather large  (MD is in sectors so = over 5GB

If I reduce this to 0x100000  then it works up to the last line when I get

 

 

FAT Error: (1) A hard error occured in the low level disk I/O layer

 

I get the same error on a real system and under QEMU.

Any idea what I am doing wrong?



#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 March 2013 - 06:57 PM

Any idea what I am doing wrong?

I would have thought :dubbio: that you were far more familiar than Betrand with the tools involved:

http://reboot.pro/to...a-drive-in-ram/

http://reboot.pro/to...n-ram/?p=148529

I would therefore and anyway assume the quoted as a rhetorical question   :unsure:

 

:cheers:

Wonko



#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 04 March 2013 - 07:15 PM

No, it's not rhetorical. The commands should work (if I reduce the size of the ramdrive) but don't. So I wonder if there is a typo somewhere?? 



#12 schumy

schumy

    Member

  • Members
  • 97 posts
  •  
    Italy

Posted 04 March 2013 - 07:46 PM

Can you explain some more details please.

You say you want to create an ISO file - but why? Are you trying to make a bootable CD?

 

 

One easy way to make and test a hard disk image is to use RMPrepUSB

 

1. Format a USB Flash drive as FAT16  (no overrides) and minimum capacity that you need - e.g.  12MB

2. Add freedos files as required + Install grub4dos using RMPrepUSB

3. Test using RMPrepUSB  F11  QEMU test button

4. When it is all working, use RMPrepUSB  Disk->File  to make an image file - e.g. hdd.img

5. Save hdd.img to your hard disk

 

To use the hdd.img, make a slightly larger USB Flash drive volume (say 14MB - it is easier if you have another USB flash drive to do this with), then

add the hdd.img file and install grub4dos and add this menu.lst file.

Test using RMPrepUSB  F11.

 

title HDD.img\nFreeDOS hard disk image file
map --mem /hdd.img (hd0) || map /hdd.img (hd0)
map --hook
#look for a file inside the image and set device as the root device
find --set-root /kernel.sys
#load and boot using DOS bootloader
chainloader ()/kernel.sys

 

now make your ISO file by following these instructions and using the makegrub4dosiso.cmd script.
Test using RMPrepUSB  CTRL+F11
Finally burn your CD.
 
P.S. You may also find this useful.

 

 

thanks

 

I have create a virtual disk in virutalbox

after boot with livexp and with selfimage I have create the files .img

 

and in grub4dos --- menu.lst have used: (post of Steve6375)

title HDD.img\nFreeDOS hard disk image file
map --mem /hdd.img (hd0) || map /hdd.img (hd0)
map --hook
#look for a file inside the image and set device as the root device
find --set-root /kernel.sys
#load and boot using DOS bootloader
chainloader ()/kernel.sys

 

and works perfect

 

thanks to all


Edited by schumy, 04 March 2013 - 07:47 PM.


#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 March 2013 - 08:01 PM

No, it's not rhetorical. The commands should work (if I reduce the size of the ramdrive) but don't. So I wonder if there is a typo somewhere?? 

Let's try "from scratch" (based on the reports on the mentioned thread and using some "common sense").
 
 

find --set-root /fat
insmod /fat
map --mem (md)0x800+0x5000 (fd1)
map --hook
fat mkfs (fd1)
fat mkfile size=1474560 (fd1)/test.img
map --mem (fd1)/test.img (fd2)
map --hook
fat mkfs (fd2)
 
 
What makes/made NO sense whatsoever :ph34r:  is/was the size=10000 as size for the fat mkfile command is expressed in bytes.
 
Probably that is what the misunderstanding is about :unsure:.
 
:cheers:
Wonko

#14 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 05 March 2013 - 09:54 AM

By experimentation, there is minimum size required for  fat mkfs to work.

Examples below give a 'FAT Error:   (1)  A hard error occured in the low level disk I/O layer'  just after echo 0.

If you increase the value by one byte they will work (tested under QEMU).

title test  not --mem
find --set-root /fat
insmod /fat
map (md)0x800+0x5000 (fd1)
map --hook
fat mkfs (fd1)
# 65024 fail, 65025 ok,
fat mkfile size=65024 (fd1)/test.img
map   (fd1)/test.img (fd2)
map --hook
echo 0
fat mkfs (fd2)
echo 1
fat mkfile size=100 (fd2)/testfd2.img
ls (fd2)/
pause
commandline

title test --mem
find --set-root /fat
insmod /fat
map (md)0x800+0x5000 (fd1)
map --hook
fat mkfs (fd1)
# 61440 fail, 61441 ok,
fat mkfile size=61440 (fd1)/test.img
map  --mem (fd1)/test.img (fd2)
map --hook
echo 0
fat mkfs (fd2)
echo 1
fat mkfile size=100 (fd2)/testfd2.img
ls (fd2)/
pause
commandline

 

 

 



#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 March 2013 - 12:55 PM

By experimentation, there is minimum size required for  fat mkfs to work.

Yep :), point being WHAT would be the use of a 64 Kb (or less) floppy image FAT formatted?

The smallest floppy ever in use was 80 Kb, and the smallest ever on a PC copatible was 160 Kb:

http://en.wikipedia....py_disk_formats

 

:cheers:

Wonko



#16 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 05 March 2013 - 05:31 PM

Hi,

not much time to reply,I thought 1000000 was a bit big, but then these days people have 5gb of ram, right?

No, I just wrote top of the head, couldn't remember scale of numbers.

 

I always work btw with about 60mb (md).

 

 

*But I knew anyone interested would test, as anyway I had done it (with positive result). Also, This has also put into light some 'limit', or difficulty (I had experienced in the past) with bigger than circa 26000 size.

Thanks.



#17 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 March 2013 - 05:47 PM

Hi,

not much time to reply,I thought 1000000 was a bit big, but then these days people have 5gb of ram, right?

No, not really.

And in any case it is a form of racism/classism to all the people that has them not (possibly because they cannot afford a newish/powerful machine) :(, besides, if for doing something "10000" is *needed* (in the sense of it being the bare minimum requirement) using "1000000" is wasting resources. :frusty:

 

No, I just wrote top of the head, couldn't remember scale of numbers.

Yep, we did notice that. :ranting2:

 

The general idea when posting suggestion/hints should be of being pretty d@mn sure of what you write for THREE reasons:

  1. respect for the time that the person which you are trying to help may loose
  2. respect for the time lost by the other peeps that will believe your post to contain correct data
  3. respect for the time lost by the other that will NOT believe your post to contain correct data AND will need to find themselves the solution

Of course a mistake or a typo can happen to everyone :), but posting "random" numbers? :w00t:

 

 

:cheers:

Wonko


  • steve6375 likes this

#18 betrand

betrand

    Frequent Member

  • Advanced user
  • 467 posts
  •  
    France

Posted 05 March 2013 - 05:51 PM

I thought 1000000 was a bit big, but then these days people have 5gb of ram, right?

 

_joke_. Understatement /overstatement.  Grrrr.

 

The general idea when posting suggestion/hints should be of being pretty d@mn sure of what you write for THREE reasons: respect for the time that the person which you are trying to help may loose respect for the time lost by the other peeps that will believe your post to contain correct data respect for the time lost by the other that will NOT believe your post to contain correct data AND will need to find themselves the solution

Yeah, I agree, sorry.

 

Of course a mistake or a typo can happen to everyone , but posting "random" numbers?

Not at home, remembering scales of numbers I rarely use, I used a week ago, when out, is difficult.

 

These kinds of numbers are for me, just on the verge of understandable, though the method, creating a ramdrive,

then a file, and putting this file as an FS, is more understandable.

 

Also, on prev post, I added a *.



#19 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13750 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 March 2013 - 06:27 PM

Yeah, I agree, sorry.

No prob :) everything is fine and dandy, no living being was harmed in the making of these posts ;), and the sun is shining (actually no, here it is raining :(), but maybe you could edit your original post specifying more clearly how the (md) parameters/addresses represent sectors, while the fat mkfile ones represent bytes.
 
Since a FAT 12/16 filesystem tends to occupy (VERY roughly, and using TWO fat tables) a small fraction of the total size varying between 0.03% and 2.19% we can apply a rule of the thumb saying that n in :
 
 

(md)0x800+0xn

can be as small as Dec2Hex(1.03*(m/512)) where m is the value in:
 
 

 

fat mkfile size=m (fd1)/test.img

 

and any m smaller than 163,840 (the size of the smallest floppy ever used on PC compatibles, 160 Kb) makes very little or no sense.


 
:cheers:
Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users