Apologies for any roughness around the edges of this patch, but I wanted to get it to a workable condition before the feature freeze. It adds support for the Toshiba T3100e laptop.

I've tested the patch against the latest checkin, and it appears to compile and boot satisfactorily.

Some known issues / design choices:
i) Like the PC1512 and PC200 emulations, it only supports one hardware font, not the four of the original hardware.
ii) The motherboard video chipset is always used; the original allows it to be disabled and replaced by an add-on card. Again, this is how other emulations like the PC1640 and PC200 behave.
iii) f you want to get into the BIOS setup screen on a real T3100e, you'd hold down the 'Fn' key while booting. I haven't worked out how to replicate this effect on PCEM, so to get into the BIOS you have to use DEBUG under DOS:

The thing with the 'Fn' key is that that it doesn't produce a scancode, so I'm not clear how the BIOS detects it. I do have a dump of the keyboard controller firmware; maybe that will provide some clues.

ETA: OK, it looks like it's done by that mysterious command 0xBB that gets sent to the keyboard controller at startup; bit 2 of the byte it returns seems to give the status of the 'Fn' key.

JohnElliott wrote:OK, it looks like it's done by that mysterious command 0xBB that gets sent to the keyboard controller at startup; bit 2 of the byte it returns seems to give the status of the 'Fn' key.

And here's a little patch that (applied on top of the T3100e patch) allows right-Ctrl or right-Alt to be used as a trigger for the BIOS screen (hold either down while rebooting).

I've since found a list of other things the Fn key does. My patch doesn't emulate any of these at the moment; most of them are processed by the keyboard controller firmware rather than coming through to the BIOS as scancodes.

I managed to get a proper dump of the T3100e font ROM this evening. Unfortunately its character bitmaps aren't stored in the same order as the mocked-up one that I coded against.

The attached patch fixes the font loader so that it uses the proper ROM rather than my mocked-up version. You'll need the updated ROM, of course; it's 64k rather than the 8k of the mocked-up version. You'll have to PM me for the updated ROM set.

This patch ensures that STAT_IFULL to be set immediately after sending keyboard self-test command applies only to the Toshiba T3100e. This solves the problem that Samsung SPC-4200P/SPC-4216P does not boot.
And it also apples all even command value between 0xF0 and 0xFE to reset CPU. This solves the problem that XENIX286 can't reset the CPU.

To JohnElliott : I regret that I have arbitrarily uploaded the patch without consulting with you.

Greatpsycho wrote:To JohnElliott : I regret that I have arbitrarily uploaded the patch without consulting with you.

There's no need for regrets. I probably should have created a separate implementation for the T3100e keyboard controller rather than piggybacking on the AT one, since a lot of its commands behave differently from the IBM versions.

* Enables [Fn]+key combinations (using right-Ctrl or right-Alt as [Fn]). In particular:
* Implements switching the built-in display adapter between the 'internal' plasma display ([Fn]+[Home]) and an 'external' CGA monitor ([Fn]+[End])
* Allows the video font to be toggled between thin and thick ([Fn]+[Right arrow]).
* Implements the four hardware fonts of the original, selectable in BIOS setup.

Nearly all of the differences are in T3100e-specific code, or work by setting variables that only the T3100e pays any attention to. The main change in general code is allowing multiple fonts on the CGA.

I haven't implemented the 'turbo' commands (though the appropriate keypresses [Fn]+[PgUp] / [Fn]+[PgDn] are detected), because I don't know how / if the CPU speed can be changed while emulation is running.

I found a bug that MS-DOS version 5.0 or greater version crashes when kernel is loaded in HMA area when I use 1024KB memory configuration. To fix this problem, you should add mem_mapping_set_exec() call to t3100e_map_ram function in t3100e.c.

JohnElliott wrote:I haven't implemented the 'turbo' commands (though the appropriate keypresses [Fn]+[PgUp] / [Fn]+[PgDn] are detected), because I don't know how / if the CPU speed can be changed while emulation is running.

The CPU speed can be changed on the fly, as you can change it PCem's config menu too and PCem doesn't restart

Greatpsycho wrote:I found a bug that MS-DOS version 5.0 or greater version crashes when kernel is loaded in HMA area when I use 1024KB memory configuration. To fix this problem, you should add mem_mapping_set_exec() call to t3100e_map_ram function in t3100e.c.

Here's a revised patch. I've added the mem_mapping_set_exec() as advised, and also made some further improvements to the video emulation, to implement CRTC register 12h (attribute mapping and display type). The Toshiba CHAD utility, which controls how colour attributes are mapped to amber/black, now appears to work.

I think i found a bug. When i run Windows 2.11/286 with EMS memory, the emulator Lock up when i open the Write application, but when i configure all memory as XMS, including the 384kb upper memory, there is no problem. (I don't know if the patch of Greatpsycho fixes this issue).

Also I Want to ask if this model (T3100e) supports 1.44MB floppy disks. Because the emulated T3100e reads 720kb and 360kb only.
And finally the EMS test program of Douglas Boling detects the EMS memory as v4 0 capable, but no Large Page Frame is supported.
Is it a bug or is it how the real machine works? I ask it because, the EMS 4.0 memory boards of late '80 did not support all the specs of the EMS 4.0 standard.
Some of them supported backfilling of conventional memory from 256kb to 640kb an others only from 512kb. Others were EMS 3.2 capable boards with an EMS 4.0 device driver.

Yes i used that test, and also i used the Manifest utility included in Qram 2.02.
i took two screenshots.
The first is From Toshiba and the Second from GW-286CT GEAR using the SCAT chip emulation developed by Gratpsycho. In the Toshiba there is no Mappeable memory.
This mappeable memory is the ´large page frame', this memory is backfilled and managed by the EMS 4.0 chipset.

The mappeable memory can be 'moved' from conventional to EMS and from EMS to conventional memory directly by EMS 4.0 chipset. The CPU reuses the space same addresses to write different portions of memory and calls to the EMS board/chipset when the portion of memory have to be switched and other written portion must be called.
(in the 286 GEAR the area from 4n00 to An00 is mappeable this means that area can be reused several times by CPU and when a memory block is switched, the actual adress of the code or data is stored by the EMS chip).
This is the same is done with the 64kb page frame located at E000 or D000 but in the EMS 3.2 spec only one page of 16kb can be moved per clock cycle. In the EMS 4.0 the four pages (64kb) can be moved, but if the EMS 4.0 memory board and/or chipset support the 'large page frame' also the entire 384kb memory block of the backfilled conventional memory can be 'moved' modifing the registers of the memory board instead of moving the actual data.
Without it, only 64kb of executable code can be stored in the EMS memory because only the 64kb page frame can be used. Of course you can use all the EMS memory to store data, but it still limited to 64kb to store executable code.

Some applications such as Deskview and Windows 2.x, and Windows 3.0 when runs in real mode can 'move' the mappeable area of the conventional memory back and Forth the EMS memory.

Fenix77 wrote:
The first is From Toshiba and the Second from GW-286CT GEAR using the SCAT chip emulation developed by Gratpsycho. In the Toshiba there is no Mappeable memory.
This mappeable memory is the ´large page frame', this memory is backfilled and managed by the EMS 4.0 chipset.

Not all chipsets support large page frame. For example, according to technical document, Chips & Technologies 82C212 NEAT, 82C812 NEATsx and 82C836 SCATsx chipset supply EMS 4.0 specific driver but does not support laege page frame. I didn't see Toshiba T3100e's technical document, however, this machine does not seem to support laege page frame either.

Sorry. I thought that if all chipsets EMS 4.0 supported mapping upper memory areas other than the 64kb page frame they also must support the large page frame.
But after testing the emulated SCATsx i can see they're two differents things unrelated one to another. The Windows 2.11/286 readme file states that EMS 4.0 is required
and recommends,(if the board supports it) disable 384kb of conventional memory and fill it with the memory board.(although the emulated Laser XT uses EMS 3.2 with an EMS 4.0 driver and it works).

Thanks again for this incredible work with these EMS memory chipset and JohnElliott for this Toshiba machine. They were expensive pieces of hardware back in the day and for this reason they were very little known too.
For instance T3100e had a monochrome screen that uses patterns instead of bright intensities to reproduce color, unlike the phosphor amber monitors did with the Hercules graphics card. Also, I discovered that the T3100e can have a 20 or 40Mb hard disk, and 80286 running at 12 or 16 MHz and 1.44 floppy drive, on Wikipedia site mentions that the floppy drive is 720kb. But the second reference link in references go to the PDF file created by Thoshiba and says 1.44mb drives are supported. https://web.archive.org/web/20040515024 ... 100e_E.pdf

Looking at the behaviour of the floppy drive, the BIOS seems to be looking at CMOS location 10h to get the drive type, which is as expected -- but there's no UI to set this. Instead, that location is initialised by the BIOS using code at F000:6000, which in turn seems to ask the keyboard controller for details (command 0xB4). So I'll have to work out how to implement that. It looks to me as if the following configurations are supported:
* One internal 3.5" floppy drive, which can be 720k, 1.4M or something else (tri-mode?).
* Two internal 3.5" floppy drives, both of the same type.
* One internal 3.5" floppy drive as above, plus an external drive that can be 360k or 1.2M.

I strongly suspect some of this information comes from three motherboard jumpers near the keyboard controller, which the maintenance manual only names as 'FD2', 'FD2MB' and 'F2HD'.

The QRAM Manifest tool produces the same display on real hardware as on Fenix77's second screenshot, so I don't think the T3100e supports a large page frame. I tried reducing conventional RAM to 512k to see if it backfills with EMS between 512k and 640k, but it doesn't.

My bad, I tested the Write application of Windows 2.11 with EMS memory and it works correctly. I added STACKS=9,512 in the config.sys like Greatpsycho suggested me for the 386-SX KMX-C-02.
So there is no issue with EMS memory emulation.
By the way, What parameters must be used by the Chad utility in order to change the appearance of black/amber colors?

CHAD takes two parameters from 1 to 4, separated by a comma. The first controls how colour on colour is presented, and the second controls colour on black.
Options are:
1 => Normal
2 => Inverse
3 => Bold
4 => Bold inverse

The default setting is CHAD 2,1 . You can also append a ",W" to the command to persist the setting to CMOS.

Since no-one's objected to my idea of how to do a soft turbo switch, here's the patch implementing it. It also adds support for a few more keyboard controller commands, which seem to fix 1.4M floppy drive support and the long delay at boot when using the 3.0 BIOS.

gen_angry wrote:Question/Feature request: if the display for this is a 'display adapter' setting for a particular type of monochrome screen adapter, any chance that someone could make a 'blue screen' option?