Jump to content











Photo
- - - - -

Start FreeDOS from non 1st partition


  • Please log in to reply
16 replies to this topic

#1 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 31 January 2010 - 11:27 PM

Does FreeDOS kernel always assume command.com is on the 1st disk (mapped as C:)? Can one change it on boot time to support more portable, not hard coded paths (like (hd32)\command.com)?

#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 February 2010 - 08:52 AM

I don't think you can do anything without a drive letter.

Command.com location can be given in config.sys/fdconfig.sys:
http://help.fdos.org...ch/autoexec.htm
using the SHELL command.
http://help.fdos.org...igsys/shell.htm
or the SHELLHIGH one:
http://help.fdos.org...gsys/shellh.htm

:cheers:

Wonko

#3 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 01 February 2010 - 12:24 PM

Well, you can omit drive letter:
SHELL=command.com
or
SHELL=\command.com
works but it is able to find command.com only on drive C:. That's strange.

Kernel knows from which disk it was booted. I need a way to get this drive letter (or set it myself like BOOT_DRIVE=Q). Without it FreeDOS cannot be fully portable. If I boot it not from USB stick but directly from USB HDD (lets say 2nd or 3rd physical disk) it won't work.

#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 February 2010 - 01:04 PM

I would it call it "normal" instead of "strange".

And that's is exactly the idea of booting it from an image (knowing which drive letter will get) or of grub4dos re-mapping/partnew and all the other tricks.

Normally DOS - any DOS, including FreeDos, needs "by design" to have the kernel (IO.SYS+MSDOS.SYS or kernel.sys or IBMBIO.COM, etc.) on first partition of first drive, BUT:
http://www.911cd.net...showtopic=22884
http://wiki.fdos.org...ation/Partition
http://www.freedos.o...chnote/145.html

But you are in a CATCH 22, as you need config.sys to point to command.com anyway. :cheers:

In other words, at the moment we have a bunch of (relatively) easy documented ways (through grub4dos) and a non-fully working method to "place" FreeDos NOT-on-first-primary.

Most probably the latter can be made working with some additional grub4dos trick, like directly editing the RAM, but really cannot say.

;)

Wonko

#5 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 01 February 2010 - 01:41 PM

I see. So maybe better idea is to have a FreeDOS "superfloppy" instead of HDD image. It should give better compatibility and portability as drive "A:" is usually not used on recent PCs. How do you think?

#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 February 2010 - 02:48 PM

I see. So maybe better idea is to have a FreeDOS "superfloppy" instead of HDD image. It should give better compatibility and portability as drive "A:" is usually not used on recent PCs. How do you think?

Yes, though I don't thing there will be that much difference in using a superfloppy as A:\ or a "whole HD" image as C:\.
I guess the only "advantage" would be that of not shifting drive letters, but due to possibly NTFS volumes and what not I presume saome letter changes will happen anyway.

Now the question is, will "superfloppy" images be limited to the "canonical" ones?:
http://www.911cd.net...showtopic=10853
http://www.911cd.net...showtopic=11096
http://www.911cd.net...showtopic=21212


And if yes, would the "8.10":
http://www.911cd.net...o...10853&st=18
be big enough?

Or grub4dos mapping an image to (fd0) has no size limits?

Up to you to experiment with :cheers:.

;)

Wonko

#7 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 02 February 2010 - 11:57 AM

8.1 limit for floppy? I don't see any problem to make it bigger.

With mkdosfs and dd command I've made 11.5MB (8x1.44) bootable image:
C=160
H=4
S=36

160*4*36 = 23040 sectors = 11520 kB

It boots with syslinux/memdisk and grub4dos. I had some problem with FAT16 (FreeDOS didn't like it) but FAT12 works well.

fat.png

#8 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2010 - 12:50 PM

Good. :cheers:

It boots with syslinux/memdisk and grub4dos. I had some problem with FAT16 (FreeDOS didn't like it) but FAT12 works well.

Maybe you had a problem with FAT16 06 or 0E, most probably a 04 type should do :cheers: (or viceversa):
http://www.win.tue.n...on_types-1.html

:cheers:

Wonko

#9 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 02 February 2010 - 01:12 PM

Generally floppy hasn't MBR/VBR like HDD but simple boot sector, usually FAT one (http://en.wikipedia....llocation_Table), so this field is not present. This makes "superfloppy" format I believe.

Maybe msdosfs cannot make correct FAT16. But I cannot see any other tool that can format such big floppy.

Anyway I think the only limit for size of floppy image is 65526 sectors (~32MB). Such big image is enough for most needs.

#10 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2010 - 01:43 PM

Generally floppy hasn't MBR/VBR like HDD but simple boot sector, usually FAT one (http://en.wikipedia....llocation_Table), so this field is not present. This makes "superfloppy" format I believe.

Maybe msdosfs cannot make correct FAT16. But I cannot see any other tool that can format such big floppy.

Anyway I think the only limit for size of floppy image is 65526 sectors (~32MB). Such big image is enough for most needs.


Well, you seem like missing one point. :cheers:

AFAICR, the 01 and 04 types use certain fields in the bootsector (besides the code in the partition table), i.e. the so called "Small sectors", whilst 0B/0E use the so called "Large sectors" field.

A number of tools can format that superfloppy.
As an example you can mount it in IMDISK and format it allright under 2K/XP and later, and then SYS it in a VM to have the FreeDos bootsector (or directly use the grub4dos one), but I think that the 04 type is never made. (I guess 04 is the less used partition type/filesystem ever used by DOS, in practice only after release of 3.3 and before release of 4.0, some 16 months between 1987 and 1988)

Essentially FAT1x partitions are the same kind:
01 - FAT12 up to 16 Mb
04 - FAT16 up to 32 Mb
06 - FAT16 up to 2Gb (CHS mapped) <-and extensible in a NON-DOS-standard way, using 64 Kb clusters, up to 4 Gb
0E - FAT16 up to 2Gb (LBA mapped) <-and extensible in a NON-DOS-standard way, using 64 Kb clusters, up to 4 Gb

There is NO difference whatsoever between a 06 and a 0E partition, once we exclude the difference of code in the MBR (which we don't have).

Wonko

#11 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 02 February 2010 - 01:59 PM

The problem is I cannot see the filed you are talking about. Please give me it's hex offset from this table: http://en.wikipedia....ble#Boot_Sector
This is a common floppy FAT boot sector. If you talk about different boot sector I believe it is not a floppy anymore... Maybe grub4dos can make a magic to fool BIOS that a HDD image is a floppy image (replacing boot sector on the fly) but memdisk cannot and I use syslinux/memdisk by default.

If I mount EMPTY image (big one) under windows, it won't format it as a floppy but as a HDD with one partition (I've tested). That's not what I need.. If It saw floppy sized image (like 1.44) then it would format it like a floppy.

#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 February 2010 - 02:45 PM

The problem is I cannot see the filed you are talking about. Please give me it's hex offset from this table: http://en.wikipedia....ble#Boot_Sector
This is a common floppy FAT boot sector. If you talk about different boot sector I believe it is not a floppy anymore... Maybe grub4dos can make a magic to fool BIOS that a HDD image is a floppy image (replacing boot sector on the fly) but memdisk cannot and I use syslinux/memdisk by default.

If I mount EMPTY image (big one) under windows, it won't format it as a floppy but as a HDD with one partition (I've tested). That's not what I need.. If It saw floppy sized image (like 1.44) then it would format it like a floppy.

Try using Tiny Hexer and it's built-in Structure Viewer for FAT16 (my BSview is still experimental and right now not tested/refined, but will do as well):
http://www.boot-land...?showtopic=8734

However offset is 0x13 19dec for Small sectors and 0x20 32dec for Big sectors.

Mounted with what? :cheers:
Which Windows?

AFAICR, if you mount an empty image with IMDISK or VDK it won't put a MBR in it by sheer magic. (or I 've lost several days of my time to write MBRBATCH :cheers:)

Wonko

#13 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 02 February 2010 - 04:38 PM

However offset is 0x13 19dec for Small sectors and 0x20 32dec for Big sectors.

0x13 - Total number of sectors
0x20 - Total number of sectors (if greater than 65535; otherwise, see offset 0x13)

