Boot options? Demos? Blinkenlights? Autorun? #114
Replies: 14 comments 4 replies
-
Gary - I see in your post you're digging into the documentation then asking questions. I salute you for starting in the sea of documentation. I'm going to add some background for everyone before I try to answer some of your questions. I'm known for writing "Walls of text". I hope you all will read over this. I try to build context which is part of why my reply is so long. Please read to the end then make corrections, ask questions, make this more concise etc. The design of the emulator is also meant to take you on a learning journey. Reading documentation and figuring out how to set jumpers or DIP switches on various expansion boards. In the IMAGE.zip file you can download or find on the uSD card you'll find the file "IMSAI 8080 User Manual.pdf" - this was the manual that shipped with the original kit and was typically the only documentation the user had. I recommend everyone who is new to the system read this. If you bought a preconfigured system from a store, they would configure it for you. A few days later you could go pick it up and they would spend time trying to show you how to use it but if you didn't have the proper background knowledge it would be difficult to really understand. Most users bought expansion cards from ads in magazines either as kits or preassembled and these had a manual. In the early days you often had to learn to read schematics to figure out how the board worked. Some manuals went into detail, but it was hit or miss and often inaccurate. If one of your relatives built an IMSAI kit back in the day they had to go through all this often at the kitchen table with no one to ask for help. User group newsletter, meetings and magazines helped fill the gap. Imagine waiting weeks or months to find a solution in a newsletter, user group meeting or magazine to move forward with making it do what you wanted or even work. IMSAI later went on to what they called Turnkey systems. There was a power switch on the front panel and not much else. You turned it on, and it just worked, like your modern PC today. The IMSAI Turnkey systems often went on to become business machines, manufacturing controllers etc. You most likely bought the emulator for the front panel experience, Blinkenlights, switches and mystery of it. The kit is meant to be enjoyed from this viewpoint. Being frustrated and struggling is, in my opinion, part of the fun is to try to see it that way. The experience is meant to be learning from doing and reading just as it was back in the day. I know the High Nibble, and this is part of what he hoped to recreate, the mystery of switches and Blinkenlights then taking the journey to really understand it from how the 8080 works, how the IMSAI hardware works and programming in machine language*.
Some "purists" will state that "machine language" and "assembly language" are the same. I use the terms to differentiate between doing it by hand vs using software tools like assemblers. I ask that the "purists" not jump on this discussion to point this out. If you want this discussion, please create a "New discussion". Back in the day when someone spent as much money as a decent used car cost for an IMSAI there was plenty of frustration when it didn't just do something automatically, or even work. In 1977 I bought a used Chevy Impala for $300, I made $1 an hour. As a teenager the car was the priority, I drooled over computers like the IMSAI but didn't have the money. Let’s now pretend we're at a user group meeting at the local high school and your questions have come up. I've wandered to the front of the room as I think "Can I answer this?". The IMSAI doesn’t have an automatic 'Power On Reset'. It’s up to the user to RESET and start (RUN) the machines. This was due to the fact the early machines only had RAM so on powerup there was nothing to reset too, RAM is volatile, on power up it holds random data. The user had to toggle in the instructions and data they needed then RUN it, this could be a loader for paper-tape, a floppy disk, a game etc. Some expansion cards added a 'Power On Reset' but you have to have an address to reset to. Resetting to address 0x0000 was straight forward as the RESET switch does this. The ROMs used for CPM need to be in high memory as CPM expects to have access to lower memory as RAM, the CPM manuals have the memory maps. You'll find many ROMs started at 0xD800 but there were plenty of other start addresses. So, how does CPM get booted if the machine resets to address 0x0000 when the ROM lives at 0xD800? On reset the ROM is remapped from 0xD800 to 0x0000 in hardware. The machine is then started (RUN Switch), the first instruction in the remapped ROM is executed. The first thing the CPM loader ROM does is change a hardware configuration bit to remap the ROM back to 0xD800, then it does a jump into the remapped ROM. The magic here is the hardware forces the ROM to stay mapped at 0x0000 for three CPU cycles. This allows time to read a jump instruction from ROM while at 0x0000. When the three CPU cycle delay is done the ROM is then mapped back to 0xD800 and off we go to boot CPM. Confusing, yes, it took me some time to understand this. If you don't know what a CPU cycle is, you have reading to do. BASIC in ROM typically lives in low memory. You would typically change physical jumpers, so the XYBASIC ROM is at 0x0000 permanently. The emulation does this with soft jumpers. This gets the heart of why there are various MEMORY map sections supported in the emulator. The front panel on the IMSAI works by forcing an 8080 instruction onto the address/data bus, letting the 8080 run the instruction then halting the 8080 CPU. Load address, Examine and Deposit all work like this. This is another reason it's hard to do an automatic boot in the design of the IMSAI, at power up the front panel is in control. You control this by Pressing Reset (address is set to 0x0000) then Run which starts the process as described above. If you disassemble the ROM, you'll see the 8080 instructions that do this bit of magic. In IMAGE.zip or on the uSD card you'll find the file MPU-A-ROM.hex - you'll see it in the High Nibbles documentation here: The CPM boot ROM (MPU-A-ROM.hex) code looks like this; all values are in HEX notation; I hope I have this right: ; Press RESET, the CPU address is reset to 0000; the ROM at D800 is mapped to 0000 by the RESET signal in hardware. What the emulator does is replace the hardware configuration jumpers from the expansion boards and implements them as soft jumpers. This is why there are several [MEMORY x] sections, each representing a set of what were physical jumpers but are now soft jumpers. On my Dropbox is a ZIP file with two PDFs in it. One has a mapping table I created for the NVM front panel switches to help clarify them. The second document describes how to get into and setup the NVM for various ROMs and other items like what CPU, what clock speed for the CPU etc. Pretend I handed out photocopied pages of these. When you download this you may end up with a ZIP file in a ZIP file. If the first ZIP file results in a second ZIP file, go ahead and UNZIP it. Link to the emulator startup configuration documentation (Non-Volatile Storage, NVS) – this is how the soft switches are set as described above: The example Memory Maps: |
Beta Was this translation helpful? Give feedback.
-
Thanks, Neil, for that detailed and clear explanation of how the boot works, and thanks too for the dropbox docs. So to have the system boot to a program that I write, it seems I would have to have my opcodes stored into one of the ROM locations, then set the boot configuration to start running at that location. I'm guessing I could replace one of the hex files in the IMAGE/imsai/roms folder of the firmware or add my own. I'm not finding any documentation on how to do this process. Are there some notes somewhere? BTW, it looks like the dropbox docs need to updated to reflect that A15 is the |
Beta Was this translation helpful? Give feedback.
-
As I mentioned in my previous post creating an INTEL HEX file is tricky. These files represent/emulate physical EPROMs in the emulator. How I do it for small programs is this:
|
Beta Was this translation helpful? Give feedback.
-
To create larger assembly programs: |
Beta Was this translation helpful? Give feedback.
-
I'm on macOs. I see that I there are Mac-compatible cross-assemblers such as https://github.com/Megatokio/zasm. Instead of cross compiling, though, could we not just use the ASM built into CPM? Maybe for short programs, ED wouldn't be too painful? And we could test directly before committing to firmware? Then I just have to move the hex file to the right place and complete the other setup as you describe above. I see that the IMSAI manual Program 3 includes the assembly code in addition to the octal that could be keyed in directly. And I see that the "CP-M 2.2" manual in the image at http://imsai8080.local includes a chapter on ASM ("Section 3") and that it outputs HEX files. |
Beta Was this translation helpful? Give feedback.
-
Gary, again thanks for reading the manuals. :)
In none of what I'm writing am I saying 'this is the best way' or even recommending someone follow my path. What I'm mostly trying to communicate is how the emulator works when it comes to ROMs, jumpers etc. I'd love to see other approaches, tools etc. This is the best part of this experience, seeing what others have done, figured out or are thinking. That was the very soul of user group meetings back in the day. It's cool that we are finding some of that here. |
Beta Was this translation helpful? Give feedback.
-
This is a very helpful discussion. Thanks for the nice explanation of how boot ROM remapping works! I verified the sequence you explained by single-stepping through various memory map configurations. Given the information provided, I think I can create a custom memory map and .hex ROM file. I tried the trick of using my TL866CS programmer software to generate the Intel Hex files. It works just fine. I'll try creating a custom setup with a simple program and see if it works. Best, Don |
Beta Was this translation helpful? Give feedback.
-
Awesome, glad to hear this. :) |
Beta Was this translation helpful? Give feedback.
-
Motorola "hex" files were known as SREC or S-Record files. Assemblers that produced this format were limited to those supporting the Motorola line. Any Intel assembler would be highly unlikely to provide that format as an output file. There are a few Linux command line converters that can move between formats or convert a binary file to Intel Hex. There are a few variations of Intel Hex that added support for larger address spaces. |
Beta Was this translation helpful? Give feedback.
-
Nice, I learn something new everyday. |
Beta Was this translation helpful? Give feedback.
-
With the stock Memory Map 2 selected (configuration "0000 1010 0101 1000"), the first three memory locations on a reset are: 0xC3 (JMP), 0x03, 0xD2 This is a JMP to address 0xD203, which in fact occurs at the next single-step with address LEDs showing that address. I assume the ROM is being remapped for the first three instructions to a base address of 0x0000, then mapped back to it's normal address for the JMP. So, the base address of the Memory Map 2 ROM is 0xD200 rather than 0xD800? The memory map configuration for #2 shows the base ROM address at 0xD800. ================================= [MEMORY 2]
Don |
Beta Was this translation helpful? Give feedback.
-
I'm curious why single-stepping yields a different result than examining the memory. The single-stepping mechanism on the IMSAI/Sim shows one result while the EXAMINE/EXAMINE NEXT shows another. If the ROM is mapped to 0x000 on a reset, I should be able to see the ROM code and single-step through three instructions before the ROM is mapped back to its normal space, yet this does not happen. I see only what are apparently RAM values. I checked and the RAM values at 0x000 and up (as viewed through single-stepping) change after a power cycle., so they are certainly RAM. I guess the single-step action must disable the ROM remapping somehow. I checked the memory map using the SYS: widget on the web interface. It shows the following: This agrees largely with what you said it should be, except the main RAM block shows at 0000H - EFFFH rather than 0000H - 0xC7FF. Using the EXAMINE switches, I do see the exact initial three instruction remapping and JMP sequence you described. After the JMP instruction if I advance to address 0x0010, I see the same data at 0xD810 (0xC3, 0xAF, 0xDD) that you describe below but still mapped to low memory at 0x0010, as I am not executing the code. I guess at this point RAM is at address 0xD810 if I examine it? ; The ROM is now remapped to D800, the three 8080 cycle delay end here. In the VIO ROM, my address at which the data you mention is found is off by one. You stated: But I see the same data offset by one address: Interesting exercise. Best, Don Froula |
Beta Was this translation helpful? Give feedback.
-
I'm curious as well. Sorry about getting the data offset by one, I'm completely working from memory and what I can see in the IMAGE.zip download file. As I think about the 3 CPU cycles that get injected after the OUT F3 instruction to set the ROM back to D800 I'm now wondering if this doesn't work using SINGLE STEP? The offset by one was due to me making an error when I copied the HEX values out of the .hex file. :( I'm going to correct it in the earlier post. |
Beta Was this translation helpful? Give feedback.
-
An update. I've been discussing this thread with the High Nibble and now have a better but not perfect understanding of how the MPU-B functionality was added to the MPU-A CPU. There are several things that need to be taken into consideration as to how the front panel works when single stepping with the MPU-B ROM memory mapping active before there is a definitive answer as to why there may be issues with displayed data. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My IMSAI8080 is built and working great. I have some questions now that I haven't found by searching on the website:
How can I have my own program boot? For example if I key in Program 3 (p. 48) from the IMSAI manual.
The Startup Configuration shows how to boot into two ROMs: XYBASIC and CP/M. Are there others? Eg, some interesting blinkenlights beyond normal operation or other demos? I see the Memory Maps, where it lists xybasic, but the rest are cryptic.
Questions I've been able to answer: (Please add/correct...)
Answer:
It's the table in the Startup Configuration section under the grey box "Booting into CP/M 2.2".
Similar to question 1 above, the details of what's in the ROMs is needed for the complete answer...
Answer:
Yes, set the A15 switch 1 in the boot configuration to autorun.
Thanks to highnibble for the kit and to the community for their help. I'm having a great time with this kit!
--Gary
Beta Was this translation helpful? Give feedback.
All reactions