Using Gujin Dos exe to boot to Dos?

Silver23
2009-06-12
2013-02-08
  • Silver23
    Silver23
    2009-06-12

    Hi,

    I'm looking to use Gujin to get around a BIOS restriction and boot to DOS.

    I have an old embedded system (386 SoC) that has inbuilt 512k flash boot disk. I can modify this emebdded flash disk to boot to any flavour of DOS (FreeDos/DrDos/MS-DOS etc..) without issue. (The flash drive appears as the A: drive to DOS)

    The embedded system has an IDE port. Unfortunately, it has a BIOS which can be altered at all, and comes pre-configured as having no HD. This is equivalent to select "None" for a IDE drive in a modern BIOS. Hence it is only possible to access the IDE devices directly through software which bypasses the BIOS. e.g IOmega's guest.exe program allows a zip drive to be added to the system.

    As gujin can detect IDE drives directly, ignoring the BIOS, I was hoping I could use gujin to boot to DOS on a HD added to the IDE port.

    So essentially the system would boot to DOS off it's internal flash disk, run Gujin (tiny.exe?), which would then boot another DOS off the HD on the IDE port which the BIOS has been set to ignore.

    Is this possible? I guess it would require gujin to map the IDE drive to be accessible to DOS via x80h?

     
    • Silver23
      Silver23
      2009-06-14

      I have tested booting the gujin boot disk in VMWare, and attempting to boot to FreeDos installed IDE drive, with the drive not enabled in BIOS.

      The drive and Freedos install is detected (IDE mode) - but booting returns an error 0x4 - error hiding partitions. It I disable hiding partitions in the setup, it tried to start Freedos but it hangs the VMachine instantly. Anyway round this?

       
    • Silver23
      Silver23
      2009-06-14

      I have attempted to make use the disk emulation feature of Gujin using bdi files.

      I have a FAT32 primary partition, in which I placed a copy of the Gujin boot floppy image boot.144, renamed to boot.bdi. I then set the bios to not detect hard drives.

      Booting to gujin with the boot floppy, it detects the hard drive via IDE mode, and detects the boot.bdi image as a bootable OS.

      However, when I select boot.bdi to boot, it reports:

      "Exiting Gujin without Error..."

      "Gujin1, gujin2 ERROR!Operating System not found"

      So it appears it starts to boot the image then fails?

       
    • Sorry I was a bit off Internet this weekend.
      I am not sure of what exactly your hardware is able to do, but I would first
      try to have Gujin installed the "standard" way into the inbuilt 512k flash boot disk. I mean the target would be to have either a superfloppy or a hard disk image (i.e. without or with partition) in this flash boot disk, so that Gujin would
      autodetect the flash boot and the IDE disks.
      Can you initialise the Flash the way you want (so that generating a 512K floppy image by Gujin installer and programming that in the Flash would be enough), or is the Flash only accessible from DOS? Can you acheive to boot once Linux on this board to run Gujin installer?
      Considering the problem with VMWare, it may simply be due to the fact that you
      are trying to boot DOS on the wrong disk, so DOS will hang (instead of disabling partition hiding you would need to enable disk writes).
      Considering the 3rd message, boot.144 assumes it is loaded from the BIOS disk 0x00.
      The message "Gujin1, gujin2 ERROR!Operating System not found" is in fact a message from Gujin "Gujin1, gujin2 ERROR!" telling that reading the BIOS disk 0x00 failed with a BIOS error, and a message from your BIOS "Operating System not found". It do not acheive to guess what exactly happened there.

      But to return to the main problem, is it possible to write a superfloppy image or a hard disk image into your FLASH?

      Cheers,
      Etienne.

       
      • Silver23
        Silver23
        2009-06-16

        Hi,

        Thanks for your reply. Apologies for the multiple posts - I have probably confused things slightly.

        Before I test any more with the embedded hardware (which is rather akward to test with), I am now just trying to get a simple setup working on a standard PC / Virtual Machine described below.

        1) I have a PC with a single floppy and harddrive. The HD is formated to FAT32 and has Freedos installed, which it will boot without problem. I have also placed the gujin floppy image "boot.144" to the root of this HD, renamed to "boot.bdi".

        2) If I then boot with the Gujin floppy disk, it will present me with options to boot either HD (via IDE or BIOS) and the "boot.bdi" image (IDE or BIOS). Selecting all 4 of these options result in the system booting correctly as expected. Note I have set Gujin to "enable disk writes" and "Hide Partitions".

        3) If I then go into the BIOS setup and set the disk type of the Primary IDE Master to "None" instead of "Auto", obviously I can then only boot from the floppy. Gujin then reports the option to boot the HD (IDE only) and the boot.bdi image (IDE only) - this is as expected, and what I wish to do. Unfortunately, if I select either boot the HD or boot.bdi image - the system hangs (with errors previously mentioned).

        Please let me know if you can help/need any more info, or if there are any other tests I can do.

         
    • Thanks to be more clear in what you are trying to do.
      I would say first that booting FreeDos in the HD is not possible because even if Gujin will load the MBR at the right place and run it correctly, FreeDos will later in the process try to use the BIOS to load other files - and there isn't any BIOS disk services because you have disabled them.
      For boot.bdi (former boot.144), Gujin should provide a simulated BIOS to "create" a BIOS disk which covers the boot.bdi file - but the Gujin code in main.c lines around 3000 is only able to leave a Terminate and Stay Resident assembly code which simulate BIOS/EBIOS drives from another BIOS drive or from an ATAPI drives - not from ATA drives (I did not thought of your use case).
      You should still be able to run a Linux distribution because it does not rely on BIOS (but for its initialisation - should still work), or any of the *.kgz files in install.tar.gz.
      So if your aim is to boot Linux from an IDE drive attached to your embedded system,
      it should still be possible.

      Cheers,
      Etienne.

       
      • Silver23
        Silver23
        2009-06-16

        Hi,

        Thanks for that, that clears up the problems I have been having. I suspect this means I have hit a deadend...

        I suppose it is not straightforward to add BIOS emulation for ATA drives where there is not already an IDE drive present?

        I can indeed run linux on the embedded device - unfortunately, it has some proprietry drivers&program for driving a hardwired attached LCD screen which are DOS only. It appears there is no way of booting from (or mounting a drive from) an IDE drive in DOS which is not detected by the BIOS.

        Thanks again for your help.

         
    • Hi,

      Adding BIOS emulation for ATA drives should not be too difficult but my TODO list is very long, and this use case seems to be unusual... Also for your use case, Gujin would need to provide BIOS access even when not using *.BDI files.
      Maybe a combination of Linux + DOSEMU (configured with exclusive access to I/O ports of the LCD) could work for you.

      Cheers,
      Etienne.

       
    • Silver23
      Silver23
      2009-06-17

      Thanks for that, I appreciate you adding it to your todo list... I'll try and take a look at the source but my C is rather rusty and a bit basic.

      I've looked into Qemu/dosemu option and my embedded board is rather strapped with 512K ram....

      Thanks again