Jump to content
IGNORED

Compiling a new Atari OS...


reifsnyderb

Recommended Posts

9 hours ago, ilmenit said:

If you prefer to use MADS assembler: https://github.com/ilmenit/A800-OS-XL-Rev2

Thanks!  I am fine with ca65 since it will compile any of the OS versions in the 7zip file.  

 

I've been wondering why Atari did all the development on the 1450XLD line then abandoned it in favor of going back and forking the OS at Revision 2 (600XL/800XL).

 

Maybe it's better to make this a starting point as opposed to the 600XL/800XL R. 3 fork.

 

Here's the 1450XLD line changes up until they started removing PBI support:

 

 

 

;*    MODS
;*        Revision A (400/800)
;*        D. Crane/A. Miller/L. Kaplan/R. Whitehead
;*
;*        Revision B (400/800)
;*        Fix several problems.
;*        M. Mahar/R. S. Scheiman
;*
;*        Revision 10 (1200XL)
;*        Support 1200XL, add new features.
;*        H. Stewart/L. Winner/R. S. Scheiman/
;*        Y. M. Chen/M. W. Colburn    10/26/82
;*
;*        Revision 11 (1200XL)
;*        Fix several problems.
;*        R. S. Scheiman    12/23/82
;*
;*        Revision 1 (600XL/800XL)
;*        Support PBI and on-board BASIC.
;*        R. S. Scheiman/R. K. Nordin/Y. M. Chen    03/11/83
;*
;*        Revision 2 (600XL/800XL)
;*        Fix several problems.
;*        R. S. Scheiman    05/10/83
;*        Bring closer to Coding Standard (object unchanged).
;*        R. K. Nordin    11/01/83
;*
;*        Revision 3 (600XL/800XL/1450XLD)
;*        Fix MAXDEV, problems resulting from CRASS65 version,
;*        initial address for RAM sizing, "Boot Error" message,
;*        initial address for cartridge equivalence checksum,
;*        mishandling of SIO NAK, initializing of CHKSUM, and
;*        initialization of PORTB.
;*        R. K. Nordin    03/27/84
;*
;*        Revision 3, Version 2 (600XL/800XL/1450XLD)
;*                
;*               Dedicate PDVI ($D1FF) to external parallel device IRQ status
;*        Dedicate IPDVI ($D1CF) to internal parallel device IRQ status
;*        Using PDIMSK ($0249) for external parallel device IRQ selection mask
;*        Using IPDIMK ($0254) for internal parallel device IRQ selection mask
;*        After masking (PDVI, PDIMSK) & (IPDVI, IPDIMK), OR the result
;*        together, piror to processing parallel device IRQ
;*
;*        On cold start, initialize PDVI = 0, to avoid potential
;*        checksum error.
;*        Y. T. JANG, V. WU    02/22/84
;*
;*        Revision 3, Version 3  (600XL/800XL/1450XLD)
;*
;*        Dedicate the 11 bytes at ACMVAR ($3ED-$3F7) for use as
;*        a RESET routine area.  On warmstart, the OS will JSR
;*        to ACMVAR immediately after initializing hardware.
;*        MIKE BARALL        06/08/84
;*
;*        Revision 3, Version 4  (600XL/800XL/1450XLD)
;*
;*        Make CIO accept device number 0 (like Rev B did).
;*        MIKE BARALL        06/21/84
 

 

  • Like 1
Link to comment
Share on other sites

Hello guys

 

15 hours ago, HiassofT said:

Some patched OSes threw out cassette or PBI support to free up some space, but all of those are more commonly used than the international charset so aren't a good choice if you want to stay compatible with as many programs and setups as possible.

 

On the other hand, I can see where somebody would want to use both the international characters and the high speed routines, where using the high speed routine and the cassette routines "at the same time" doesn't make too much sense.

 

Sincerely

 

Mathy

 

Edited by Mathy
Link to comment
Share on other sites

9 minutes ago, Mathy said:

Hello guys

 

 

On the other hand, I can see where somebody would want to use both the international characters and the high speed routines, where using the high speed routine and the cassette routines "at the same time" doesn't make too much sense.

 

Sincerely

 

Mathy

 

Yes.  It's a matter of priorities.  There is a very limited space to work with so something has to stay and something has to go if any serious changes are made.  Apparently, the high speed SIO is about 1k in size.  Looking at the compile time information, it appears that there is, at most, 140 consecutive bytes to work with.

 

There is an option to extend the operating system via 1090 cards.  However, I don't think that option exists for the SIO unless that capability is added to the operating system.  Maybe this is a possible route to take?  Add some sort of SIO vector entry?  The $D800-$DFFF region provides a couple of k to work with and could be banked, too.

  • Like 1
Link to comment
Share on other sites

16 hours ago, reifsnyderb said:

There is an option to extend the operating system via 1090 cards.  However, I don't think that option exists for the SIO unless that capability is added to the operating system.  Maybe this is a possible route to take?  Add some sort of SIO vector entry?  The $D800-$DFFF region provides a couple of k to work with and could be banked, too.

Sure, you can do that with additional hardware, making use of the PBI support in the OS.

 

You are re-creating the U1MB though if you go this route, it uses that method to support highspeed SIO.

 

so long,

 

Hias

Link to comment
Share on other sites

@mr-atari, @classics, marius, myIDE II and what other device by atarimax utilized the keyhole, I forget, I believe the 32 in 1 OS in one devices used a keyhole of a kind as well, a 128 byte window and a 2K space within a location... it's sitting in my mind and can not recall the specifics at this time.

I'd think this method could be employed to get something in there only when needed.

 

It would require a small bit of hardware (pic/chip) to do I think, but it does provide a ram/rom that is useable in unique ways.

 

there was some talk about it when making a software method to access the hole in the myIDE or the pic for the 32in1.

I can't find all the threads about this but I know work was done for both, and a method to access the 32in1 after it was in use to provide an OS was a work in progress.

 

maybe @phaeron has some insight in his hardware manual about both, possibly some ideas on what would work. The OS in the Atari modified to use they keyhole methods of either device to extend the OS itself.

 

*edit* don't know if it helps but here's some link

http://www.atari800xl.eu/docs/reference/altirra-hardware-reference-manual.pdf

crazy idea to let the an OS itself reach out to extension on another chip yes?

Edited by _The Doctor__
Link to comment
Share on other sites

6 hours ago, HiassofT said:

Sure, you can do that with additional hardware, making use of the PBI support in the OS.

 

You are re-creating the U1MB though if you go this route, it uses that method to support highspeed SIO.

 

so long,

 

Hias

I was reading through the XL OS description some more and found the vector table for SIO support.  (Yes, I am learning.   🙂  )  However, a read through @HiassofT's excellent readme.txt file indicates the vector table isn't used and the reason why.  (I wish all readme.txt files had this level of technical info in them.)

 

I wouldn't say I am thinking about re-creating the U1MB.  But I do like the idea of using what Atari designed to extend the capabilities of the computer.   🙂

 

If memory serves, the U1MB replaces the MMU.  Replacing the MMU allows for a lot of options not normally available.  I am just looking at what's possible to do with the OS only and if it's possible to improve upon the OS while still keeping compatibility.  This all started because I was wondering about compiling the OS with the better floating point math pack.  A big problem appears to be stuffing everything into 10k when almost 10k is already used. 

 

 

  • Like 1
Link to comment
Share on other sites

Os++ provides a resident Dos 2 compatible (963 sector, enhanced density) file management system for the 1050 disk drive, thus releasing approximate 6K of memory for applications. The math pack size is unchanged, but just optimized. Loop unrolling was not an option as there is no ROM space left, though the result is still faster and more precise. But of course that means that some compromises had to be made: The PBI handler is gone (at my time, nobody had a device connecting to the PBI port making this code worthwhile), and the resident tape handler (C:) is also gone.

Link to comment
Share on other sites

I found Notepad++ can have a "compare" plugin added so as to do a "diff" between files.  So, I decided to compare the OS Revision 3 (65XE/130XE) and OS Revision 3, Version 4 (600XL/800XL/1450XLD).

 

Looking at the comments, OSR3v4 seems to show improvements that OSR3 didn't have.  Even so, some of the changes are in both versions even though OSR3 doesn't document them.  OSR3 doesn't have support for the internal PBI devices.  But I don't think that's much of an issue.  Even so, it wouldn't be hard to add.  Being that space is at a premium, I don't see the point in trying that one.  There is a comment in OSR3v4 about CIO not supporting device 0 like OSR2...and a change to do so.  OSR3 shows that it doesn't support CIO device 0.  (Does this matter?)  Most other changes appear to have been made.  The biggest difference is in the self-test code.  Also, OSR3v4 shows that $D1FF is initialized to 0 while OSR3 doesn't initialize $D1FF to zero.  While PBI devices should be reset to 0 on init, it doesn't hurt to do so.

 

  • Like 1
Link to comment
Share on other sites

I compared both of the files, above, and added what appears to be the appropriate fixes and changes from the OS R3 1450XLD series to OS R. 3 as follows:

 

;*        Revision X (600XL/800XL/65XE/130XE)
;*        Added the following fixes and changes from Revision 3 (600XL/800XL/1450XLD) through 
;*            Revision 3, Version 4  (600XL/800XL/1450XLD)
;*
;*            Fix TXEB table for XE banking.
;*            Added IDCPU back to First 8k ROM Identification and Check
;*            Fix initial address for RAM sizing to $4000 (16k).
;*            Fix initial address for equivalence cartridge checksum to $BF00.
;*            Correct mishandling of NAK.
;*            Initialize PDVS to zero.
;*            Accept device number 0 (like revision B did)
;*      Brian E. Reifsnyder    02/11/2023

 

Initial testing, on Altirra, shows it compiles and runs.  Cartridges work and MULE plays, too.   🙂

 

 

  • Like 1
Link to comment
Share on other sites

On 2/11/2023 at 11:43 AM, _The Doctor__ said:

crazy idea to let the an OS itself reach out to extension on another chip yes?

lol   Not really.  1090 cards can do this to a point.   🙂

 

 

Well, I made a lot of progress and have a little more to go until I get this to what I would consider to be fully up-to-date.  I would probably have had the Fast Math integrated but between PP&L and Microsoft, it wasn't going to happen.  The power flickered and my computer crashed.  Windows 10 didn't disappoint as it didn't come back up.  I decided that between Windows 10's awful boot times of around 20 minutes and the fact that it's a hard disk hog that the next time it decides to take a dump on me it was getting the boot.  (Yeah, I know, there are published ways to reduce the boot times....they didn't work.)  So, I am putting Ubuntu Linux on my PC.  I still have some more installations to do but so far it's going well.  I also need to re-connect my other hard disks, too.  Hopefully, I'll be back to playing with the Atari OS code soon.

  • Like 2
Link to comment
Share on other sites

1 hour ago, reifsnyderb said:

lol   Not really.  1090 cards can do this to a point.   🙂

 

 

Well, I made a lot of progress and have a little more to go until I get this to what I would consider to be fully up-to-date.  I would probably have had the Fast Math integrated but between PP&L and Microsoft, it wasn't going to happen.  The power flickered and my computer crashed.  Windows 10 didn't disappoint as it didn't come back up.  I decided that between Windows 10's awful boot times of around 20 minutes and the fact that it's a hard disk hog that the next time it decides to take a dump on me it was getting the boot.  (Yeah, I know, there are published ways to reduce the boot times....they didn't work.)  So, I am putting Ubuntu Linux on my PC.  I still have some more installations to do but so far it's going well.  I also need to re-connect my other hard disks, too.  Hopefully, I'll be back to playing with the Atari OS code soon.

Linux + Atari FTW!

  • Like 2
Link to comment
Share on other sites

The Fast Math code is very tightly packed.  There is some error that is stopping it from compiling and I have the following result:

 

$00a4 free bytes from $cb5c to $cbff
---Fast Floating Point Package Start---
$800e free bytes from $57f2 to $d7ff
source.s(6976): Error: User error: $d8e6 precedes current origin counter of $d8e8
source.s(1266): Note: Macro was defined here
source.s(7109): Error: User error: $d9aa precedes current origin counter of $d9ab
source.s(1266): Note: Macro was defined here
source.s(7151): Error: User error: $d9d2 precedes current origin counter of $d9d3
source.s(1266): Note: Macro was defined here
$0001 free bytes from $da5f to $da5f
$0001 free bytes from $dada to $dada
$0002 free bytes from $db26 to $db27
$0001 free bytes from $dbff to $dbff
$0003 free bytes from $de8a to $de8c
$0001 free bytes from $deae to $deae
---Fast Floating Point Package End---
$000e free bytes from $e4b2 to $e4bf
$0004 free bytes from $e90e to $e911
$0002 free bytes from $e957 to $e958
$0008 free bytes from $ef63 to $ef6a
$0059 free bytes from $fc7f to $fcd7
$0003 free bytes from $ffeb to $ffed

 

 

There are too many bytes between $D800 and $D8E6.  I was thinking it could be an issue of absolute addressing vs zero page addressing that is resulting in the extra bytes.  So far, I can't find anything.

 

The code I've patched in is identical to the source code posted for the Fast Math.  But, it doesn't compile when converted to ca65 assembly.  (I got it from here:   https://atariwiki.org/wiki/Wiki.jsp?page=FAST FLOATING POINT source code for the ATARI )  I am starting to wonder if it does compile as posted.  Has anyone tried it?

 

If I can fix the problem between $D800 and $D8E6, I think the other two errors will take care of themselves.

 

Thus far, I have the following changes:

 

;*        Revision X (600XL/800XL/65XE/130XE)
;*        Added the following fixes and changes from Revision 3 (600XL/800XL/1450XLD) through
;*            Revision 3, Version 4  (600XL/800XL/1450XLD)
;*
;*          Fix TXEB table for XE banking.
;*            Added IDCPU back to First 8k ROM Identification and Check
;*            Fix initial address for RAM sizing to $4000 (16k).
;*            Fix initial address for equivalence cartridge checksum to $BF00.
;*            Correct mishandling of NAK.
;*            Initialize PDVS to zero.
;*            Accept device number 0 (like revision B did)
;*        BASIC loaded when Option key held down.
;*        Processing of CNTLF1 through CNTLF4 removed.
;*        Reduced KRPDEL from 48 to 20 for NTSC and from 40 to 20 for PAL.
;*        Reduced KEYREP from 6 to 4 for NTSC and from 5 to 4 for PAL.
;*      Brian E. Reifsnyder    02/11/2023

 

 

I figured I'd reduce the keyboard delays a little as I always felt they were painful.   🙂

 

The really bad news is that I just found out that Altirra doesn't run on Linux.   😞

 

 

 

Here's the file thus far.  The problem is somewhere between lines 6818 and 6959....if anyone wants to take a quick look.

 

source.s

 

Edit:  I just got it to compile.  Now there's a linker error.  Go figure.....

 

 

Edited by reifsnyderb
  • Like 1
Link to comment
Share on other sites

1 hour ago, invisible kid said:

You can run altirra on linux via a program called wine, but I prefer to run atari800 on linux.

I tried Altirra with wine and it didn't properly.  I'll try with a fresh install and see if it makes a difference.

 

Edit:  I just tried with a fresh install and I don't have the "video" displayed from the Atari.

Edited by reifsnyderb
Link to comment
Share on other sites

It sounds like progress at least. Are you using a distro like debian or ubuntu and using their package manager? Like "apt-get install wine"? Just curious, I use a different distro with a different system. Did you try atari800? Sometimes it's nice to use a native program instead of having to use wine. But I also know everyone gets used to programs and changing is difficult.

Link to comment
Share on other sites

2 minutes ago, invisible kid said:

It sounds like progress at least. Are you using a distro like debian or ubuntu and using their package manager? Like "apt-get install wine"? Just curious, I use a different distro with a different system. Did you try atari800? Sometimes it's nice to use a native program instead of having to use wine. But I also know everyone gets used to programs and changing is difficult.

I got Atari800 working but didn't take the time to figure out how to configure it yet.  I am using Ubuntu and Wine is installed.  I was going to use Linux Mint until I found a posted issue with some software....I think KiCad.  Also, I am using the package manager where possible.  Atari 800 wouldn't compile for some reason but is listed as a package so I installed it and it runs.  I'll take some more time with Alitirra and see if I can get it working.  Somebody has instructions on getting Altirra working on Ubuntu...but it didn't work for me.  I like Altirra better due to the options and capabilities that are easily available.  Xgpro appears to work, too.  I found some instructions and it communicates with the burner...so that's a plus.  So far, I think the biggest issue is Altirra not working.  Also, my computer appears to have some issue with the sound but I think the problem is the jack as I was down to one speaker before everything crashed.  I do like the 2 minute boot-up times, though.  Other software that works includes KSP (very, very important), KiCad, GIMP (of course), GoDot (Important for something cool I am working on 🙂  ), etc.

Link to comment
Share on other sites

Yep, linux is great for older laptops. There are also different versions of wine you can install. One is called staging, and will have more current fixes in it, but is "less stable." https://wiki.winehq.org/Debian mentions them. I'm not sure what package manager mint uses. Arch is one that I see folks use too. Also, I guess there are also distros targetted for smaller embedded-like systems like rasberry pi. Finally a good spot for questions and answers for wine is https://forum.winehq.org/viewforum.php?f=8&sid=14d3e0ef422d46501a19bdf1e0f6e0be.

Edited by invisible kid
  • Like 1
Link to comment
Share on other sites

As for no video output, what graphics chipset is in your laptop? Does glxgears run?

 

You could try Altirra with the /gdi command line option to see if you can get anything to be drawn on screen.

 

Edit:

 

$ dpkg -S `which glxgears`
mesa-utils: /usr/bin/glxgears

 

So you need to install mesa-utils if it's not yet installed.

Edited by ivop
  • Like 1
Link to comment
Share on other sites

3 minutes ago, ivop said:

As for no video output, what graphics chipset is in your laptop? Does glxgears run?

 

You could try Altirra with the /gdi command line option to see if you can get anything to be drawn on screen.

 

Edit:

 

$ dpkg -S `which glxgears`
mesa-utils: /usr/bin/glxgears

 

So you need to install mesa-utils if it's not yet installed.

Well, it's not a laptop.  It's a mini tower system. 

Ubuntu shows it as:

32GB

i7-4790Kx8 processor

PitCairn Graphics

1.5TB disk capacity

 

"wine Altirra64.exe /gdi" shows a screen!  I've now got a memo pad.   🙂

 

The dpkg command didn't work.  Debian package manger?

  • Like 1
Link to comment
Share on other sites

My bad, it was me that assumed laptop.

Yeah, debian can also use dpkg, which I think just explodes files into their proper place similar to untarring or an rpm file(redhat). It uses *.deb files. So if you get a *.deb file you can install by:

 

sudo dpkg -x <name>.deb /

 

But I usually use apt-cache/apt-get and only use dpkg if someone is pushing a deb file only. If you don't have it you can try "apt-get install dpkg" or "apt-cache search dpkg" I think.

Edited by invisible kid
Link to comment
Share on other sites

59 minutes ago, reifsnyderb said:

PitCairn Graphics

That's Radeon I guess, so it should do OpenGL.

 

59 minutes ago, reifsnyderb said:

"wine Altirra64.exe /gdi" shows a screen!  I've now got a memo pad.   🙂

Nice. GDI is slow though. It would be better to get Direct3D9 or 11 working.

 

59 minutes ago, reifsnyderb said:

The dpkg command didn't work.  Debian package manger?

Sorry, that dpkg command was to find out which package installed glxgears :)

 

Install it with your package manager or with apt-get install mesa-utils.

 

 

Edit: you can check /var/log/Xorg.0.log to see which driver X.org loads and see if the GLX module is loaded.

 

$ less /var/log/Xorg.0.log

 

and grep (with my output shown)

 

$ grep -i glx /var/log/Xorg.0.log
[    12.359] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[    12.359] (II) LoadModule: "glx"
[    12.361] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    12.371] (II) Module glx: vendor="X.Org Foundation"
[    12.534] (==) NOUVEAU(0): GLX sync to VBlank enabled.
[    12.819] (II) Initializing extension GLX
[    13.037] (II) AIGLX: Loaded and initialized nouveau
[    13.037] (II) GLX: Initialized DRI2 GL provider for screen 0
 

Edited by ivop
Link to comment
Share on other sites

For OS starting points you basically have two places to start from:

BB000001 Rev. 2 (1983-05-10) [XL]

or

BB000001 Rev. 3 (1985-03-01) [Late XE] / BB000001 Rev. 4 (1987-05-07) [XEGS]

 

Incorporating some of the changes from BB000002 Rev. 3 (1984-03-27)  might be useful.  But I would not venture into any other 14xx revision as the others appear to be designed for the TONG board booting, and then M. Barrall went and did a lot of additional work on other features.

You could do the CIO #0 fix, move the device handlers around to their B location etc.. (but that might break XL OS games that violated the same standards and the B people),

fix the 130XE memory test, and if you are going to keep the selftest keyboard then the layout should be modified to re-include F1-F4.

 

Note that REV 4 has a fast SIO mode ... take a look at how that was done.

 

 

BB000001 Rev. 4 (1987-05-07) might be the best place to start to support the most computers.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...