Building the Emulator - Progress and the lack of it
May 2022
September 2026
Good grief! Back on this. The emulator is much improved and all the various micro-instructions sorted out.Still typing in LOS
March 2022
April 2022I did start to write an emulator many years ago, but got too busy to complete it. Still busy, but I am keen to get this going.I have much of the documentation I need, and thanks to Joe Templeman, I have copies of the original coding sheets for a late version of LOS.So, the plan (or hope) is to build a virtual M18 that boots LOS.The bootstrap (just five words of core) is run at location 100. This loads all the sectors of the OS from disk into core. So, I need to understand the M18 I/O instructions. These were typically 'hidden' from the application programmers.
Boot sector all works and loads the OS Sectors into place. Assuming we are going for a full boot, the Initiator then gets called. This is where the hard work starts! The initiator loads the Configuration Table from disk and sets up the various core based structures such as IO devices, disk drives, free core spaces, the system table, and file table(s). This is hard work!* Booting into Special OP works, and that at least proves the terminal I/O instructions are being emulated correctly.Things I discovered:
- Left Shift and Right Shift is supposed to copy the bit that gets dropped into the Carry Flag. Didn't expect that. Perhaps also explains why (prior to the Mk V) the Carry flag indicator on the front panel is called 'Overflow'.
- Endless corrections especially around the micro-instructions.
May 2022
March 2022 - Bootstrap
The Bootstrap was loaded manually through switches on the font panel of the M18 - thankfully it's only five steps long.
(Note all numbers are in Octal)
Location 100
004400 CLB010670 DATO 3 B 70010570 DATO 2 B 70011470 DATO 1 B SBCD 70020104 JUMP 104Actually, quite a lot of information can be gleaned from this little piece of code!Step 100 - clears Reg B just in caseStep 101 - copies Reg B into Register 3 of device 70Step 102 - copies Reg B into register 2 of device 70Step 103 - copies Reg B into Register 1 of device 70, and clears Done and sets BusyStep 104 - Jumps to same address and will apparently be stuck there forever!However, we have instructed the computer to download sector 0 into core address 0 from device 70. This will read sector 0 from the disk and DMA it into core starting at zero.DMA from the disk controller works by 'stealing' machine cycles from the processor to move data one word at a time into core - starting at address 0.So, our JUMP 104 at address 104 is going to get overwritten soon....In fact it gets replaced by a JUMP 75. It has to jump backwards and the rest of the sector is still coming in. The code after the jump does check the disk controller and then waits until the transfer is complete.(In fact, the emulator transfers the entire 128 sector in on go, so in the trace the JUMP 104 never gets to run as it's replaced with the JUMP 75.)Clever and simple!
April 24th 2022
On booting into Special Op:
(The first line shown on the terminal is just the emulator is connected.)
Special OP was a means of booting the M18 without reference to the configuration table, but simply loading the raw OS from disk and provided five simple functions:
- Read OS (Reads the OS sectors from disk to core)
- Write OS (Writes core back to disk)
- Dump OS (Unsure yet)
- Amend Core (What it says)
- Validate (Show the OS checksum - this is checked when the bootstrap loads the OS)
Booting LOS
> bSeeking to sector number 0(8) Reading from disk into address 00/0000Seeking to sector number 50(8) Reading from disk into address 00/0200Seeking to sector number 51(8) Reading from disk into address 00/0400etcetcetc