On 4/14/14, Seth Morabito <lists at loomcom.com> wrote:
 Andrew Warkentin <andreww591 at gmail.com> writes:
  I have at last gotten Unix to boot to multi-user
mode in FreeBee (Philip
 Pemberton's 3B1/UNIX PC emulator). 
 Magnificent! This is excellent news. Since I've been diving deep into
 3B1 stuff recently, I've been hoping that someone was working on the
 emulator. I'm glad to know it's active.
 Actually, since we're on the subject, I hope you won't mind if I pick
 your brain about something 3B1 related...
 This weekend I started working on a small daughterboard to replace the
 socketed WD1010 and act as a hard drive emulator, somewhat similar to
 the FreHD TRS-80 Hard Drive Emulator[1], but piggybacking on the
 motherboard instead of sitting in a bus expansion slot.
 Tonight, I realized that part of my understanding was wrong. I believed
 that Drive Number and Head Number were selected by writing to the SDH
 task file register of the WD1010 -- in fact, they CAN be, but I fear
 that the 3B1 doesn't do it that way. The hardware reference manual
 discusses the Disk Control Register (a 74LS373 seen in the schematics on
 page 11/D4), which is directly addressed through location 4E0000, rather
 than through the SDH task file register at E0000C. It handles generating
 the ST-506 Disk Select and Head Select signals directly.
 In fact, the Logic Board Test Procedures in the reference manual make it
 clear that the SDH register is loaded from the disk's ID field after
 performing a reset and a SEEK command. None of the procedures show
 writing to the SDH register, only reading from it.
 So, if my understanding is correct, simply replacing the WD1010 is not
 enough to properly emulate a disk system, unless I'm pretending to be a
 single disk with 1 head. Aiee!
 IS my understanding correct? Do you (or anyone else) have any thoughts
 on this?
 (Copied to the list, in case anyone else is interested)
 -Seth
 [1] 
http://www.vecoven.com/trs80/trs80.html
 
Actually, Unix and the bootloader both write the correct values into
the SDH register (however, the ROM might not; it won't boot the hard
disk directly in the current version of the emulator - I'm booting
 from a floppy with no kernel). The WD2010 emulation
that I contributed 
a while back just uses the value written to the SDH register.
On 4/14/14, Philip Pemberton <classiccmp at philpem.me.uk> wrote:
  On 13/04/14 08:38, Andrew Warkentin wrote:
  However, the emulator is still not quite usable.
The key mapping is not
 quite right (one problem is that the UNIX PC has separate "return" and
 "enter" keys, and there is no mapping for "enter", which is required
to
 accept dialogs, and there might be other important keys that are
 missing). Also, neither the mouse nor the RTC are emulated yet. 
 Andrew, all I have to say is "THANK YOU, THANK YOU, A MILLION TIMES -
 THANK YOU!"  The bus error logic has been a thorn in my side for ages,
 and I just couldn't figure out what was going wrong. I'm really glad
 someone managed to figure it out!
 Get these patches to me and I'll merge them in ASAP and do my best to
 fix the mouse, RTC and keyboard.
 As you said, the main problem is that we don't have enough keys on a PC
 keyboard to do a 1:1 mapping -- thankfully SDL supports Modifier keys,
 so this isn't an insurmountable problem. The big problem is coming up
 with a sane mapping :)
 Truth be told, I'll probably move the repository over to Bitbucket so
 people can fork it and work on it independently, then submit merge
 requests. It takes a lot of work out of manually importing patches.
 Is this based on the OldMMU branch or my revised MMU? I don't really
 care which it is, I'll just deprecate the branch you aren't using so we
 don't have a million and one build variants 8^)
 
You're welcome.
I already implemented the RTC a while ago, but my RTC implementation
was in an older copy of the source that I hadn't looked at for a
while. I forgot that I actually had it in a state where it mostly
worked (reading the date works, but attempts to set it are ignored).
Unix does have some Y2K issues though. I'll include the RTC in my
patches of course.
I did add a mapping of Alt+Return to Enter, and I found out that the
system sometimes still doesn't boot all the way. After I get through
the initial dialogs on boot, the system hangs after the "The screen is
being set up..." message. I just tried it now and instead of a hang I
got some messages relating to the modem, which I dismissed, and got to
a login prompt (I was able to log in and get a desktop), so I think at
least a stub of the serial controller will have to be implemented to
get it to boot reliably (I tried booting again and it just hung after
that message again).
Also, like I said before, the hard disk won't boot directly at the
moment; a floppy with a bootloader but no kernel (the install root
floppy works) is currently required. I think it might have to do with
the head select bits. IIRC you had implemented the Disk Control
Register properly in the new branch, and I'm using the OldMMU branch.