philpem / freebee Goto Github PK
View Code? Open in Web Editor NEWFreeBee - AT&T 3B1 / 7300 UNIX PC emulator
License: GNU General Public License v3.0
FreeBee - AT&T 3B1 / 7300 UNIX PC emulator
License: GNU General Public License v3.0
The main window should have a status line with e.g.:
Testing on a Raspberry Pi 4, I encountered slowdown where the update wasn't getting done in the 10ms time slot allotted.
The 3B1 supports up to three S4BUS-interface expansion cards. Examples include the Ethernet, StarLAN and Combo Card.
Emulation support for S4BUS would allow emulation of these additional interfaces, and perhaps also a "host filesystem" driver or lightweight high-speed serial port.
Hi!
I saw the documentation talk of something called "discim", but I could not figure out how, EXACTLY, I can transfer files in and out of the emulator. As user "install", there is something called "Floppydisk" in a menu, and there is "MSDOS Disk Read" as a submenu, and I cannot get it to work...
Is this even the correct way to try? Or do I log in as root and somehow use the mount command? EDIT: I discovered the msdos command you mentioned, and ran it as root, but nothing seems to happen - it simply tells me there is, effectively, no floppy! I do not get how to use F11, it does nothing noticeable...
Thank you in advance for your kind help and for this awesome emulator!
During UNIX 3.51 installation, there are several benign "unmount failed" errors.
But Robert Masterson reported that these don't occur...
From: Robert Masterson on Mon, May 12, 2014 at 10:18 PM
1) I get no "dismount failed" errors when installing from the 3.51 Foundation set.
Configuring the emulator currently requires editing hard-coded sections of code and recompiling. This is inflexible and annoying.
Freebee should use a configuration file to set up the emulator. This could be, for example, a YAML file. If YAML were used, Libcyaml could be used to parse it:
As a minimum, the following should should be configurable:
The VIDPAL was an upgrade to the base 3B1 which sat between the 68010 CPU and the motherboard.
When the VIDPAL detected an access to video memory, it forced the CPU status bits to indicate a supervisor access. Effectively this bypasses memory protection for VRAM, allowing higher video RAM refresh rates.
This was used to great effect with a 3B1 GUI windowing system implementation.
While VIDPAL can be emulated with a software driver, emulating the hardware would provide a clear performance benefit to user code.
When configuring a system with only 512K RAM, I am usable to boot to login. This was tested using David Gesswein's VCF disk image with the 3.51m kernel. Upon startup it states 315392 available memory (from the 524288 total memory listed). When setting to 1024K RAM, the system boots fine.
The system attempts to load but asserts during "loading drivers" or "setting up screen" in the attempts I've made:
freebee: src/memory.c:1063: m68k_read_memory_8: Assertion 'address != 0xFFFF01' failed.
indicating Musashi m68ki_exception_bus_error() triggered the condition. Musashi says this occurs when a bus error occurs when we were already processing a bus error, address error, or reset, this is a catastrophic failure.
Perhaps the system is running out of memory and attempts to swap? The swap size for that hard drive image looks to be the default 5000k. (Though I don't know how to confirm the 5MB swap is being used.) In normal operation with 4MB RAM, I assume we never need to swap. Perhaps it's something related to memory handling and attempting to swap to hard drive? There is some interplay between different type of page table entries (PTEs) that I don't fully understand:
pte/htpe: MAP RAM (where we update the page status bits in mapAddr() )
mpte: pte's in RAM, used by the OS
fpte: pte's in disk
from sys/pte.h:
/*
/* The format of a pte in the map /
struct pte
{
ushort pt_wp:1, / write permission /
pt_acc:2, / access status /
:3, / non h/w flags /
pt_pfnum:10; / core page frame number */
};
/* The format of a pte in memory (our RAM) /
struct mpte
{
ushort pg_ipte; / index of hardware pte /
ushort pt_wp:1, / write permission /
pg_acc:2, / access control /
pg_fod:1, / is fill on demand (=0) /
pg_swapm:1, / have to write back to swap /
pg_pageo:1, / page is being paged out /
pg_pfnum:10; / core page frame number or 0 /
};
struct fpte
{
ushort pg_blkno; / file system block number /
ushort pt_wp:1, / write permission /
pg_acc:2, / access control /
pg_fod:1, / is fill on demand (=0) /
pg_swapm:1, / have to write back to swap /
pg_pageo:1, / page is being paged out /
pg_last:1, / last data page /
pg_lastsec:2, / disk sectors in the last data page*/
pg_fileno:7; /* file no for the page */
};
This issue can be worked around by setting base memory to 1024.
Freebee currently doesn't emulate the printer port. This would be nice to have.
If Freebee has not mounted a floppy disk (the file pointer is NULL), there will be a segfault at src/main.c:462 when Freebee exits:
src/wd2010.c:349:wd2010_write_reg(): WD2010: READ SECTOR cmd=20 chs=0:0:0 nsectors=1
src/wd2010.c:384:wd2010_write_reg(): READ lba = 0
src/wd2010.c:390:wd2010_write_reg(): READ len=512, pos=0, ssz=512
Thread 1 "freebee" received signal SIGSEGV, Segmentation fault.
_IO_new_fclose (fp=0x0) at iofclose.c:48
48 iofclose.c: No such file or directory.
(gdb) bt
#0 _IO_new_fclose (fp=0x0) at iofclose.c:48
#1 0x0000555555563d70 in main () at src/main.c:462
(gdb) bt f
#0 _IO_new_fclose (fp=0x0) at iofclose.c:48
status = <optimised out>
#1 0x0000555555563d70 in main () at src/main.c:462
i = <optimised out>
screen = 0x55555597b890
SYSTEM_CLOCK = 10000000
TIMESLOT_FREQUENCY = 100
MILLISECS_PER_TIMESLOT = 10
CLOCKS_PER_60HZ = 166666
NUM_CPU_TIMESLOTS = 500
next_timeslot = <optimised out>
clock_cycles = 101516
tmp = <optimised out>
exitEmu = <optimised out>
(gdb)
The UNIX 3.51m kernel (from FixDisk 2) will not boot on FreeBee. The following messages are displayed:
Version 3.51m
Real memory = 4194304
Available memory = 3846144
Main board is P5.1
Disk Ctrlr=?
Disk Ctrlr=?
Disk Ctrlr=?
The "Disk Ctrlr" message repeats endlessly and the machine never boots.
Hey,
for better reach of the community, I would like to suggest to add the following topic to the repository: motorola-68000
UNIX 3.51 boots fine after installation. After shutting down and rebooting, however, the UNIX PC hangs on the "waiting" screen.
This is due to the modem port and UART not being emulated.
This lack of emulation also causes several error messages during installation:
/dev/ph0 can not be opened. Touch any key to continue.
Failed to open modem port. Error return= 19
mac:/Users/tenox/Code> sdl-config --version
1.2.15
mac:/Users/tenox/Code> sdl2-config --version
2.0.12
built latest version from head, the emulator starts and you can see it reading the disk:
mac:/Users/tenox/Code/freebee> ./freebee
FreeBee: A Quick-and-Dirty AT&T 3B1 Emulator. Version 0.0. (git c88db4c), debug mode.
Copyright (C) 2010 P. A. Pemberton. All rights reserved.
Licensed under the Apache License Version 2.0.
Musashi M680x0 emulator engine developed by Karl Stenerud <[email protected]>
Set 720x348 at 32 bits-per-pixel mode
ERROR loading disc image 'discim'.
src/wd2010.c:81:wd2010_init(): WD2010 initialised, 1040 cylinders, 8 heads, 16 sectors per track
Disc image loaded.
unhandled write16, addr=0x00E50004, data=0x00000018
unhandled write16, addr=0x00E50006, data=0x00000018
unhandled write16, addr=0x00E50004, data=0x000000F0
unhandled write16, addr=0x00E50006, data=0x000000F0
KBD WR 00 => 0300
KBD WR 00 => 9500
unhandled write16, addr=0x00E44000, data=0x00008000
unhandled write16, addr=0x00E45000, data=0x00008000
unhandled write16, addr=0x00E60000, data=0x00000001
unhandled write16, addr=0x00E60000, data=0x00000000
unhandled write16, addr=0x00490000, data=0x00004000
unhandled write16, addr=0x00491000, data=0x00004000
unhandled write16, addr=0x00494000, data=0x00000000
unhandled write16, addr=0x00495000, data=0x00000000
unhandled write16, addr=0x00493000, data=0x00004000
unhandled write16, addr=0x00497000, data=0x00004000
unhandled write16, addr=0x004F0000, data=0x00000000
unhandled write08, addr=0x004B0400, data=0x00000000
unhandled write08, addr=0x004B0800, data=0x00000000
src/wd2010.c:358:wd2010_write_reg(): WD2010: READ SECTOR cmd=20 chs=0:0:0 nsectors=1
src/wd2010.c:393:wd2010_write_reg(): READ lba = 0
src/wd2010.c:399:wd2010_write_reg(): READ len=512, pos=0, ssz=512
src/wd2010.c:169:wd2010_read_data(): WD2010: read done
src/wd2010.c:358:wd2010_write_reg(): WD2010: READ SECTOR cmd=20 chs=0:0:1 nsectors=0
src/wd2010.c:393:wd2010_write_reg(): READ lba = 512
src/wd2010.c:399:wd2010_write_reg(): READ len=512, pos=0, ssz=512
src/wd2010.c:169:wd2010_read_data(): WD2010: read done
However in the SDL window there is nothing:
Thanks :)
The hard disk image is currently a raw binary file.
It may be useful to add a header to this file to store the disk geometry, or a more structured format. This would allow for cylinder, head and sector range checking in the WD2010 driver.
The format could be organised as a header, followed by a sequence of numbered tracks, each containing numbered sectors. These would be appended to the file when a FORMAT TRACK
command was sent to the WD2010.
Optionally the hard disk image data could be compressed, a la MAME's CHD format. This could be on a track-wise or sector-wise scale. The disadvantage is that this would be more complex to read and write, and may require an "overlay" file to store deltas.
The P5.1 emulation is currently incomplete. Freebee can currently emulate a single large hard drive (up to 1400 cylinders, 16 heads, 16 sectors -- or 175MB) but not a pair of them.
The UNIX PC has an onboard 1200-baud Western Electric / AT&T modem chipset.
It would be useful to emulate this, perhaps as a PTY.
This lack of emulation is the cause of several bootup error messages:
/dev/ph0 can not be opened. Touch any key to continue.
Failed to open modem port. Error return= 19
Freebee currently requires that floppy disk images be binary, in a fixed C/H/S geometry.
Many UNIX PC disk images (notably the ones on Bitsavers) are in Dave Dunfield's Imagedisk format. It would be useful if this format could be read and written without having to convert to binary.
An alternative would be a simple utility to convert between Imagedisk and a simpler uncompressed format which supported variable geometry and especially variations in sector size and count.
This would remove the need for running Imagedisk in a virtual machine to convert the IMD images to binary.
$ make
expr: syntax error
sed: 1: "s|@@compiler@@|clang: w ...": unescaped newline inside substitute pattern
make[1]: *** [versionheader] Error 1
make: *** [all] Error 2
replacing sed with gnu-sed
$ make
expr: syntax error
gsed: -e expression #6, char 69: unterminated `s' command
make[1]: *** [versionheader] Error 1
make: *** [all] Error 2
The emulator currently doesn't support the UNIX PC's onboard serial port.
It would be useful to have this, perhaps terminating in a PTY.
Macros are used extensively within the code, especially in the emulator interface (memory access). The way they're used rarely follows best practice, looks messy, and confuses the way the code works. Furthermore, they're large and hard to follow.
At the very least the access-check functions should be reimplemented as static inline functions -- other macros should be reviewed.
I don't understand all this compiling and makefile stuff. How can I get the latest prebuilt version that will run on 32bit windows. (I should be able to install the OS by myself).
From: Robert Masterson on Mon, May 12, 2014 at 10:18 PM
Also, UNIX crashes with a panic in the emulator when I run the precompiled gzip or the cc from the 3.51 Development set.
The input to either program does not matter--the crash always occurs as long as there is some input.
This behavior got me thinking that there may be an error in shared memory emulation. As you know, the 3b1 VM system has 512KB dedicated to shared memory, which some programs use, and some do not.
Is it possible that there is a bug in the memory system relating to the shared memory segment? (I am just guessing that cc and gzip make use of it, but something distinguishes these programs from those that do not cause a panic.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.