Adding Drivers - Part 1

Adding initial drivers

As mentioned in the previous blog post, this basic DOS machine still has some flaws.
  • One CPU core fully utilized
  • No CDROM / DVD image support
We will fix these two now. Let's see how far we get. We might add some more stuff if time permits. As a prerequisite one additional floppy disk image will be needed. This is a custom compilation. The individual pieces are all available somewhere on the Internet for download. So feel free to use alternative sources.

Right click the disk image below and save it somewhere on your host machine.

First changes to autoexec.bat

When you clicked through the full MS-DOS 5 installation without making any adjustment, you will likely have the DOSshell enabled. The automatic startup of DOSshell has been removed in MS-DOS 6.x (as far as I know).

Disadvantage of the DOSshell: we cannot see what drivers and programs are loaded during system startup as the result is immediately hidden by the DOSshell. Therefore we will turn it off for the moment. If you like it, you can still enable it again later on. To do this we will have to manipulate the autoexec.bat file (.bat stands for batch file).

To leave DOSshell and return to plain DOS, press ALT-F4 or go via the menu by pressing ALT-F (to trigger the file menu) and then choose "x" to exit.

On the command prompt type
edit autoexec.bat
This will bring up the DOS editor and will allow you to change the autoexec.bat file.

Depending on your language configuration, the content may be slightly different. To comment out a command inside a batch file, add the "REM" (remark) keyword at the beginning of the line as shown in the picture. The last line of your autoexec.bat should now read
REM C:\DOS\DOSSHELL
Close the editor (Alt-F4) and confirm that the file will be saved.
Reboot your box by selecting "Machine" - "Reset" from the Virtualbox menu.

Now we can see what is going on during our boot process.

Copying everything to our virtual hard drive

Next we will insert the floppy disk image.
And now it is time to use the first real DOS commands. First of all we will be checking what is on that floppy disk.

To do so, type "dir A:" and the result should look something like this:

C:\>dir a:

 Volume in drive A has no label
 Volume Serial Number is 1AFC-214B
 Directory of A:\

ATAPI        <DIR>     25.02.18   19:36
CTMOUSE      <DIR>     25.02.18   19:36
DOSIDLE      <DIR>     25.02.18   19:37
        3 file(s)          0 bytes
                      978432 bytes free

C:\>

Now we know what is on the diskette image.
  • ATAPI - the content of this directory will enable the CD / DVD ROM
  • CTMOUSE - this will turn on mouse support in DOS mode
  • DOSIDLE - this will solve the CPU issue and make DOS a virtual machine friendly OS
We will keep the directory structure of the floppy with its three sub-directories and my proposal is, to put everything into a sub-structure of our main OS which lives under C:\DOS. So the goal is to have the directories like C:\DOS\ATAPI, ... and so on.

We can achieve this using a single command
xcopy a:*.* c:\dos /s
This will copy the complete directory structure from the floppy image into the directory c:\dos. The "/s" option defines that this should be done recursively. Feel free to check by switching to one of the resulting directories (e.g. cd \dos\atapi) and checking the content (dir).

Modifications to config.sys

We will be adding the IDE driver for the CD / DVD ROM to our machine. Bring up the editor using the command
edit c:\config.sys
This will open the current configuration. Add the ATAPI (IDE CDROM) driver. The full file should look like this:

DEVICE=C:\DOS\SETVER.EXE
DEVICE=C:\DOS\HIMEM.SYS
DOS=HIGH
COUNTRY=049,850,C:\DOS\COUNTRY.SYS
DEVICE=C:\DOS\DISPLAY.SYS CON=(EGA,,1)
FILES=40
LASTDRIVE=Z
DEVICE=C:\DOS\ATAPI\ATAPICD.SYS /D:CD001

The changes were:
  • increase maximum number of open files to 40
  • make the last valid drive letter "Z", so we can define the CD-ROM as drive X:
  • add the ATAPICD device driver (the /D:CD001 parameter gives the device a symbolic name)

Save the file and close the editor. Now let us continue with autoexec.bat.

Modifications to autoexec.bat

Inside the autoexec.bat we enable the CD-ROM. We will also turn on the mouse and we will make sure that DOS gives up CPU cycles, to behave nicely inside a virtual machine. Start the editor on the autoexec.bat and change the content as follows:

@ECHO OFF
PROMPT $p$g
PATH C:\DOS
SET TEMP=C:\DOS
MODE CON CODEPAGE PREPARE=((850) C:\DOS\EGA.CPI)
MODE CON CODEPAGE SELECT=850
KEYB GR,,C:\DOS\KEYBOARD.SYS

C:\DOS\ATAPI\MSCDEX /D:CD001 /M:15 /L:X
C:\DOS\CTMOUSE\CTMOUSE
C:\DOS\DOSIDLE\DOSIDLE -Fm1 -Apm

REM C:\DOS\DOSSHELL

As you can easily see, three lines have been added. That's it. A reboot should now show additional output.


Perfect. When you click inside the DOS VM, it will capture the mouse pointer. You can now use the mouse inside the editor for example.

Comments

Popular posts from this blog

Bootstrapping DOS inside VirtualBox

Adding Drivers - Part 2