BigEd wrote:
Hi enso - I like the sound of this bootstrapping, but didn't see any more on your wiki: must I read your code?
Cheers
Ed
No, that would be cruel and unusual!
I will briefly walk through the bootstrap process. It is really amazing to see programs like this one or ADT start up a few seconds after typing "IN#2" and really points out to how flexible the Apple II is.
So the host sets up a serial port to 300 baud (for Apple IIc). Once per second (or more often) it sends a "PR#2" on the serial port and watches for input. As soon as you enter "IN#2" on the Apple, the PR#2 command will be accepted and both input and output connected to the host via the serial port.
At this point the host will detect the "]" prompt on the wire. The host sends "CALL-151" to enter the monitor, and sends a small program in hex:
Code:
300:a9 10 8d ab c0 a9 0b 8d aa c0 ad a8 c0 60
This bumps the Apple IIc serial port to 115.2 Kbaud:
Code:
0300- A9 10 LDA #$10
0302- 8D AB C0 STA $C0AB
0305- A9 0B LDA #$0B
0307- 8D AA C0 STA $C0AA
030A- AD A8 C0 STA $C0A8
030D- 60 RTS
The host issues a "300G" to run this code and sets up its own port to 115.2Kbaud. The monitor prompt "*" should arrive in the fast mode.
Now the host loads the "serial loader" into the Apple II; this one loads a game verifying checksums etc. The host displays a menu of games and sends the game you select.
After loading the game (while you are playing) the host keeps checking the port as described above. When you are done, reset the Apple and enter "IN#2" and a second later the link is back up.
I use a similar technique in my interactive environment "HazMat". Instead of sending games, I send lines of assembled/compiled/BASIC code. It's like Apple's mini-assembler, but with symbols and a full-screen editor on the host side. When I press <CTRL><RETURN>, the line of code the cursor is on is assembled and sent to the Apple II monitor. For BASIC I just pass the line through without assembling. I've made many Forths for microcontrollers that use the same technique.