(From Mike Brutman)

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.