You was talking about partition type signature so I may misunderstand you. So 0x20 is used when > 16MB otherwise both FAT12 and 16 should use number from 0x13. In my case (~12MB) so it doesn't matter because 0x13 is used. In my previous post I wrote that FAT16 was not stable under FreeDOS /couldn't copy files on it/ FAT12 works well. I can't see any connection between this and 0x13/0x20 as I use < 16MB image.

Mounted with what?
Which Windows?

ImDisk
win xp sp3 pro en

#14 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 03 February 2010 - 08:04 PM

Yep, a difference in terminology used, but we are saying the same thing. :cheers:
As I see it:
01 means a FAT12 partition <16 Mb using "Small Sectors"
04 means a FAT16 partition >16 Mb and <32 Mb using "Small Sectors"
06 means a FAT16 partition >32 Mb using "Big Sectors"
0E means a FAT16 partiion >32 Mb using "Big Sectors"
(the last two being EXACTLY the same if we do not consider the MBR)

It seems to me like you are indirectly confirming my guess.

From what you report, FreeDOS doesn't "like" FAT16 partitions (identified by the string "FAT16" at offset 0x36 or 54 Dec) when it uses the "Small sectors", while it "likes" the exact same thing, if it is identified by the "FAT12" string.

In other words, you should be able to replicate the "good" and the "bad" behaviour of FreeDos by simply changing the "FAT12" in "FAT16" on your image. :P

This should give problems if anything is above 16 Mb and below 32 Mb, but since your partition is around 12 Mb, you can use FAT12 and be happy with it. :P

About the MBR issue.

Try this test.

Create a sparse file on a NTFS partition using mksparse (or a "full" file using fsz or any other utility), sized 16,450,560 bytes.

Mount it in IMDISK.

Format it from within IMDISK.

Is the resulting file having as first sector a MBR or a bootsector? :cheers:

(or detail how you managed to have a MBR written to youtr image ounted through IMDISK)

:cheers:

Wonko

#15 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 03 February 2010 - 11:16 PM

I see. All clear now.

Yes I was wrong, win xp doesn't create MBR in these images.

Generally I use linux (ploplinux for USB boot). I needed DOS only for BIOS update and two great tools: Ranish Partition Manager and MHDD scanner. Btw. do you know any way to make RPM and/or MHDD run without DOS (like memtest86 for example)? I'm asking because CDSHELL (you probably know it http://www.cdshell.org) has a module for Ranish which is loaded instantly without DOS. And Syslinux is able to load some special DOS executables (.com)

#16 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 04 February 2010 - 10:10 AM

Btw. do you know any way to make RPM and/or MHDD run without DOS (like memtest86 for example)? I'm asking because CDSHELL (you probably know it http://www.cdshell.org) has a module for Ranish which is loaded instantly without DOS.

Yes. ;)
http://homepages.tes...no-answers.html

.... but why don't you "follow the stream instead of swimming against it"? :cheers:
Ideas (in order of decreasing complexity):
  • Try writing a loader for RPM....;)
  • Try creating a very small .iso with CDSHELL and RPM and try booting from it mapped as (0xFF) or (hd32)......:P
  • Then try creating a DOS RPM floppy and map it as (fd0) or (fd1) or try creating a "full" hd image with Ranish partition on it...... :P
  • Then try using the "A" option to create a bootfloppy loading part.exe. (press F1 for help while in RPM) :cheers:
Then:
  • try booting from this floppy image.
  • get the bootsector from the floppy and try chainloading it with grub4dos on a grub4dos floppy.
  • compare the bootsector of the two floppies....
  • make a copy of your 12 Mb superfloppy's bootsector and:

    • save the serial number 0x0D up to 0x50
    • overwrite from 0x3E up to the end of it (0x200) with the corresponding code copied from the RPM floppy. ;)
    • restore the serial number
  • chainload from grub4dos. :P

Sometimes the easyness of chainloading a bootsector is forgotten, shadowed as it is by other grub4dos capabilities.....

For MHDD, I don't think there is ANY way. :cheers:
But using the "Magic Disk" floppy image should work. :P

:cheers:

Wonko

#17 erketre

erketre

    Newbie

  • Members
  • 15 posts
  •  
    Poland

Posted 04 February 2010 - 10:33 AM

OK, I will try the most complex one because it works the way I need. I thought someone else has written something like that but if not, I will try.
Thanks again




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users