Patching IBM DOS 5 for the PCjr

Software related questions

Re: Patching IBM DOS 5 for the PCjr

Postby Tempest » Sat Nov 03, 2012 12:03 pm

Message sent.
Omne ignotum pro magnifico

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

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Wed Apr 03, 2013 10:18 am

Brutman wrote:Look in the memory map. 40:13 is the amount of memory on the motherboard, excluding the video buffer. 40:15 includes expansion memory too, but still not the video buffer.


I was confused where this was getting set since almost all references show the second value as "reserved". I was about to disassemble the jrIDE BIOS when, duh, I thought to check the PCjr techref BIOS listing and saw this:

Code: Select all
0013 MEMORY_SIZE DW ? ; USABLE MEMORY SIZE IN K BYTES
0015 TRUE_MEM    DW ? ; REAL MEMORY SIZE IN K BYTES


So THAT'S where the value comes from :-) Funny how the PCjr was almost completely ignored in most texts; helppc and other resources all list 0015 as "reserved". Revisionist history.

I had the patch utility on a todo list, but if you get to it first that isn't going to bother me ...


I plan on having it finished before the end of the month (I have other obligations until end of April), and I'll reply here when done.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 522
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Patching IBM DOS 5 for the PCjr

Postby Brutman » Wed Apr 03, 2013 6:15 pm

I don't think it is "revisionist" ... more like forgotten.

It wasn't considered to be a mainstream machine. I'm happy to find any reference to it in the various port lists and interrupt lists that float around.


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

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Tue Apr 09, 2013 8:17 am

I've completed the generic DOS boot sector patching utility and put it here: ftp://ftp.oldskool.org/pub/misc/Softwar ... TCHDOS.ZIP

The tool does the following:

  • Checks to see that the first instruction is a JMP
  • Records the initial JMP location
  • Looks for at least 16 bytes of ASCII that can hold the patch and picks the largest one
  • Puts the patch at the end of the largest string (so that you can still partially read what it says if it ever gets printed)
  • Amends the patch to jump to the original first JMP
  • Rewrites the first JMP to jump to the patch

This is all interactive with user confirmation. Tested successfully with MS-DOS 5.0, MS-DOS 6.22, PC DOS 2000, DR-DOS 6. DR-DOS is an important success because the boot sector bears little resemblance to Microsoft's boot sector. DR-DOS also didn't need STACKS=0,0 but it has a drawback, once you use JRCONFIG for some reason an additional 50K disappears, at least when I tested it with my jrIDE-equipped PCjr. So most DOSes had roughly 590K free but DR-DOS 6.0 had 540K free. I did not test with DR-DOS 7.

Source included with no dependencies if you want to alter it. More docs, including Mike's original explanation of the patch, are in the .ZIP.

I was lazy and only use indirect jumps when doing fixups (as opposed to a short indirect, which would save a byte and allow a NOP as the third byte). If that irks those with OCD, you're welcome to amend the source and send me the updates :-)
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 522
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Patching IBM DOS 5 for the PCjr

Postby jmetal88 » Tue Apr 09, 2013 9:58 am

Ah, cool. I might try it on the FreeDOS disk I put together last night. I hope there's a big enough ASCII block in there, haha.

