Z80 Retro #24 - CP/M Introduction
Вставка
- Опубліковано 22 сер 2024
- You can support this channel on Patreon! / johnsbasement
This video is part of a UA-cam playlist/series: • Z80 Retro
CPMuseum on how to assemble an IMSAI 8080 kit:
• On The Work Bench - IM...
George R.R. Martin explains why he prefers Wordstar 4.0:
• George R. R. Martin St...
The github repo seen in this video:
github.com/joh...
Related project hardware repos:
github.com/joh...
github.com/joh...
A Hackaday page for Z80 Retro! projects:
hackaday.io/pr...
Music used in this video (Vibe Tracks, Alternate) was downloaded from the UA-cam Audio Library: www.youtube.co...
#Z80
#CPM
#BIOS
#homebrew
#retrocomputer
Thank you John for explaining CPM so transparently. I love my Apple / CPM systems even more now that I have converted them to access SD cards.
@@herbertweinreich3957 you're welcome. I'm glad you liked ut!
I maintain all the S-100 bus computers at a computer miseum. We have about a dozen altairs and about 18 IMSAIs with a boatload of S-100 cards. Jave tons of VT-100s, decwriters, ASR-33 teletypes.
I work will all versions of CP/M even MP/M.
Back in the day i wrotr ALL my code in assembler on an IBM Mainframe since 1969. When i built my IMSAI (hated altair becuase front panel was octal - so unatural) i wrote a maimframe emulator so i could test my mainframe code. This saved me much valuable maimframe test time. I even had a kennedy 9 track tape drive connected to it as well!
That is cool! You should consider shooting some videos of various common repairs that new fans are likely to run into.
For example, my Decprinter LA...uh... 75??? is having an issue where it works fine for a page or two and then starts slamming further and further to the left until it senses it has jammed and seizes up. I can probably guess that it is aging capacitors. But I'd rather not tear into it without some expert guidance.
According to the Wikipedia entry for CP/M, the source for 2.2 was released under open source in 1997-98. And Lineo expanded the license to include other DR assets.
I read that too. I considered importing it all into my repo. But it doesn't really matter since a wget & sed takes care of it easy enough.
Doing it this way helps everyone figure out how to recreate everything from scratch on their own so they can experiment with different versions of CP/M.
...well... that and the fact that wikipedia would be the first to admit that they are not an authoritative resource of anything (edit: by that I mean legal advice.)
@@JohnsBasement I personally found the walk through of the mistakes in the z80 translated code and need for the sed fix very helpful!
I knew there had to be folks out there that understood 'sed'. John, you are the first I've come across. ;)
For scripting up file fixes it is great. 😀👍
I LOVE sed, and awk. I use them all the time.
Thanks for the great vid and here's a safety warning and a clarifications. #WARNING: watch out for Tag Tantalum capacitors which can become dangerous aerial fireballs!! # The best way to prevent them from igniting is to remove them or to use lower input voltages. (I had a 35V rated working voltage one fail at 30V a few days ago.) The 7805 regulators of that era are rated @ >1.0A, (peak 2.2A), often with TO-220 packages operating at 1A and TO-3 at up to 1.5A; the 78M05 variate is rated at >500mA (peak 700mA). The outputs from the chassis power supply are +8VDC (unregulated) and +/-16VDC (unregulated) to feed the onboard voltage regulators. The large filter capacitors of many old S100 systems have survived quite well, not losing capacitance or increasing ESR but a safety check is still recommended. Often these large capacitors have parallel bleeder resistors installed for safety. Be on the lookout out for old RIFA high voltage capacitors which fail with age! (It was years after the S100 era saw the introduction Chinese Crapacitors with a dud electrolyte formula that exacerbated the ubiquitous global capacitor problem). The heat generated by each voltage regulator is dependent upon their input voltage (from the chassis power supply) and the current being drawn; a minimum voltage drop of 2.5V is recommended between the input and output voltages (e.g. 8VDC input for 5VDC regulated, +/-16VDC for +/-12VDC ); years later LDO (Low voltage dropout versions were released allowing lower input voltages to improve efficiency and reduce unwanted heat generation.
Fireballs indeed!!! I had the lot of them on a backplane all blow up due to inrush on a CalComp box that I have showed on my channel before (and that might make another appearance down the road.)
I have been a bit caviler with powering up old S-100 boards. I have never had a problem with any of them them yet. I have not noticed how have tantalums on them... Maybe the ones that do will have to be exported into a display-case only setting or posted on Ebay.
I have NEVER had electrolytics blow up (unless I did it on purpose by over-voltaging them or powering them backwards.) I have seen postings from others about them swelling up on motherboards and other issues. And someone posted recently that they did not have the guts to power up their old IMSAI-8080 after considering its age and looking at its giant filter caps.
I have never known those to fail catastrophically. What do you think a bout them? I'd really hate to have one of those 1/2-liter sized ones go off without warning on my bench.
I haven't had a giant one go off yet but that doesn't mean that they all don't. They generally have screw terminals and can be easily measured out of circuit. Replacements would be mighty expensive. As an alternative, one can use a modern switch mode power supply in lieu of the older simpler but less efficient old ones. Another thing about S100 bus is signal integrity and EMI due to poor PCB designs. There's not much you can do about the EM emissions except keeping the metal case closed and put ferrites on leads that protrude from the case, but for signal integrity, you may need to install two termination boards - one at each end of the backplane just like SCSI. SI problems often arise when replacing old TTL and LSTTL ICs with younger ones or ones from other families such as S, F, ACT due to their steeper slew rates.
@@JohnsBasement If the caps aren't completely dry and/or shorted, bringing the unit up slowly on a variac will often reform the electrolytic caps. Just bring it up a little at a time over a few hours. I've also used this method on old boat anchor radios. BTW diggin' the Z80 Retro series!
@@trevorjacobs8593 Thanks! -- If only I didn't discard my variac in the 1980's 😞
I had a tantalum burn up on me, and the RIFA looked about ready to burn up in a paper tape reader/punch I just bought so promptly removed it. I replaced the tant cap with an electrolytic.
I just love your channel. First thing to check everytime I youtube :)
Thanks for saying so! I hope I don't let you down.
The first two word processors I used were on CP/M... Perfect Writer and Wordstar.
I try to keep an emulator able to run Wordstar available for those times I need to have no-distractions putting text into bits.
Wordstar was awesome! So simple. Just enough features that one need not engage google every time some simple thing (that Bill Gates liked to say was one click away... from, where Bill???) got moved in last nights 'update'.
@@JohnsBasement Was? Still is. For what it is, it's freaking awesome.
As i recall the INP/OUTP put the 8-bit port address on both the LS and MS byte of the address bus. (The 8-bit port number is written to both address bytes). With a tight loop like you entered doing a INP 0xFF then an OUTP 0xFF you will see the 0xFFs on the MS address LEDs as well.
Yes!!! Brilliant!!
I SWEAR I have seen code run before in low memory where the address MSBs were low and quiet.
This explains that demo behaviour.
Next time I get a chance to power it up I'll run a spin loop to check it.
@30:49 INCORRECT - the BIOS/disk bootstrap loader (in a ROM chip) start/end address generally would NOT be movable and would reside at the very top of memory regardless of how much RAM you had in the system to ensure the BIOS system routine addresses would not move and always be at set addresses for the software (BDOS) below it to run them. This was to make sure the the BDOS did not have to work out the BIOS addresses to call BIOS system routines on based on the amount of RAM you had. If you Google the standard BIOS system routines like standard display output, disk access they are always at a set top memory address and never change. Not only that the character set bitmap lookup table would also be stored in this ROM which was accessed by the display hardware to generate characters on the screen. The display hardware would know where to look in the ROM for the bitmap e.g for the letter 'A' and use the bitmap data to draw dots on the CRT. It was important that the ROM/BIOS are did NOT change addresses so the display hardware would know a fixed address to use to do the character bitmap lookups.
Read the Alteration Guide. It can be moved... but not while the system is running. Normally you'd not have the entire source and recompile it... rather, you'd use MOVCPM to reconfigure it.
there might be a skeleton of a Univac in that basement..LOL
Makes me want to resurrect my IMSAI 8080. It hasn't been powered up in probably 40 years.
I don't think I'm brave enough to plug in immediately.
I would most likely pull the cards and start slowly on a variac.
Those tw 86,000 uF electrolytics could make a big bang!
Also, when I was young and dumb (as opposed to now, old and dumb) I believed all ICs had to be in sockets and it's loaded with TI chips with silver plated leads, which are now black.
🤔... I hadn't given that the full consideration it might deserve. At a minimum I should keep the cover on.
Those old 7805 regulators were such a pain in the butt to me (in other hardware), that I went looking for an alternative. I found that RECOM makes a 78E5.0-1.0 which is a 5v switching regulator, 1A output, in standard 7805 pinout. It doesn't have a heatsink mounting hole, though. They take up to 28 volts input and more input volts doesn't mean more heat. It was a god-send when I wanted to add an ATTiny85 based light controller to my 24v powered 3d-printer. Not affiliated with them, other than as a satisfied Digikey customer.
I have a bag of them in my parts bin too!
Thanks for the info, that sounds so much better than the 7805. Might grab a few of them myself. The 7805 regulators really are disliked for good reason, they're pretty weak and waste a lot of power, heatsoaking everything nearby in the process. But they're cheap so they're very common.
For the fun of it i decided to get very familiar with the ED editor, and compare it to Wordstar. For programming lines of code, i found ED to be better. For one, it loads a lot faster than Wordstar at original hardware speeds.. Thats important given that you can only run one program at a time. Two, you can use a custom Submit file to facilitate opening ED to whatever line, or block of lines you want. Like Batch scripts, Submit scripts take parameters. I changed the name of ED to EDIT so i could give ED to a .SUB script. ED 22 for example, could open my source code in ED right at line 22, very quickly , in just four keystrokes. This is especially useful given a language like C-Basic (from Digital Research) which would give you a listing of all the line numbers where there was a syntax error or something. ED was part of a nice little drvelopment environment, all tied together with .SUB scripts.😮
ED was my daily driver all the way through college (including grad school.) I did use wordstar for term papers. But 99% of my typing was code.. and ED was the tool for that!
@@JohnsBasement Not surprised. I thought it was genius for editing without a mouse. For fun I also got very familiar with line numbered Basic from Microsoft, which I guess was an effort to combine a line editor with code. I concluded it was better to have a dedicated line editor with a Basic that did not use line numbers in the code, such as C-Basic from Digital Research. ED was better than line editing capabilities in MS Basic, and Basic without lines is way better than with, speaking from experience. Even better, this allowed C-Basic to be semi compiled, like Java is today. It only got better with MS QuickBasic, but that wasn't possible till 16 but CPUs.
Much obliged.
You're welcome.
That 110V AC line you mentioned that is on the edge of the power supply PCB - I live in Australia, which has 240V AC (I don't recommend getting jolted at that voltage), and I own a Cromemco Z-1. It uses the same IMSAI chassis, front panel, and PSU as your machine but has a different overlay and uses a Cromemco backplane and boards. I purposely lifted that dangerous track off the edge of the PCB and rerouted it underneath using mains rated insulated wire to prevent me getting a shock. Now if only the front panel didn't have mains going to it. I haven't figured out an elegant way to fix that hazard.
Oh, and I just had to subscribe to your channel after watching this.
@@snarfusmaximus thanks!
There is a standard hack that pulls the power leads off the front panel to use the switch for a memory write-protect. It suggests adding a toggle to the back of the box.
Funny you should mention this... Last weekend I pulled apart an IMSAI 8080 that isn't working to find all sorts of trouble. It was convenient to just wire-nut the power to on, leaving it disconnected from the front panel.. No switch at all.
It makes me think that if I spent much time inside it, I'd probably leave it this way & use a switched power strip to turn it off.
Oh, and it's good to know that my last weekend's 1 hour quick fix expectation that turned into a cascading avalanche of discoveries of bad craftsmanship... might be of interest to someone. Because it consumed my free time. Leaving no room to get to my actual todo list. 😬
Meh. This is a hobby. Not a job! Enjoy. 😀
Somewhere out in the garage, I have an old system which runs MP/M. It's probably no longer functional, but it was really good in its time.
Coolness! What kind is it?
@@JohnsBasement I don't know the brand or anything like that. It used RS-232 ports and dumb terminals. It was originally configured for 3 terminals/users and 1 printer but you could reconfigure it to use any redistribution from 1 to 4 users and from 3 to 0 printers.
I remember that the HDD was logically divided into "Users" instead of subdirectories, so you just typed "user x" (where x was a number) on the keyboard to switch to a different area before starting a program which was in a different area.
From memory, I think it could logically have up to 16 "users" but the hardware only supported up to 4 since that was how many RS-232 ports it had.
I'm fairly sure it was a Z80 system, and I know it used bank switching so it had more than 64K of RAM (I think it was something like 128K).
I always wanted to try CP/M on my Commodore 128, since it had a Z80 in there for that purpose. But I couldn't afford to buy a new 1571 drive at the time which allowed it to read generic CP/M disks and was fast enough to be usable. Using a 1541 for it was painfully slow.
Commodore floppy disks were pretty complicated devices. They had whole computers inside of them and they communicated back with the main PC using GPIB. The performance was not great.
I'd have to do a side by side test. But even the bit banged SD card on the retro board might even perform better.
I took s sip every once you said OK - now I'm wasted..
😳 .. I hate that I do that!!! When I started recording these videos I had absolutely no idea that I did that. Certainly not as often as I apparently do. You should see how many I edit out!!!!! 🤣
"In the mid-'70s, money was $200-300 a piece." That's some expensive money!
10:02
I love Wordstar, I still use it as my primary editor on Linux in the form of JOE
Wordstar was a killer application of the era!!
Proper computing. We suffered for our art. :)
Indeed we did! I often think that if everyone did then we'd have better quality software!!
I just discovered your channel.
I have watched you walk through your "reset" and "shadow" circuits.
Do you have the schematics to the IMSAI and can you walk through how it works. How is the processor paused, how is data written to RAM, how is the address advanced for deposit and inspect, how is the processor single stepped, etc.
Yes. I do. 🤔 Ya know? The way the front panel controls the CPU and the bus is not as straight forward as I expected the first time I looked at how it all works.
I'll add the idea to my TODO list!
@@JohnsBasement do you know if MITS did it the same way?
Do you see any reason to give your Z80 SBC a front panel, other than seeing the pretty lights?
Yeah, I think so. This discussion matches the way that I know the IMSAI works:
retrocomputing.stackexchange.com/questions/12194/how-did-the-altair-8800-front-panel-load-the-program-counter.
Yeah. I wanted to put a front panel on my Retro board. I LOVE the look of the IMSAI. So it would HAVE to have those cool colorful switches! But I am not so sure I want to pay for it.
I considered building a cost-sensitive one using dip-switches & LED bargraphs. --- I can't find my original one that I made to go with my Z80 board back in 1981. It was an S100 board with only DIP switches on it. No LEDs!.. click carefully!!! I used it to debug my code for what would become my boot-ROM image. That thing really was bootstrapped from nothing when I first brought it up. :-D
John - A digression as not relevant to your Retro 80 but may be of interest.
Your talk of teaching the drive geometry to the CP/m system had my memory whirling and caused headscratching. I had an Amstrad PCW back in the day. These used Amstrad own 3" drives forcing the user to buy Amstrads own discs. I objected to this and unplugged the built in 3" drive and plugged a standard 5.25" drive in its place so I could use the cheaper and higher capacity 5.25" discs. This I could do because of the Shugart Standard interface for floppy drives, a similar thing to the modern SATA system.
So, it had me wondering me 'Why do you need to setup the drive geometry in CP/M"? Maybe because the Amstrad used a later version of CP/M i.e. version 3? Did Shugart come along later than CP/M 2.2? Or maybe my memory is playing tricks!
Funny you should ask. Monday's video talks about configuring the CP/M disk parameters.
CP/M tries to help the BIOS by passing track & sector numbers to the I/O routines in order to simplify the floppy disk drivers.
I doubt this is related to the interoperability of the 3" CPC drive and 5.25 disks on the amstrad.
According to Wikipedia's discussion of disk formats, it looks like the 3" and 5.25" both rotate at 300 rpm and I suspect (though I'd have to verify this) they both run at the same bit rates. So it is possible that a controller could run either without even knowing the difference.
I had an Commodore c128d in 1988. Among others, it had a Z80 CPU that would run a CPM OS.
But even in 1988 there was no Software to be had for CPM. Not for home use at least, I was a teenager and not interested in spreadsheets. So I probably dabbled with it for 10-20h in my whole life.....
Now I understand why there was no Software for it....
But they marketed CPM as this well-established OS with a huge pool of Software - I saw nothing of that. None at all.
I was already online around 1990, still looking for Software for that CPM. I had no idea how I would then Transfer it on a CPM OS Disc but I didn't even get that far. Even by 1990 there was no Software to speak of to be had for CPM. at least no pirated or open source, eg nothing to be downloaded.
Probably there was Business Software for it that could only be aquired by disc. But since it was obsolete anyway, you probably could not even get those anymore.....
It was a bit sad. There was this extra CPU in my machine and of course you want to use it.
But, tbh, they probably just included those Z80s in the C128d to get rid of old Stocks. It didn't make sense, really....
But it sure sounded good on paper: an old established OS with loads of Software 😂😂😂
By 1990, maybe. 😂 Yeah, if you wanted to play games, CP/M was not the cool kid in town.
I was never much of a PC gamer. In the early 80's, the games at the arcade were way better.
The address and data LEDS are functioning correctly, at high speed.
Yeah. Someone reminded me that the I/O operations will dittle the high-byte of the address bus. So that is why they are flickering!
I know that a 1-instruction jump-loop at zero keeps the address bus looking very quiet. So the address bus glitching seemed unlikely.
'Steal' seems a bit harsh. Tim Patterson's QDOS is 8086 OS that used the FAT filesystem which had an int 21h API which was designed to be compatible with CPM's BDOS API. He did it so if people used Intel's software translator to translate their 8080 CPM applications to 8086 the result would run on QDOS. Because QDOS run on a different CPU and used a different filesystem there's not any actual code shared between the two. And there's nothing illegal about reimplementing an API. Also QDOS's version of the Bios is better optimized with only one call to read sectors vs three in CPM.
Point taken. It was the higher level ideas are what were similar. No foul there.
@@JohnsBasement I am kind of jealous of Tim Patterson. Imagine being able to spend a couple of weeks coding and write something everyone ends up using. Also it seems like he was set for life after that.
@@user-qf6yt3id3w Being in the right place at the right time appears to be 95% of the recipe for success.
True. Then Bill Gates stole QDOS and "created" MS-DOS.
I know, technically Microsoft "bought" it, if you're willing to stretch the definition of cbuy". 😋
HI john. my system crashes after loading the retro.bin file, just after the dots ( ....) Not sure if this could be a problem with the memory - which till now has been working flawlessly. Any help appreciated
you need to be a whole lot more clear about what does and does not work. Have you EVER been able to load ANYTHING from an SD card on the Retro?
...By the way, there is a pretty active group of people answering questions about all sorts of stuff in the Discord here: discord.gg/jf73DRZvh5
@@JohnsBasement I did not include a lot here, as already asked at the discord server. Just wanted to get your attention. Thanks
@@javiermitchell7073 thanks. I saw that. Hopefully we'll figure it out.
Just a note to linux users:: put "dirstruct = off" (without the quotes) in your ~/.wgetrc so the Makefile works, otherwise it won't find the downloaded files. Unless you have a specific need to mirror a website, it's not all that useful to have the directories anyway.
This concerns me if it has caused anyone a problem...
Which Makefile has a 'problem'? Why does it even have a problem? Because I don't even HAVE a ~/.wgetrc file!
Therefore I can only assume that you set up your environment differently than I did and discuss at nauseating length in my 'setting up a PI for development' video (in the Z80 Retro Playlist... see video description for playlist and github links.) Not that this is wrong... but it just seems VERY odd to me that what I gave out does not work for the default/general case.
So what OS are you running on that this does not behave as it does for me out of the box?
What, if any, settings might you have overridden in your .wgetrc that may have caused a problem for you that needs this additional setting?
Maybe the best way to fix this is to add -nd to the wget commands in those Makefiles where the wget commands appear and should not be creating sudbirs?
John, it was the main Makefile in the cpm22 directory doing the wget fetching, i think that was my only stumblle, the -nd option is the better one, I was just trying to avoid being the pesky linux person forcing you to alter your setup because my version of a utility has always defaulted to a different mode of operation, ant tbh I'm happier to set the option in my .wgetrc so if I *want* a directory hierarchy I have to use -x. Half the time it creates a bunch of extra indexes I have to delete anyway or gets stopped by the robots.txt cops :P
@@ewetoo I understand. I think -nd is the best option here because it SHOULD then ALWAYS work.
I'll push that up.
oh and btw my boards came from jlcpcb today and they're fantastic so i am going to get the bits for the programmer and build that in a couple of weeks. I kind of need a cataract operation done first so I can see it properly though so I'm not rushing things :P
I have a friend that had a system just like the one in the movie "Wargames" and it cost him over 10K at the time. I wonder where the kid got
the bucks or his Dad would shell out that much cash for such a system. It cost me $20 for a 2mhz Z80 and that was cheap back in the
mid 70s
Yeah. I mowed a HUGE amount of grass for like three summers to buy the parts to build my S-100 system.
Back in the day when some kid would show up with a shiny $10,000 system, it made me wonder if they even COULD appreciate it... in a mixture of jealousy and whatever the inverse is at the same time.
I am pretty sure that I enjoyed my experience and ultimately got more out of it than they did theirs.
This situation reminds me of this passage:
books.google.com/books?id=7papZR4oVssC&lpg=PA60&pg=PA62#v=onepage&q&f=false
... and the fact that the absolute best programmers I know own a soldering iron.
@@JohnsBasement Always had a thing for the IMSAI system since I got to play with my friend system. I still may have some boards he gave me and your more than welcome to them. Just want to give them a good home.
Wow! That is so generous! ... I think I might just have to do a series on S-100 boards.
Drop me a line at my NIU address and we can discuss it. You can find it here: faculty.cs.niu.edu/~winans/
So... am I programming this with a keyboard or with the flippy switches? And if with a keyboard, why the flippy switches at all? I'm sorry, I'm just not grasping this.
Before there were keyboards, there were switches.
Adding a keyboard was an upgrade.
@@JohnsBasement One which I would imagine most users took as soon as they could afford it!!!
@@Ensign_CthulhuThe introductory price of a VT52 was $890... more than an IMSAI.
Gary kildall was a genius.. Like Tesla, people will someday learn the truth
He did some seriously clever stuff!!
I haven't seen one of those in a very long time. All you need now is a 300 baud acoustic coupler and you're all set to connect to Nords Whopper located in Cheyenne mountain, or perhaps order 2 tickets to Paris if you have a hot girl friend. Try a nice game of chess. You could always play Global Nuclear War, but the results might not be what you are expecting.
I got a 300 baud home made modem. If it works, maybe I'll be able to git it to dial into something. ( It is a direct connect though.)
@@JohnsBasement when I first got an external 1200 baud modem. People used to come over and were just fascinated with the status indicators. I doubt anyone in their 30's or maybe 40's could work those old computers. Back then you had to know a lot about how computers worked just to run a simple program. Mainframes had almost no protection against intrusion. The late 70's and early 80s was like the Wild West for computers..I hope you have a great night.
@@rickhunt3183 Hey thanks! You have a great night too!
I wonder if they dreamed of a day when 60 Gigabytes would be too small to install the operating system.
There is so much bloat-ware out there these days. 😖
chaneg the fan to nactua quite fns
But, can it run Crysis?
I'm kidding
How about a nice game of chess?