-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from davidgiven/brother
Add support for the PN8800.
- Loading branch information
Showing
18 changed files
with
1,532 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.