Tuesday, June 16, 2020

33209: Straits -- Bringing Up Flex

Chapter 13.0: Straits -- Getting Julia Booted Up

Chapter 13.1: Straits -- Bringing Up Flex


Julia waited patiently while I disappeared down the rabbit hole again.

"So you let those drives do their exercises all night last night, until you got back from delivering your newspapers this morning."

"Yep."

"And they didn't mess up so bad that a retry wouldn't fix it."

"Uh huh."

"Which means now you can load this operating system into memory, right?"

"Yeah, now we can be fairly confident that we can load the OS into RAM with these disk drives."

"But even if you write a program to read the operating system into memory in the place it's supposed to go, it's not going to run?"

"Maybe I'm wrong and it might run after all. But it looks like it will either run off a cliff when it calls I/O routines that it expects to be there but aren't, or it will go looking for those routines, not find them, and give up. And I'm not sure how we'll know which is happening, beyond that it doesn't do what we expect it to."

"That's not very friendly."

"I'm sure they don't have manpower to handle every hardware variation guys like me could dream up. And that means I get to try to figure it out."

"Why don't they just give you the code?"

I dug around in the manuals and found the license text and showed it to her.

"They don't think people will pay for their copies, so they make it, uhm, hard to use?"

"Companies like Smoke Signal Broadcasting and Southwest Technical Products Corporation pay for the engineering work, and those companies pass the cost on to their own customers."

"How much?"

"A lot. Several engineers, often several hundred hours of work to get it fully running right with all the hardware."

"So they're not just being rude."

"I think there are other ways to be sure people pay for what they get, but, no, they are not just being rude."

"So even if it works, it might not work well?"

"Maybe."

I continued scanning the manuals in my lap, and Julia didn't say anything more for a moment.

"Oh, I think I found something here."

"What?"

"Hang on." I scanned the pages I had open again. "This entry shows an area where the standard disk drivers are, and there are vectors that they can be called through at the beginning. If my drivers imitate drivers for Western Digital controllers closely enough, I should be able to overwrite those vectors with jumps to my own code."

"I'm lost."

"Vectors are like pointers to where the drivers are actually stored. These are jump vectors, so programs call them and the jump instruction sends them on to the actual driver routines."

"Oh-kay. So you have to write new drivers and put them where the existing drivers are?"

"I'm thinking I'll put them outside the memory Flex uses and overwrite just the vectors that are there for linking through. That should minimize potential for damage."

"As if I knew anything about the question I just asked, much less what you just said."

She laughed, and I leaned over to where she sat on the bench seat and gave her a hug.

"It's sure nice to have someone to talk with while I'm down in that rabbit hole. I'll show you those vectors when I get things put together and running."

"I'm looking forward to it."

We both chuckled at the mixed irony in her tone.

"I guess my first project is to do what the manual suggests and copy the disks they sent me, so that, if I mess something up, we have a backup."

"Good idea. How are you going to do that?"

"The test routines should help. But it's a little scary. I'm worried that my drives will malfunction."

"Isn't there some way to prevent the originals from being copied onto?"

I showed her the write protect notch on the floppy cover and the strips of write-protect tape tabs from the box of floppies I'd bought in Austin. "This is backwards of good engineering, but if I cover this notch with this tape it should protect the disk -- if the drive electronics function correctly."

She smirked. "Doubt your own work?"

"Yeah. I haven't actually implemented the protection in the hardware."

"Well, maybe you should. But why is it backwards?"

"Uhm, I guess maybe it depends on how you look at things, but I'd rather it be protected if the tape falls off."

"I guess that makes sense."

"You know, some computers implement write-protect in the driver software instead of the controller hardware, so you just can change the drivers to make your drives work the way you prefer. But I think you're right, I should add the write-protect circuitry."

I dug up my diagrams, and drew in some additional logic. "If I add a few gates here, and connect it to the controller I/O here, I can make the controller respect the write-protect notch by default in the hardware, but allow the driver to invert the sense."

"Make it complicated? Why not just do it normal and keep it simple?"

"Keep it simple. Didja know that's actually an engineering principle?"

"Engineering principle?" She gave me a lopsided smile of curiosity.

"It has  an acronym: K-I-S-S."

"Okay." She leaned over and gave me a peck on the lips. "And that's three times, now."

I grinned. "And I'm not complaining."

"So -- what's the second 'S'?"

I looked at the floor and coughed. "Erm, you have to understand, it's a special bit of engineering jargon. It sounds a little, uhm, stupid, but it has special meaning."

"Okay. So tell me."

"It's 'stupid'."

"You said that."

"Quote stupid un-quote."

"Oh." Now she gave me a sharp look.

"It means, not trying to be too smart. Trying to be too smart makes things not simple."

"Uh-huh."

"No, seriously."

"I believe you." She laughed. "But I think I'll remember this one."

"Heh."

"So, the write-protect circuit, right? How do you keep it simple?"

"Well, I already have the sensor hooked into an input bit of the controller's MCU, but the controller ignores it for now. Instead of adding hardware, I could do this in the controller's firmware, and that way I wouldn't be depending on the driver software in the computer for protection."

"Does that mean re-programming the controller?"

"Yeah. Hmm. While I'm in it, I could add a switch to allow it to switch between FM and MFM on the fly."

Julia watched and asked questions, and listened to my answers, while I put a 68701 in the EPROM eraser, loaded the floppy controller source code from tape, added the code to handle write-protect and the FM/MFM switch, and programmed the new controller.

For a test, I wrote a quick routine to duplicate and check a single-sided disk in the second drive to the first drive and used the routine to duplicate one of my test floppies. That worked, so I tried to use my disk drives to duplicate the OS disk.

"Error."

"What kind of error?"

"It won't read TSC's floppy."

We both sat and thought for a minute.

"Can you do it with Giselle's computer?"

"Worth a try."

We went in to Giselle's room, and she agreed to set the project she was working on aside long enough to let me try to make a copy. I attached one of my drives to her Color Computer controller as a second drive and wrote a quick program in EDTASM+, then inserted the disks.

"Error."

"Could the disk be bad?"

"Let me look up the error code." I thumbed through Giselle's manual. "Format error. But I'm reading it in raw format, so that shouldn't make a difference."

I thanked Giselle, and we took our stuff back to my room.

"I guess I'm going to have to wait 'til Monday and give them a call."

"TSC?"

"Yeah."

"Nobody in the office today?"

I gave her a quizzical look. "Might be. Worth a try. It's even not the most expensive time to call. But let me make sure what I'm going to ask before we do."

And I dug back into the manuals.

"Oh, look at this."

"What?"

"The disk they sent is FM."

Julia looked pointedly at my stereo tuner.

"You've been waiting a whole week to say that." I laughed, and she laughed.

"Without words. But not the same FM, I guess? And there's no AM?"

"AM. The bit clock is the carrier, so 0 is absence of clock and 1 is presence. Ick."

I reached for some paper, but she put her hand on mine and stopped me.

"I was just joking about the AM."

"Okay, okay, I'll see if I can puzzle that one out later."

The changes to duplicate the FM disk were quick, and the copy proceeded without further error. "And that was verify-after-write, so it should be gold."

"So -- my suggestion to call wasn't necessary?"

I wrinkled my brow and leaned over and gave her a peck on the lips, but stayed close. "It was part of the conversation, and kept me from getting stalled." My eyes searched hers.

She returned my searching look. "Just to be safe, make another?"

"Good idea." I sat back, with some regrets, and made the second copy, then copied the second of the two OS disks TSC had sent, the utilities disk, "Just for good measure."

We shared a hug.

"Okay, now I need to write the drivers."

Because I'd been constructing the controllers to emulate the Western Digital controllers, the basic drivers were a straightforward extract from my test code. And I showed Julia where the vectors were and how I'd over-write them.

"And now the throw-away loader."

"Throw-away?"

"If it works, I'll only use it once to load Flex into memory without using the drivers. Then I'll load my drivers from tape and overwrite the driver vectors, and call the OS's cold boot routine. Then we'll be running Flex, and I'll use Flex itself to make a bootable disk that contains Flex with my drivers."

"Finally running the OS?"

"Yeah. Exciting, huh? I'll probably base the boot loader on the throwaway, so it won't be completely throwaway. But since the first one's throw-away, I can write it to run anywhere. Maybe I should just put it after my drivers anyway, so I can keep the drivers and the loader together."

I was in good form, the loader ran the first time, and I was able to boot Flex. Flex's prompt came up on the screen.
FLEX  2.1            
+++                      
I turned to Julia with a hand outstretched for a slap of the palm, but she wrapped her arms around me and gave me a しっかりした kiss.
Shikkari. 
When I was a new missionary, I hated that word. It seemed to mean whatever fit the speaker's sense of what was right, and it seemed to ignore the right of the person being spoken to to have any sense.
しっかりした体格 shikkari shita taikaku -- proper build/physique (solid build)
しっかりしなさい! Shikkari shinasai! -- Do it right! (Hold it together! or Hang in there!)
Righteous kiss? Proper kiss? Solid kiss? Who has a right to judge a kiss? It's not a sporting event.

Okay, I liked it. And it wasn't just a quick buss. Somehow, "shikkari" fits.

"Ahem," Giselle's voice interrupted. "I hate to interrupt, but, uhm, the missionaries are here?"

We broke apart and turned in unison to give Giselle a guilty look.

She smirked. "Well, it's none of my business, but, since the missionaries are here, maybe you two should save that."

We both stood up a little unsteadily, left the computer at the Flex prompt, and went to meet the missionaries.

*****

The discussion we had with the missionaries was pretty straightforward. At the time, the first lesson in most of the culturally Christian world was an explanation of the vision Joseph Smith Jr. had when he was fourteen, somewhat more complete than I had given her to that point. I will mention here that the interested reader will find it in The Pearl of Great Price, "Joseph Smith -- History", but otherwise leave it out of this story.

Giselle joined the discussion, and, after the discussion, I invited the missionaries to stay for lunch. But they were on their way to see Julia's family, and Mrs. Cisneros had invited them for lunch there.

Julia and Giselle and I ate lunch together, just the three of us.

"They're awfully young." Julia thoughtfully arranged salad on a second slice of bread spread with peanut butter.

She hadn't even commented when I suggested one of our family's mainstay quick lunches. Well, she did comment on the crunchy, no-sugar, no-additive peanut butter we bought in bulk from the co-op. She said she liked being able to taste the peanuts.

"Only a year younger than you and Joe are."

"Okay, they seem young. That wasn't really all that persuasive a presentation."

Giselle reached out and took Julia's hand, and gave her a searching look. "We aren't sending missionaries out to convert the whole world."

"No?"

"No. We are sending them out to teach people who are ready to listen."

"Oh."

*****

On the way to the lab, Julia reached over to where my hand rested on the shift lever, and hesitantly, tentatively covered my hand with hers.

"Mmm?"

"Uhm," she started hesitantly.

"Mmmm?"

"What if I'm not ready to listen?"

I turned my hand over and gave hers a squeeze. "Whether you join the church and whether you and I end up getting together are two separate questions." Then I had to turn my hand back over to shift gears.

She kept her hand over the back of mine, but was silent until we turned right on University Avenue.

"But if I don't convert, then ..."

I waited for her to complete the sentence, but she didn't.

"We'll ask God what to do then. The missionaries have six discussions they present. When we get through those, you'll have the basic understanding of what to do if you're ready. Until then, don't worry about it."

"Will you still like me?"

"Too late to ask that question. I already do."

"I mean, enough to ..."

"Ask you to marry me anyway?"

We were both silent until I parked the car in the west parking lot, and we started unloading our stuff from the back of the Colt.

"Well?" she asked.

I put the Micro Chroma 68 back down in the bed of the compact station wagon, took her in my arms, and we stood face to face, lost in each other's eyes. I nuzzled her nose, and she giggled. Then I gave her a shikkari shita kiss.

I suppose it was at least a half minute later when we heard Mike say, in a voice dripping with sarcasm, "Well if it isn't two love-birds engaged in a little PDA."

I felt Julia start, and stiffen, but I kept my arms around her, and she relaxed before turning to say with a smile, "Yeah. I guess it is."

Pat and George were behind Mike, and neither of them seemed comfortable. Mike looked openly angry, but he seemed to be trying to keep his anger in check. He shook his head and walked past us with no further comment, followed by Pat and George, neither of whom said anything.

"Whenever you're ready, tell me about Mike."

Julia leaned into me and buried her face against my shoulder, and mumbled.

"I didn't understand any of what you just said, but if you're not ready, I'll wait."

She leaned back and held my gaze with her eyes, letting me see her fear. "I guess it wouldn't be fair to you."

I said, as gently as I could, "It's your choice when to tell me. I won't act on information I don't have."

I thought I saw her lower lip quiver before she pulled her face into a tight, wrinkled, hesitant smile.

"We dated really seriously in high school. Dad wasn't happy, but Mike and I promised ourselves to each other. Then Mike seemed to think promises meant more than I thought they did, and I broke it off."

"I can see him not being happy with that."

"He blamed my faith, and I told him point-blank that I would not accept that from him. We could still be friends, but I wasn't going to trust him like that any more."

I smiled and nodded and gave her what I hoped was a reassuring caress.

"He tried to take me too far. I can't let that happen. Not before marriage."

I nodded again, still searching her eyes. After a moment, I guessed, "But there are still some leftover feelings."

She looked down. "Yes, there are."

"He's a good-looking guy."

"You think so?"

"Absolutely. Watch which of the women in our group are watching him today in the lab."

"What about ...?"

"Of course, looks aren't everything. Still, if he's behaved decently towards you since then, I would be lying to deny that it's another point in his favor."

She still hesitated, then seemed to get courage to be more plain. "What about his race?"

"African, I suppose."

"You don't seem to hold that against him, either."

"Cultural issues are much more important than race. If I'm not going to hold religious culture as an issue between you and me, I would be somewhat lacking to hold race, whatever that is, as an issue with anybody."

"You're not jealous?"

"God only knows what the future holds for him, for me, and for you. At this point, I can see several paths ahead. If God tells you and me to get together, and if you are agreed, I'm game. If you aren't, or if God says no, we'll figure that out when it's time."

She wrapped herself around me, and I nuzzled the back of her neck.

"But let's get to the lab before anybody can make up any really egregious rumors about us."

We both giggled as we grabbed our stuff.

*****

Neither Pat nor George, nor Mike, had mentioned the scene in the parking lot when we got to the lab, and we just set the computer up and got started. The lab session turned out to be quite productive.

Mark and Jeff helped Suzanne and Winston with their mainboards while everyone else discussed the keyboard/trainers. I put another diagram up on the chalkboard to help the discussion.



"Those buffers may be internal to the MCU," I commented as I finished the diagram.

Since I hadn't saved an OS image with a complete boot loader, I had to stage load the OS again using the throw-away loader. But it was just an extra couple of steps, and several in the group were very interested in watching me go through the steps.

"I use the TV-BUG L command to load the drivers into place from tape." The code was short, so even though I had saved it to slow tape, it loaded quickly. "My throw-away loader is with the drivers, so I use the TV-BUG G command to jump to it, and it loads the Flex OS, then returns to the monitor so we can check it using the E command. E for examine, I guess."

Wallace complained, "That's just a bunch of hex numbers."

"Well, it's good enough to check Flex's driver vectors and overwrite them with the M command." I did so. "M for modify. And now we can use the G command again to go jump through Flex's cold boot vector and boot Flex."

Flex booted, and we got the prompt again.
FLEX  2.1            
+++                      
With the Micro Chroma 68 running Flex, I was able to load and run Motorola's cross assembler for the 6805. That allowed us to assemble and test code, so several of the students started writing assembly language code the old-fashioned way, with pencil and paper. There were several comments about being glad that they wouldn't have to hand-assemble their programs now, but others noted that we all had to share my computer for a while.

Everybody seemed focused on using the 6805's fancy bit I/O instructions.

Bob and Jennifer were working together, and Jennifer typed in their code while Bob read it to her and checked it over her shoulder, then assembled it and burned it into a 68705 to test. They got their expected output, but then they were stuck on how to generalize their code without making multiple copies of blocks of code, changing each copy a little at a time.

"This isn't just tedious, it's going to be error-prone, isn't it?" Bob commented, Jennifer nodding her head in agreement.

Dr. Brown and I agreed.

We took a look at several other attempts at decoding the keyboard, but they also ran into the same problem of needing to use copy/paste techniques to deal with the whole keyboard matrix.

Neither Dr. Brown nor I seemed inclined to point them to a different approach, but I had a different suggestion.

"Tell you what. Let's take a break from the keyboard decoding and look at getting real output on the LEDs."

"Real output?" Kyle asked.

"So far, all we are doing is lighting up segments. Let's make routines we can call to put actual multi-digit numbers on those LEDs."

There were some complaints, but most of the group shifted gears with me. By this time, Suzanne and Winston's mainboards were giving output, and they joined us, too.

I redrew the display block diagram by itself.


"Is everyone clear on the idea that we will be enabling, or strobing, one digit at a time?"

Sheryl raised her hand. "No?"

Bob stood up and went to the chalkboard. Pointing to the lines coming out of the left buffer, he said, "All these lines -- wires -- are shared -- connected to each display." Then, pointing to the lines connecting each display to the buffer along the bottom. "These lines are not shared. We have to demux them somehow."

"Yep," I agreed. "Maybe I should draw a diagram of one of the digit elements."


"No buffers, no latches, just light emitting diodes in those seven segment LEDs."

Sheryl's forehead wrinkled. "That's common anode, I guess."

"Right."

"And if we have seven banks of those with cathodes connected in parallel, ...," she thought out loud.

"Ah!" Freddie exclaimed. "You have to activate the anode of each digit separately, or they'll all show the same pattern."

There was tentative agreement among the electronics students, but the data processing group and Julia were still lost.

Except Mike wasn't.

Mike stood up at the chalkboard where Bob and I were, and started sketching out the segment matrix. When Bob saw what he was doing, he started helping.

I also raised chalk, but Mike pushed my hand away. "Too many cooks," he grumbled.

I grinned and stepped back. Then I looked over at Julia with my eyebrows raised, but she wasn't looking at us. She was checking the reactions of the other women in the room.


"Nicely done," I said when they were done, and started to reach out for a slap of the palms, but it didn't look like Mike was going to respond to that. So I gave them a thumbs-up, and Mike gave me a dirty look.

Bob looked at me questioningly, so I gave him and Mike a nod, and they took over the explanation. When they were done, everyone was satisfied that activating the strobe for all digits at once would put the same pattern on every digit, and that it might work to strobe them one at a time. But there was considerable concern about flicker.

Dr. Brown got out his TI programmable calculator with LED readout and had Wallace turn out the lights. then he walked around the room waving the calculator so that everyone could see the flicker. Many of the students commented on having noticed the flicker. I think it was Tanya who related it to TV flicker.

I reminded them of the TV refresh rate, and from there we started calculating the refresh rate for the seven segment displays. It was agreed that scanning the entire set of digits thirty times a second should present a somewhat stable display, which would mean each digit should get a seventh of that interval, or 1/210 of a second -- between four and five milliseconds.

With the lights back on, we talked about setting the 6805's timer to interrupt at that rate, and pretty soon several groups were putting code together. By the time Dr. Brown suggested we shut down for the day and go home, all the groups were able to display arbitrary digits on their displays, and two of the groups were able to output bytes in hexadecimal.

Some of the students were curious about brightness, and I tried to venture into duty cycle, but Bob suggested we'd had enough for a day, and I had to agree.

*****

"Are you up for some singing tonight?"

"What?" Julia was lost in thought on the road home.

"I need to practice for my recital."

"Recital," she said absently. "You were right. I think every women in that group has some kind of a crush on Mike."

"Some of the guys, too."

"I'm not going to pretend to understand that. What's this about a recital?"

"The singer's diction course I'm taking."

"Oh, that. You haven't been practicing."

"Not enough. I probably need to practice a half hour a day for the next two weeks."

"I love to sing."

"I know."

"And I can play the piano for you, too."

And that was what we did that night. Julia called her family, and they came over and we had dinner together, played some rounds of Pit and Uno, and had a two-family sing-along, leaving computers and other difficult questions behind for an evening.

Julia and Mom played some four-handed music. And they let me squeeze in some practice. We sang the hymn, "O God, the Enternal Father" in English and Spanish before I practiced it in Japanese.

(Just as a reminder, Julia is a composite of several of the women I knew in College. If this story went at the pace of my real life, it would be turgid, and I'm sure not nearly as interesting to read about. Also, if the fantasy version of me waited for his first kiss until Helen broke my heart in the real world, he would also likely be waiting another four years before digging into computers for real. Events around me would not allow that, for the purpose of this story.)

*****

After Julia gave me a good night hug and went home with her family, Denny called.

"You up for a trip here next Friday?"

"What's up?

"Management wants a bit of your time without the distractions. They wanted to fly you in, but I pointed out that it would be just as fast for you to drive as to catch a flight, and you'd probably want to visit the surplus shop on Saturday. They said they could pay mileage instead of plane fare, if you can make it by five or six."

"Hmm. When do I need to have an answer?"

"Monday morning."



[Second version backup at https://joel-rees-economics.blogspot.com/2020/06/bk01-33209-straits-bringing-up-flex.html.
Original backed up at https://joel-rees-economics.blogspot.com/2020/06/bk-33209-straits-bringing-up-flex.html.
Some more notes at https://joel-rees-economics.blogspot.com/2020/06/notes-33209-straits-bringing-up-flex.html.]


No comments:

Post a Comment

33209: Discovering the 6800 -- Parents and Polygamy

A Look at the 8080/TOC "Whoa, Merry, look who's here!" Jim said, sotto voce. He, Roderick, and I were at our lab table ...