Skip to content

Commit

Permalink
Merge pull request #61 from davidgiven/brother
Browse files Browse the repository at this point in the history
Add support for the PN8800.
  • Loading branch information
davidgiven authored Jan 6, 2024
2 parents f267bcd + c071466 commit ae4166b
Show file tree
Hide file tree
Showing 18 changed files with 1,532 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
name: ${{ github.event.repository.name }}.${{ github.sha }}
path: |
bazel-bin/arch/brother/pn8510/diskimage.img
bazel-bin/arch/brother/pn8800/diskimage.img
bazel-bin/arch/brotherop2/diskimage.img
bazel-bin/arch/brotherwp1/diskimage.img
bazel-bin/arch/kayproii/diskimage.img
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
assets: |
brotherpowernote.img
pn8510.img
pn8800.img
brotherop2.img
brotherwp1.img
kayproii.img
Expand All @@ -64,6 +65,7 @@ jobs:
name: Development build ${{ env.RELEASE_DATE }}
files: |
pn8510.img
pn8800.img
brotherop2.img
brotherwp1.img
kayproii.img
Expand Down
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ filegroup(
name = "diskimages",
srcs = [
"//arch/brother/pn8510:diskimage",
"//arch/brother/pn8800:diskimage",
"//arch/brotherop2:diskimage",
"//arch/brotherwp1:diskimage",
"//arch/kayproii:diskimage",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Currently it supports these platforms:
- [the Brother WP-1 typewriter (and probably others)](arch/brotherwp1/README.md)
- [the Brother LW-30 typewriter (and probably others)](arch/brotherop2/README.md)
- [the Brother WP-2450DS typewriter (and probably others)](arch/wp2450ds/README.md)
- [the Brother PN-8510MDS SuperPowerNote laptop (and probably others)](arch/brotherpowernote/README.md)
- [the Brother PN-8510MDS SuperPowerNote laptop (and probably others)](arch/brother/pn8510/README.md)
- [the Brother PN-8800FXB SuperPowerNote laptop (and probably others)](arch/brother/pn8800/README.md)

(Some of these are pretty stale due to difficulty of testing and may not work.
Later entries are newer! If you have any problems, please report bugs.)
Expand Down
158 changes: 158 additions & 0 deletions arch/brother/pn8800/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
package(default_visibility = ["//visibility:public"])

load("//build:cpm.bzl", "cpm_addresses", "binslice", "diskimage")
load("//third_party/zmac:build.bzl", "zmac")
load("//third_party/ld80:build.bzl", "ld80")
load("//utils:build.bzl", "unix2cpm")

# Memory layout configuration -----------------------------------------------

# Configure the BIOS size here; this will then emit an addresses.lib file
# which contains the position of the BDOS and CCP.

top_of_memory = 0x10000
(cbase, fbase, bbase) = cpm_addresses(
name = "addresses",
top_of_memory = top_of_memory,
bios_size = 0x0900
)

# Generated tables ----------------------------------------------------------

genrule(
name = "keytab_inc",
tools = [ "//arch/brother/pn8800/utils:mkkeytab" ],
outs = [ "keytab.inc" ],
cmd = "$(location //arch/brother/pn8800/utils:mkkeytab) > $@"
)

# Object files --------------------------------------------------------------

BIOS_SRCS = [
"boot",
"hd63266",
"bios",
"floppy",
"tty",
"keyboard",
]

[
zmac(
name = name + "_o",
z180 = True,
srcs = [
name + ".z80",
"//include:cpm.lib",
"//include:cpmish.lib",
"//include:z180.lib",
":keytab_inc",
"//arch/brother/pn8800/include:pn8800.lib",
"//arch/common/utils:tty.lib",
"//arch/common/utils:print.lib",
":addresses",
]
)
for name in BIOS_SRCS
]

# Bootstrapper --------------------------------------------------------------

# This is the .APL file which the Brother OS loads. It's responsible for
# remapping the memory, doing some device setup, and loading the BIOS into
# the top of memory.

ld80(
name = "boot_img",
address = 0x8000,
objs = {
0: [ ":boot_o", ":hd63266_o" ]
}
)

# BIOS ----------------------------------------------------------------------

# The CP/M BIOS itself.

# This is a 64kB file containing the entire CP/M memory image.

ld80(
name = "memory_img",
address = 0,
objs = {
cbase: [ "//third_party/zcpr1" ],
fbase: [ "//third_party/zsdos" ],
bbase: [
":bios_o",
":hd63266_o",
":tty_o",
":floppy_o",
":keyboard_o",
]
}
)

# Currently only used for debugging.
binslice(
name = "bios_img",
src = ":memory_img",
start = bbase,
length = 0x10000 - bbase
)

binslice(
name = "systemtrack_img",
src = ":memory_img",
start = cbase,
length = 0x10000 - cbase
)

# FAT file system -----------------------------------------------------------

# Produces the FAT bit of the disk image.

zmac(
name = "bootfile_img",
srcs = [
"fat.z80",
":boot_img",
":systemtrack_img",
],
relocatable = False,
z180 = True,
)

# Disk image ----------------------------------------------------------------

# Assembles the bootable disk which you can actually run.

unix2cpm(
name = "readme",
src = "README.md"
)

diskimage(
name = "diskimage",
format = "brother-powernote",
bootfile = ":bootfile_img",
size = 1440 * 1024,
map = {
"-readme.txt": ":readme",
"dump.com": "//cpmtools:dump",
"stat.com": "//cpmtools:stat",
"asm.com": "//cpmtools:asm",
"copy.com": "//cpmtools:copy",
"submit.com": "//cpmtools:submit",
"asm80.com": "//third_party/dr/asm80",
"camel80.com": "//third_party/camelforth",
"bbcbasic.com": "//third_party/bbcbasic:bbcbasic_ADM3A",
"mkfs.com": "//cpmtools:mkfs",
"rawdisk.com": "//cpmtools:rawdisk",
"qe.com": "//cpmtools:qe_BROTHER_POWERNOTE",
"z8e.com": "//third_party/z8e:z8e_POWERNOTE",
"ted.com": "//third_party/ted:ted_POWERNOTE",
},
)

# vim: ts=4 sw=4 et

70 changes: 70 additions & 0 deletions arch/brother/pn8800/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Platform: the Brother Super PowerNote PN8800MDS (or similar) word processor
===========================================================================

The Super PowerNote is a 1996 word processing laptop: a simple Z180 computer
with an old-fashioned LCD and a 3.5" floppy disk drive built in to a laptop
chassis. It's got 128kB of RAM and an 80x25 supertwist LCD screen, with an
excellent keyboard attached.

It's not really supposed to boot from floppy but Brother did release a small
amount of software for it, including Turn About, a Reversi clone. The hardware
is a 6MHz Z180, meaning it runs CP/M really well.

Luckily, this machine uses standard 1440kB DOS floppies, unlike some of their
other models. So, cpmish disks can be easily created on a PC drive.

What you get with this port:

- about 1400kB of storage on a 1440kB MFM disk (I have to reserve two tracks for
a FAT filesystem and the CP/M system track to boot from)
- a massive single-track disk cache meaning disk accesses are really fast
- most of an ADM-3a / Kaypro II terminal emulator supporting 80x25 text
- a respectable 58kB TPA
- a non-interrupt driven keyboard which drops keypresses if the machine's busy
- bugs

What you don't get:

- repeat key
- sysgen, format etc
- no bugs

As you may gather, it's all a bit fragile.


How to use it
-------------

Build cpmish.

Use `dd` or your favourite disk imager to write the `brotherpowernote.img` file
to an HD 3.5" floppy. You're probably best off formatting this on a PC as the
way the disk system works means that you want 1:1 interleave.

Insert the disk into the machine's drive, power on, and select 'Disk Application'
from the main menu. Then execute `CPMISH.APL`. After a few seconds cpmish should
start.

**Big warning:** if you save any Brother files onto the disk, you'll
irrevocably corrupt the CP/M filesystem. Don't do this.


Technical details
-----------------

The machine has a Z180 with 512MB of address space. The RAM is at 0x60000 to
0x7ffff, physical. cpmish maps the Brother OS out of memory and turns interrupts
off, using bare metal access to the hardware. 0x70000 to 0x80000 is used for
CP/M and 0x60000 to 0x70000 is caches (currently only the 9kB disk cache).

The terminal emulator is ADM-3a with some Kaypro II extensions. This appears to
be a relatively common choice and most software I've tried (Turbo Pascal, VDE
etc) works.


Who?
----

Everything here was written by me, David Given, and is covered under the
terms of the whole CP/Mish project. See the documentation in the project root
for more information.
Loading

0 comments on commit ae4166b

Please sign in to comment.