DOS starting memory address

Discussions on programming older machines

Re: DOS starting memory address

Postby alanh » Thu Dec 01, 2016 2:13 pm

I disassembled 2.14 again and I swear I cannot find where it's placing a reservation. Yet I'm running 2.14 on my machine and DOS programs are loading at around +148 KB offset into memory.
alanh
 
Posts: 250
Joined: Tue May 10, 2011 6:52 pm
Location: Atlanta, GA

Re: DOS starting memory address

Postby KenG » Thu Dec 01, 2016 2:47 pm

I think you have to look at the boot sector of the media. It determines where io.sys is loaded. The references I found said at 0000:7C00.
Enhanced PCjr with a jr-IDE (1GB DOM) and a parallel port side car with a compact flash reader and backpack 1.44mb floppy attached. Tandy video mod.
KenG
 
Posts: 148
Joined: Sat Jul 16, 2016 5:36 pm

Re: DOS starting memory address

Postby KenG » Thu Dec 01, 2016 2:48 pm

Oops, were you talking about jrconfig.sys? I think I got my conversations confused.
Enhanced PCjr with a jr-IDE (1GB DOM) and a parallel port side car with a compact flash reader and backpack 1.44mb floppy attached. Tandy video mod.
KenG
 
Posts: 148
Joined: Sat Jul 16, 2016 5:36 pm

Re: DOS starting memory address

Postby Trixter » Thu Dec 01, 2016 4:04 pm

alanh wrote:I disassembled 2.14 again and I swear I cannot find where it's placing a reservation. Yet I'm running 2.14 on my machine and DOS programs are loading at around +148 KB offset into memory.


I haven't looked at it for a few nights, but last I checked, JRCONFIG was doing two things that was interesting: 1. It was poking around in low memory (may have been manipulating the BIOS DATA area), and 2. It was hooking some interrupts (10, 20, 21, 27) to always call a CPU/VDU page set routine before calling the original interrupt. The latter is a red herring, I think; it looked interesting, so I checked the PCjr BIOS for what it is doing, expecting to see some memory stuff, but it's doing what you would expect it is doing.

I think JRCONFIG is able to find where DOS keeps its heap start pointer and increases it directly in the data structure. I can keep tracing (I'm working with 2.10), but have you tried giving Larry a call?
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 495
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: DOS starting memory address

Postby Trixter » Sun Dec 04, 2016 1:23 pm

KenG wrote:The boot sector always loads these starting at a fixed address, so DOS and other programs knows where to access there features. I can now see where changing these would totally mess up DOS and any programs that might access io.sys and msdos.sys directly instead of using DOS int functions.


They get loaded at a fixed address but most software that uses MS-DOS functions properly (through the int 21, etc. interfaces) would work just fine if DOS were relocated somewhere else in memory. (Quarterdeck wrote a section of QEMM to do just that, so that portions of DOS can be loaded into upper memory.) However, because using DOS functions (copying files, doing a DIR, etc.) is less than 1% of the time spent using a vintage system, there is pretty much no benefit to attempting this for PCjr. It would take many tens of hours to come up with a device driver to do so, but you'd never get that time back actually using a slightly-sped-up system.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 495
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: DOS starting memory address

Postby Brutman » Sun Dec 11, 2016 3:26 pm

I think that Larry has been dead for years ... I tried the contribution thing almost 10 years ago.
Brutman
Site Admin
 
Posts: 911
Joined: Sat Jun 21, 2008 5:03 pm

Re: DOS starting memory address

Postby Trixter » Sun Dec 11, 2016 4:23 pm

I got over my fear of public speaking and called the number, and talked to him! He was very nice, and was very surprised (laughing, actually) to learn that we were doing what we do. Unfortunately, he lost the JRCONFIG source code a long time ago, but he was able to confirm a few things:

  • When he still had the source, he gave it to someone who asked for it and wanted to make modifications. I now believe that to be someone from PC Enterprises, so if anyone has any PC Enterprises contact info, now's the time to reach out.
  • He confirmed that the main mechanism for adjusting where DOS loads new programs is a DOS memory structure. He directly adjusts that value to set the new starting location of whatever DOS uses for its heap mechanism.

Continuing disassembly of the source is our final recourse if nobody knows anyone who used to work at PC Enterprises. Now that we know what the mechanism is, hopefully there's some documentation somewhere (maybe the DOS 6.x source code) that lists DOS memory structures and how to locate them.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 495
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: DOS starting memory address

Postby Brutman » Sun Dec 11, 2016 4:38 pm

Phew - happy to be wrong!
Brutman
Site Admin
 
Posts: 911
Joined: Sat Jun 21, 2008 5:03 pm

Re: DOS starting memory address

Postby James » Mon Dec 12, 2016 12:44 pm

I emailed back and forth with son of the founder of PC Enterprises a couple of years ago. I was hoping to get my hands on a jrExcellerator, display master and Combo v3 (jrVideo, Quicksilver, Keyboard Buffer and Compatibility) cartridge or anything else that might be interesting. He said he looked in their back room but all they had were PC Enterprises mouse pads. Friendly enough but I got the feeling that they were not going to expend much effort. He never answered my question whether they had the rights to sell the source code for the combo v3.

Update:

Found the email address and made an inquiry
-PCjr (1989)-DOS 3.3, Racore Drive II, jrIDE-128 MB DOM, jrExcellerator, Tandy Mod, Serial Card, Combo v2, Config Plus, IBM Parallel Port, Megaboard, Xircom PE3-10BT
-PCjr (2001)-DOS 3.3, jrIDE-128 MB DOM, NEC v20, Parallel Port, Comswap, Xircom PE3-10BT
James
 
Posts: 110
Joined: Sat Dec 22, 2012 10:04 am

Re: DOS starting memory address

Postby Trixter » Fri Jan 06, 2017 11:48 pm

I'm assuming the inquiry fell on deaf ears?

I did some more digging and found that DOS 2.0 definitely has a concept of a heap start:
Code: Select all
        i_need  arena_head,WORD         ; seg address of start of arena
        i_need  CurrentPDB,WORD         ; current process data block addr
        i_need  FirstArena,WORD         ; first free block found
        i_need  BestArena,WORD          ; best free block found
        i_need  LastArena,WORD          ; last free block found
        i_need  AllocMethod,BYTE        ; how to alloc first(best)last


This was out of the 2.0 source code. So it's clear JRCONFIG is just adjusting arena_head to start at the 128K border. As to where that data structure actually is, I haven't found that yet, but I'm guessing it's at the DOS parameter area that starts at 50:00.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 495
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron