RTC Support Via I/O Port 240h

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

RTC Support Via I/O Port 240h

Unread post by spark2k06 »

I have added RTC support via I/O port 240h:

MiSTer_PCXT_RTC.png
MiSTer_PCXT_RTC.png (126.08 KiB) Viewed 2772 times

At the moment in the prerelease version. It is only necessary to run the GET_RTC.exe application that I have made available in the hdd folder:

https://github.com/MiSTer-devel/PCXT_Mi ... elease/hdd

I have made a number of modifications to the RTC application developed by wilco2009 for Micro8088 project:

https://github.com/wilco2009/RTC_micro8088

The changes are as follows:

https://github.com/spark2k06/RTC_MiSTer_PCXT

Binary attachment.

Attachments
PCXT_PRERELEASE.zip
(1.28 MiB) Downloaded 118 times
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

Thanks.
Attached updated Free DOS HD with GET-RTC, autostarted by autoexec.
Sorry, too big. I will make a floppy sometime later.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

Here.

Attachments
Get RTC.zip
(119.61 KiB) Downloaded 110 times
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: RTC Support Via I/O Port 240h

Unread post by Malor »

Isn't the RTC normally read by the BIOS? Or was that only done in later generations?

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

This is what I found:
The motherboard of the IBM 5150 (IBM PC) and IBM 5155 (IBM Portable PC) and IBM 5160 (IBM XT) contains no battery supported RTC functionality. Thus, every time that those computers are powered on, the clock in DOS defaults to 01JAN1980 00:00:00, needing to be manually set to the current date and time. The addition of RTC functionality is the fix. There were various third-party solutions made to add RTC functionality to the aforementioned computers.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

Same for the Tandy 1000.
I found on Tindie a reproduction of a clock board:

Tandy 1000 SmartWatch+
The Tandy 1000 EX SmartWatch+ module add's a Clock & Calendar to your 1000 EX. All you need to do is install it under the BIOS ROM and then use the Y2K Patched SMWCLOCK.COM utility to set the time automatically via your Autoexec.bat file.

The "HX/SX/TX & PC/XT" version fits most Tandy 1000 or IBM XT class machines (except the 1000 EX). If it physically fits in your machine, it will work (see attached docs for install locations). The SmartWatch+ module has been successfully tested in IBM XT 5160's and many compatible XT class PCs with a 28 Pin BIOS ROM. It will also work in the IBM 5150 PC if installed into an XT-IDE or Network card with a compatible 28 Pin BIOS ROM.

Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: RTC Support Via I/O Port 240h

Unread post by Malor »

I remember setting the date on early PCs, but I thought that had gone away by the time the XT showed up. Guess not!

breiztiger
Top Contributor
Posts: 427
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 23 times
Been thanked: 93 times

Re: RTC Support Via I/O Port 240h

Unread post by breiztiger »

doesn't seem to work anymore with official last build ?!?

CPC-Power Staff
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

Correct, the RTC does not work any longer both in PCXT and Tandy modes.

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

jca wrote: Thu Dec 01, 2022 6:00 pm

Correct, the RTC does not work any longer both in PCXT and Tandy modes.

I haven't uploaded the correct binary, I'm resynthesizing it and I'll update it soon...

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

Fixed:

https://github.com/MiSTer-devel/PCXT_Mi ... 428d5b1e41

In haste, the text of the release date is wrong in the commit, but it is the good one, it corresponds to 01/12/2022.

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

The update_all script does not seem to recognise a binary modification, it only detects new files. So download it directly from here and replace it:

https://github.com/MiSTer-devel/PCXT_Mi ... 221201.rbf

Tomorrow I will re-upload the file with a new date... so that everybody has the latest binary correctly.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

Thanks, the RTC works in Tandy mode but I can no longer boot in PCXT mode.
If I switch from Tandy to PCXT and select "Reset and Apply Settings" I get a black screen.
If I start the core with the settings saved to PCXT I get the spash screen and nothing else happens.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

I doubled checked that I did not break my settings by using the pre-release core. Everything is normal.

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

jca wrote: Thu Dec 01, 2022 7:22 pm

Thanks, the RTC works in Tandy mode but I can no longer boot in PCXT mode.
If I switch from Tandy to PCXT and select "Reset and Apply Settings" I get a black screen.
If I start the core with the settings saved to PCXT I get the spash screen and nothing else happens.

Fixed:

viewtopic.php?p=65014#p65014

On the other hand, I have also changed the I/O port for RTC to 2C0h, as there is some kind of incompatibility with the micro8088 BIOS.

Also update the GET_RTC.EXE file in the SW folder to use the new port by default.

User avatar
venice
Top Contributor
Posts: 739
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 264 times
Been thanked: 261 times

Re: RTC Support Via I/O Port 240h

Unread post by venice »

Many Thanks for the RTC Support but I can't open Floppy Images any more.
Tested with PCXT_20221202.rbf, the PCXT Rom, 4.77MHz and the FreeDos HD Image.

And booting PCXT shows

Code: Select all

640 KB OK
601
ERROR. (RESUME ="F1" KEY)

The older Version PCXT_20221124.rbf works correct.
Maybe only my issue?

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard to me.

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

venice wrote: Fri Dec 02, 2022 1:01 pm

Many Thanks for the RTC Support but I can't open Floppy Images any more.
Tested with PCXT_20221202.rbf, the PCXT Rom, 4.77MHz and the FreeDos HD Image.

The older Version PCXT_20221124.rbf works correct.
Maybe only my issue?

I have done a silent update recently which fixes it, update.

User avatar
venice
Top Contributor
Posts: 739
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 264 times
Been thanked: 261 times

Re: RTC Support Via I/O Port 240h

Unread post by venice »

Jepp, works again.
Thx for this quick fix.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard to me.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

Thanks for the update, everything is working now.
I made a floppy disk image of the new Get RTC under FreeDos, JukoSt BIOS, Clock 3.5MHz (leftover from previous test).

Attachments
Get RTC.zip
(119.61 KiB) Downloaded 96 times
User avatar
venice
Top Contributor
Posts: 739
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 264 times
Been thanked: 261 times

Re: RTC Support Via I/O Port 240h

Unread post by venice »

jca wrote: Fri Dec 02, 2022 1:23 pm

I made a floppy disk image of the new Get RTC...

Maybe you can add the Tools from
https://github.com/spark2k06/PCXT_MiSTer/tree/main/hdd
to your RTC Disk Image. Would make life easier ;)
Or is the Image too big then?

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard to me.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

venice wrote: Sat Dec 03, 2022 4:02 pm

Maybe you can add the Tools from
https://github.com/spark2k06/PCXT_MiSTer/tree/main/hdd
to your RTC Disk Image. Would make life easier ;)
Or is the Image too big then?

I will see what I can do, you lazy bum :lol:
I initially wanted to post an updated FreeDOS vhd with Get RTC but it was too big so I posted a 360K floppy image which is big enough and cheaper than a 1.44M image.
For the tools I will need 2x360 or 1x1.44.
Option 1:
I make 1 post for each 360K floppy and request a thank you per post. :D
Option 2:
I make only one post for a 1.44M floppy and for this one it is cheaper: I make a trade.
For some reason the pcxt_micro8088.rom does not work any longer for me and I cannot figure out what it is. I cannot remember if it was before of after the introduction of the RTC. I re-downloaded the rom, tried everything I thought of but the darn thing does not what to boot.
More exactly it starts to boot FreeDOS but stops after displaying
C: HD1, Pri [ 1], blah, blah, blah
It never asks to press F8 or F5, it just stays there.

Your choice.

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

jca wrote: Sat Dec 03, 2022 7:28 pm
venice wrote: Sat Dec 03, 2022 4:02 pm

Maybe you can add the Tools from
https://github.com/spark2k06/PCXT_MiSTer/tree/main/hdd
to your RTC Disk Image. Would make life easier ;)
Or is the Image too big then?

I will see what I can do, you lazy bum :lol:
I initially wanted to post an updated FreeDOS vhd with Get RTC but it was too big so I posted a 360K floppy image which is big enough and cheaper than a 1.44M image.
For the tools I will need 2x360 or 1x1.44.
Option 1:
I make 1 post for each 360K floppy and request a thank you per post. :D
Option 2:
I make only one post for a 1.44M floppy and for this one it is cheaper: I make a trade.
For some reason the pcxt_micro8088.rom does not work any longer for me and I cannot figure out what it is. I cannot remember if it was before of after the introduction of the RTC. I re-downloaded the rom, tried everything I thought of but the darn thing does not what to boot.
More exactly it starts to boot FreeDOS but stops after displaying
C: HD1, Pri [ 1], blah, blah, blah
It never asks to press F8 or F5, it just stays there.

Your choice.

Floppy 1.44Mb is only compatible with micro8088... and 360Kb images are not reliable on micro8088, but on all other BIOSes. Keep this in mind.

User avatar
venice
Top Contributor
Posts: 739
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 264 times
Been thanked: 261 times

Re: RTC Support Via I/O Port 240h

Unread post by venice »

jca wrote: Sat Dec 03, 2022 7:28 pm

I will see what I can do, you lazy bum :lol:

Your choice.

I think two (or more) small Disks should be more compatible for all ROMs.
How do you create these little Disk Images?
And here is a “Thank You” in advance :mrgreen:

I have the same issue using FreeDos with the Micro8088 Rom at 4.77MHz.
PCXT, Turbo XT and JukoST are Ok.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard to me.

User avatar
spark2k06
Core Developer
Posts: 864
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: RTC Support Via I/O Port 240h

Unread post by spark2k06 »

venice wrote: Sat Dec 03, 2022 8:06 pm

I think two (or more) small Disks should be more compatible for all ROMs.
How do you create these little Disk Images?
And here is a “Thank You” in advance :mrgreen:

I have the same issue using FreeDos with the Micro8088 Rom at 4.77MHz.
PCXT, Turbo XT and JukoST are Ok.

PCEm / 86Box

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

spark2k06 wrote: Sat Dec 03, 2022 8:01 pm

Floppy 1.44Mb is only compatible with micro8088... and 360Kb images are not reliable on micro8088, but on all other BIOSes. Keep this in mind.

I know about that and is the reason I tried unsuccessfully to boot FreeDOS VHD with micro8088 rom. I wanted to test the 1.44M floppy image.
Any help regarding this problem is welcomed.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

December is here and Xmas around the corner.
Happy Xmas!
My wish for Xmas: a working micro8088 rom in my sock.

Attachments
Xmas.zip
(761.58 KiB) Downloaded 92 times
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

For making the floppy images I use a VirtualBox MS-DOS VM.

User avatar
venice
Top Contributor
Posts: 739
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 264 times
Been thanked: 261 times

Re: RTC Support Via I/O Port 240h

Unread post by venice »

Maybe an incompatibility between the Micro8088 Rom and FreeDos because I have successfully installed PC-DOS 7 from 1.44MB Disks using this ROM.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard to me.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

I was just joking. Nothing needed, I do it just for fun.

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: RTC Support Via I/O Port 240h

Unread post by jca »

venice wrote: Sat Dec 03, 2022 8:16 pm

Maybe an incompatibility between the Micro8088 Rom and FreeDos because I have successfully installed PC-DOS 7 from 1.44MB Disks using this ROM.

Only very recently did I come back to the PCXT core (may be 10 days) and the first thing I did was to use the Quick Start Guide which uses micro 8088 rom and FreeDOS. It used to work.
I also have a MS-DOS VHD and tried to boot from it -> nothing.
I booted from a MS-DOS floppy with the FreeDOS VHDstill attached. It booted properly from the floppy and the C: drive seems OK. I am running a ScanDisk and the first part is OK, now it is scanning the clusters which will take a while (20 min or so).
It seems to be a boot problem.

Post Reply