EDIT: Well the FreeDOS boot sector looks to only have a couple of strings: "NO NAME FAT32" (maybe FAT16 on my disk, I'll have to dump the boot sector and check) and "KERNEL SYS". The first one is 16 bits exactly, but I'm not sure what function it performs.

EDIT 2: I should say, I was looking at a dumped boot sector from 2006 when I found those strings, the current boot sector may have changed significantly. The only actual text I have seen it print to screen is "Error!".
jmetal88
 
Posts: 794
Joined: Sun Jul 25, 2010 10:22 am

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Tue Apr 09, 2013 11:06 am

Yeah, your best bet with FreeDOS is to look in the boot sector source code for any place where DS is set to 0, and then you can quickly slip this in:

MOV AX,[415]
MOV [413],AX

That's six instructions, as small as it can get. If you need space you can completely eliminate the error message "Error!" as well as the code that prints it. Then you recompile the boot sector and hope things don't get borked later on.

Honestly though, I don't see the point of using any DOS on a PCjr that isn't 2.11, 3.2, or some MS- or PC- DOS 5.x or later. It's not going to be smaller. Maybe their "determine free space" method is faster, but that alone I don't see as a large enough selling point.

I didn't test DR-DOS 7.0 or its variants, but that might be worth investigating. Also, any DOS that claims to have FAT32 support might be interesting to test.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 522
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Patching IBM DOS 5 for the PCjr

Postby jmetal88 » Tue Apr 09, 2013 11:17 am

Trixter wrote:Yeah, your best bet with FreeDOS is to look in the boot sector source code for any place where DS is set to 0, and then you can quickly slip this in:

MOV AX,[415]
MOV [413],AX

That's six instructions, as small as it can get. If you need space you can completely eliminate the error message "Error!" as well as the code that prints it. Then you recompile the boot sector and hope things don't get borked later on.

Honestly though, I don't see the point of using any DOS on a PCjr that isn't 2.11, 3.2, or some MS- or PC- DOS 5.x or later. It's not going to be smaller. Maybe their "determine free space" method is faster, but that alone I don't see as a large enough selling point.

I didn't test DR-DOS 7.0 or its variants, but that might be worth investigating. Also, any DOS that claims to have FAT32 support might be interesting to test.


To me, it's just the open-source appeal. There's not really any practical advantage.
jmetal88
 
Posts: 794
Joined: Sun Jul 25, 2010 10:22 am

Re: Patching IBM DOS 5 for the PCjr

Postby jmetal88 » Tue Apr 09, 2013 12:47 pm

Actually, considering how far FreeDOS currently gets in the boot process, I'm not sure it needs this patch. What it does need is JrConfig compatibility. I think since FreeDOS goes farther into the boot process before it runs CONFIG.SYS, having JrConfig come in and modify RAM locations and whatnot at that point is causing an error on the second boot. Trying to boot without JrConfig goes right up to the point where it tries to run the command interpreter, then it either freezes with a red screen, or fills the screen with repeating text (depending on which version of the command interpreter you're running). I think perhaps for the FreeDOS type of setup, some of the JrConfig behavior might need to be hard coded into the OS.
jmetal88
 
Posts: 794
Joined: Sun Jul 25, 2010 10:22 am

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Wed Apr 10, 2013 9:10 am

jmetal88 wrote:Well the FreeDOS boot sector looks to only have a couple of strings: "NO NAME FAT32" (maybe FAT16 on my disk, I'll have to dump the boot sector and check) and "KERNEL SYS". The first one is 16 bits exactly, but I'm not sure what function it performs.


The "NO NAME FAT32" is likely not a single string. NO NAME is the OEM string in the drive table record, and FAT32 is the "FAT type" which is supposed to be either FAT12 or FAT16 so I'm surprised FreeDOS put FAT32 there. Both of these are not applicable locations for the patch since they're not long enough.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 522
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Patching IBM DOS 5 for the PCjr

Postby Trixter » Wed Apr 10, 2013 9:27 am

jmetal88 wrote:Actually, considering how far FreeDOS currently gets in the boot process, I'm not sure it needs this patch.


I'm sure it does, otherwise FreeDOS is going to think the total system RAM is 128K.

What it does need is JrConfig compatibility.


I'm curious if the no-ram-disk version of jrconfig gets farther. Maybe it crashes setting up the ramdisk?

My jrconfig 2.14 package doesn't contain the source; I wonder if the original author is still around and still has it. I took a stab at reverse-engineering it, but it's not quite a typical device driver (there is junk user data in what should be the Device Name section, for example) so I don't hold a lot of hope that it would be "easy" or "trivial" to create .asm source that recompiles, like most device drivers that follow the spec exactly.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 522
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

PreviousNext

Return to PCjr Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron