Patching IBM DOS 5 for the PCjr

Software related questions

Patching IBM DOS 5 for the PCjr

Postby Brutman » Sun Feb 05, 2012 3:11 pm

Alan tried running a newer DOS on the PCjr and it failed pretty miserably. The last officially supported DOS for the PCjr is 3.3, although 4 is reputed to work out of the box. DOS 5 does not support the PCjr out of the box, but it can be patched to run. Rather than make a new web page of this, I'm going to stick the instructions here and see if Google indexes it.

(Maybe it's time for a Wiki ...)

Anyway, here we go .. The patch is fairly simple. The standard PCjr BIOS locates the video memory starting at 112KB and it takes 16KB. That means that DOS and all of your code and TSRs have to live within the first 112KB of memory. On an expanded machine BIOS will count up to 640KB, but will still tell DOS that only 112KB is available. That is because it always puts the video memory in the same place regardless of how much memory you have. Device drivers like JrConfig move the video buffer lower and force DOS to load above it, giving DOS access to a large chunk of contiguous memory.

Here is what you need to do to get IBM DOS 5 to run:

  • Patch the DOS 5 boot sector to put the full memory amount in the correct location early in the boot process
  • Put stacks=0,0 in CONFIG.SYS to get around incompatible keyboard interrupt handlers that DOS 5 tries to use
  • Put JRCONFIG (or some other memory management code) in CONFIG.SYS

Let's do the patch first. Start DEBUG.COM and load the boot sector into memory:

L 0 <x> 0 1

Where <x> is the drive number to use. Use 0 for A:, 1 for B:, 2 for C:, etc.

Next, check the first three bytes:

U 0 L3

These bytes should look something like JMP 003E followed by a NOP. Assuming that they do, change the first three bytes to be a jump to 1C0:

A 0
JMP 01C0
<hit enter on a blank line to stop>

Now check the target area that we are going to put our patch code in:

D 1BF L27

Look for a string that says "Replace and press any key when ready". If there is no string there, quit now and get help. You haven't done any permanent damage yet so quitting is safe.

Assuming the string is there, change the first byte to a 0:

E 01BF 0

And now the patch code:

A 01C0
PUSH DS
MOV AX,0
MOV DS,AX
MOV AX,[415]
MOV [413],AX
POP DS
JMP 003E
<hit enter on a blank line to stop>

Finally, save the sector and quit debug:

W 0 <x> 0 1
Q

Where <x> is the drive letter that you used in the first step.

At this point the boot sector is patched and written to disk. Next setup CONFIG.SYS. The first line should be:

stacks=0,0


That line is a requirement. If you don't have it, DOS 5 will try to install its own interrupt handlers for the NMI or keyboard and those handlers are not compatible with the machine. The standard interrupt handlers in the BIOS will work just fine.

Finally, add your memory management device driver. I use JRCONFIG which can be found here: http://www.brutman.com/PCjr/downloads/jrcfg310.zip

One thing to keep in mind about DOS 5 is that it likes to count the free space on the hard drive every once in a while, whether it needs to or not. This operation takes a lot of CPU power; on a PCjr at 4.77Mhz a 100MB partition can take 10 to 15 seconds to check. You will think the machine has hung up - just be patient. One way around this is to keep your partitions small and use more than one partition.

The basic procedure is the same for all of the newer versions of DOS - find an used area with a few bytes to use for the patch, and make sure that code runs when the boot sector starts.
Brutman
Site Admin
 
Posts: 919
Joined: Sat Jun 21, 2008 5:03 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Tempest » Sun Oct 28, 2012 7:33 am

Ok I tried these instructions but had issues. I believe I patched the disk correctly (the debug part went fine), I then added the stacks line and the jrconfig driver to the config.sys (wrote the driver to the disk as well), but when I booted the disk on my jr I just got kicked out into BASIC. I tried to run the Setup.exe (just to see if I could get SOMETHING to work) I got a Data Read Error, but when I try this on my other PC I get the 'Insert disk 1 and reboot' message that I would expect. At this point I'm wondering if:

a. My disk drive is dying
b. For some reason the 360K floppies I'm making in my 1.44MB floppy drive on my other PC aren't 100% compatible with the jr (other stuff has worked though)
c. I just got a bad disk

Another quick question, when you say in your instructions:

Code: Select all
Let's do the patch first. Start DEBUG.COM and load the boot sector into memory:

L 0 <x> 0 1

Where <x> is the drive number to use. Use 0 for A:, 1 for B:, 2 for C:, etc.

I assume you mean <x> is the drive you're doing the debugging on, not the drive you're going to run the disk from on the jr. I'm doing the debug on my other PC (dos 6.22) which has the 5.25 drive as B: but obviously I'm going to run it on my PCjr with the 5.25 drive as A:.


Any ideas?
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 305
Joined: Thu Jan 14, 2010 5:43 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Tempest » Sun Oct 28, 2012 8:01 am

Well I'm getting closer. I used a different disk and now it looks like it wants to load (makes the appropriate noises), but then I get a 'missing jrconfig.sys' error (it's on there) and then a data read error.

I can't believe that all these disks are bad, maybe it IS my disk drive?
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 305
Joined: Thu Jan 14, 2010 5:43 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Brutman » Sun Oct 28, 2012 10:07 am

The <x> is the drive number of the diskette that you are patching, not the diskette that you are currently using. Imagine the case where you are booted using DOS 5 on a 386, and you are patching a copy of DOS 5 for the PCjr. You don't want to hose your working DOS 5 diskette that you are going to continue to use on the 386.

Your drive sounds like it is suffering from dirty heads and maybe rails. Clean the drive ... (carefully!)


Mike
Brutman
Site Admin
 
Posts: 919
Joined: Sat Jun 21, 2008 5:03 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Tempest » Sun Oct 28, 2012 11:29 am

Brutman wrote:The <x> is the drive number of the diskette that you are patching, not the diskette that you are currently using. Imagine the case where you are booted using DOS 5 on a 386, and you are patching a copy of DOS 5 for the PCjr. You don't want to hose your working DOS 5 diskette that you are going to continue to use on the 386.

Your drive sounds like it is suffering from dirty heads and maybe rails. Clean the drive ... (carefully!)

Yeah I figured that out the hard way. Thankfully I was able to reinstall DOS 6.22 on my other PC and it's all good.

I cleaned the rails and took a Q-tip with alcohol to the head, but both were clean. Is there something else I should check? It seems weird that it keeps saying 'bad or missing jrconfig.sys', you'd think it was random read errors that I'd get different file errors each time.
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 305
Joined: Thu Jan 14, 2010 5:43 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Tempest » Sun Oct 28, 2012 11:49 am

Progress of sorts. I copied the jrconfig.sys from a different source and now I no longer get that error. However once it goes through the jrconfig loading it just seems hang. The disk drive is spinning, but nothing happens. Does this mean the patch didn't take?
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 305
Joined: Thu Jan 14, 2010 5:43 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Fri Nov 02, 2012 12:21 pm

Tempest wrote:Is there something else I should check?


Did you try the built-in floppy diagnostic with a known good floppy?
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Fri Nov 02, 2012 12:31 pm

Brutman wrote:
A 01C0
PUSH DS
MOV AX,0
MOV DS,AX
MOV AX,[415]
MOV [413],AX
POP DS
JMP 003E



I see we're changing the value at 40:13 which is "size of memory in kbytes", but why are we setting it from the contents of 40:15? How is 40:15 getting the correct value in the first place?

Also, is this to force 640k, 768k, both, or neither?

(I ask these questions because I will likely write a patcher that will work with any DOS 4.x and higher)
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Patching IBM DOS 5 for the PCjr

Postby Tempest » Fri Nov 02, 2012 12:48 pm

Trixter wrote:
Tempest wrote:Is there something else I should check?


Did you try the built-in floppy diagnostic with a known good floppy?

Yes I found an image of the DOS 5 disks online and used a program called DCOPY to make the disks. It's worked in the past.

This weekend I'm going to try and move the DCOPY program and DEBUG command over to my DOS 3.3 setup and write the disk using the PCjr's own disk drive. I'm starting to wonder if my problem is that the high density floppy drive I'm using isn't writing to the boot sector properly. Using a HD floppy to write 360K disks is kind of iffy to begin with, even if you tell the drive to format disk as 360K. Then again, maybe this is just a wild goose chase and something else is amiss?

Trixter wrote:
Brutman wrote:Also, is this to force 640k, 768k, both, or neither?

That's a good question. In my config.sys file I have jrconfig looking for the extra memory (/L). Maybe that's the issue?
Omne ignotum pro magnifico

--- AtariProtos.com ---
The color of infinity inside an empty glass
Tempest
 
Posts: 305
Joined: Thu Jan 14, 2010 5:43 pm

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Fri Nov 02, 2012 12:52 pm

Tempest wrote:I'm starting to wonder if my problem is that the high density floppy drive I'm using isn't writing to the boot sector properly. Using a HD floppy to write 360K disks is kind of iffy to begin with, even if you tell the drive to format disk as 360K. Then again, maybe this is just a wild goose chase and something else is amiss?


No, I'd say that is almost certainly your problem. You don't have any other DSDD drives around?
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Next

Return to PCjr Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron