CP/M 86

Software related questions

CP/M 86

Postby Vorticon » Tue Sep 14, 2010 8:08 pm

Hi. Has anyone here successfully run CP/M 86 on the PCjr? I downloaded a disk image of version 1.1 for the IBM PC, and it booted fine (albeit in 40 col mode), but then an "unexpected interrupt #48" error pops up the minute I press a key on the keyboard... It would really be nice to be able to run some CP/M software like WordStar on Jr :)
Vorticon
 
Posts: 276
Joined: Fri Nov 27, 2009 7:25 am

Re: CP/M 86

Postby Brutman » Wed Sep 15, 2010 8:46 am

I have not tried CPM/86. But the Int 48 problem is interesting. Check this out:

http://www.brutman.com/PCjr/pcjr_keyboard_handling.html

So on a PCjr Int 48 is the second level interrupt handler that converts a PCjr scan code received from the hardware interrupt handler to a PC compatible scan code. Under normal circumstances the BIOS should be setting the interrupt vectors. It looks like CPM/86 is expecting to use INT48, and probably redefined it, and then gets confused with INT 9 calls it.

It has to be patched ... or you have to modify INT9 to generate PC compatible scan codes up front without using INT48.


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

Re: CP/M 86

Postby CommodoreJohn » Wed Sep 15, 2010 6:17 pm

Hmm. CP/M fortunately keeps all the hardware-specific stuff in its BIOS section (not to be confused with the PC BIOS,) so that should be the only part that needs alteration. Luckily, the source has been public for a while; you can get the CP/M-86 source, plus the source for the PC/XT BIOS, here, implement a workaround, and re-build it for PCjr.

As for the workaround itself, I'm not sure what INT 48h is used for in CP/M-86, but it might be used by applications (and therefore impossible/impractical to patch,) so if there's a way you can patch the PCjr keyboard handler to use a different interrupt, that would probably be the better solution
Packard-Bell 286 (DOS 3.3, 32MB HD, 2.6MB RAM, HGC/EGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
CommodoreJohn
 
Posts: 28
Joined: Thu Apr 29, 2010 4:13 pm
Location: Minnesota, USA

Re: CP/M 86

Postby Brutman » Wed Sep 15, 2010 7:49 pm

This is fun! Here is your bogus piece of code in PCBIOS.A86

Code: Select all
;
;----------------------------------------
;
;    Setup Interrupt Service Routine vectors
;
SETISR:    SUB    AX,AX
    MOV    ES,AX
    MOV    DS,AX
    MOV    DI,0080h
    MOV    AX,Offset UNEXPINT    ; Unexpected interrupt routine
    MOV    BX,CS            ; and segment
    CLD
    MOV    CX,0040h
SETISR1:
    INC    DI        ; AT PATCH - Originally STOSW instruction
    XCHG    AX,BX
    LOOP    SETISR1
;
    ADD    DI,0008h
    MOV    CX,017Ch
SETISR2:
    INC    DI        ; AT PATCH - Originally STOSW instruction
    XCHG    AX,BX
    LOOP    SETISR2


Basically, it looks like it is running through the interrupt table setting everything to 'Unexpected' started at the interrupt vector at 0x80. That corresponds to INT 32 on up, which leaves the low numbered interrupts for timer, disk, keyboard unchanged.

At a minimum that code has to be patched to not touch INT 48, or to put it back to what BIOS starts with.
Brutman
Site Admin
 
Posts: 919
Joined: Sat Jun 21, 2008 5:03 pm

Re: CP/M 86

Postby CommodoreJohn » Wed Sep 15, 2010 8:39 pm

Ah. Well, if it's just setting the vectors to serve as invalid-interrupt traps, it should work to just change the code to skip INT 48h.
Packard-Bell 286 (DOS 3.3, 32MB HD, 2.6MB RAM, HGC/EGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
CommodoreJohn
 
Posts: 28
Joined: Thu Apr 29, 2010 4:13 pm
Location: Minnesota, USA

Re: CP/M 86

Postby Corey986 » Sat Jan 17, 2015 9:44 am

Reviving this thread...

Has anyone done the patch to get CP/M running on the JR?

Thanks,
Corey
Corey986
 
Posts: 35
Joined: Tue Jun 03, 2014 6:03 pm


Return to PCjr Software

Who is online

Users browsing this forum: No registered users and 2 guests