[Patch] Xi8088 - GPL XT system bios

Post Reply
EluanCM
Posts: 62
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

[Patch] Xi8088 - GPL XT system bios

Post by EluanCM » Thu 22 Feb, 2018 10:20 pm

The Xi8088 is a great project by Sergey Kiselev to build a XT-clone, I've built it myself along with the other boards by Sergey and they work great.

The system is a XT along with some AT and PS2 features like PS/2 mouse, AT RTC/NVR, two PICs, etc. More info in http://www.malinov.com/Home/sergeys-projects/xi-8088
I've built the attached BIOS using the latest branch available at https://github.com/skiselev/8088_bios/tree/micro_8088

TODO: flash memory (system is currently rom), make cl-gd5429 and other not fully 16-bit VGAs work (the hardware has support for limited 16-bit ISA signals to make this work).
Attachments
xi8088_2018_02_22.diff.txt
(16.82 KiB) Downloaded 36 times
bios-xi8088.bin.gz
(12.38 KiB) Downloaded 47 times

EluanCM
Posts: 62
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Xi8088 - GPL XT system bios

Post by EluanCM » Thu 22 Feb, 2018 10:21 pm

Screenshots
Attachments
Screenshot from 2018-02-22 16-21-52.jpg
Screenshot from 2018-02-22 16-21-52.jpg (186.75 KiB) Viewed 1547 times
Screenshot from 2018-02-22 16-22-33.jpg
Screenshot from 2018-02-22 16-22-33.jpg (140.88 KiB) Viewed 1547 times

ecksemmess
Posts: 152
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Patch] Xi8088 - GPL XT system bios

Post by ecksemmess » Fri 23 Feb, 2018 6:18 am

Looks good! Love your shader setup too--what package/settings is that?

EluanCM
Posts: 62
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Xi8088 - GPL XT system bios

Post by EluanCM » Fri 23 Feb, 2018 11:02 pm

I use the shaders from leilei's repository with default settings: https://github.com/leilei-/someshaders

This patch has a problem: the turbo key combination doesn't work, the CPU always stays a full speed. (under my window manager under linux, I've to use the ctrl-alt-keypad- and ctrl-alt-keypad+ turbo shortcuts with the right ctrl and right alt, because the left ones get trapped by the window manager)

I've used the patches to the Toshiba t1000 and t3100e for turbo, but they currently do not work there either: the emulation uses the defined cpu speed directly in various places, so calling the cpu_set() function with a temporary cpu value won't work.

Maybe fixing isn't desirable, because the BIOS always defaults to non-turbo speeds and this could confuse users who don't know about the shortcuts. A reason to emulate the turbo behavior is that, IIRC, the speed goes to non-turbo for DMA access in the physical hardware, so it should also happen with the emulated machine. But I don't know if portb is used for this or if it's done directly in hardware, also I don't know if other xt systems exhibit this non-turbo-dma behavior.

The fix is a little intrusive, but this should work after applying the above patch. Setting the cpu variable directly isn't desired because it's handled by the config subsystem (forget to set it back to the initial value and the new one will be saved upon exit!). After this, the current cpu speed will also be displayed in the title bar and the machine status window. No patch yet because my local pcem tree is a mess right now.

1-In cpu.c, define

Code: Select all

int cpu_effective;
next to

Code: Select all

int cpu = 3, cpu_manufacturer = 0;
Then, in cpu_set(), add

Code: Select all

cpu_effective = cpu;
before the assignment of cpu_s.

2-In cpu.h, add the cpu_effective declaration in the appropriate place:

Code: Select all

extern int cpu, cpu_manufacturer, cpu_effective;
2-In xi8088.c, call speedchanged() after cpu_set(). Also useful to verify if the recalculations should be done, to avoid then to happen on every write to the kbc portb. So, here is the function:

Code: Select all

void xi8088_turbo_set(uint8_t value)
{
        xi8088_turbo = value;
        if (!value && cpu_effective == cpu)
        {
                pclog("Xi8088 turbo off\n");
                int c = cpu;
                cpu = 0;        /* 8088/4.77 */
                cpu_set();
                speedchanged();
                cpu = c;
        }
        else if (value && cpu_effective != cpu)
        {
                pclog("Xi8088 turbo on\n");
                cpu_set();
                speedchanged();
        }
}
3-Change all the array indexings of [cpu] to [cpu_effective] in cpu.c, pc.c, pit.c

Done!

User avatar
SarahWalker
Site Admin
Posts: 1568
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Xi8088 - GPL XT system bios

Post by SarahWalker » Sat 24 Feb, 2018 12:05 pm

The BIOS you attached won't boot off floppy without XTIDE present. From what I can see, the INT 19H handler is broken - it fails to set ES correctly before reading the boot sector, so it goes to F000:7C00 instead of 0000:7C00.

EluanCM
Posts: 62
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Xi8088 - GPL XT system bios

Post by EluanCM » Sat 24 Feb, 2018 3:16 pm

This is a bug in the latest version, I guess Sergey always uses XTIDE and didn't notice it. I've identified the offending commit and notified him about it in github.
I've fixed it in the attached bios.

Still it doesn't seem to boot the MS-DOS 6.22 install disk 1, I've only succesfully booted the 5.00 installation.
On my real machine I use a old version bios that doesn't have the broken int 19h, and this bios version also failed to load MS-DOS 6.22 under PCem.
I use DOS 6.22 in my real one and after installed it works just fine (obviously). I've installed it via XTIDE's floppy emulation via RS-232, so I guess I've never booted the MS-DOS 6.22 installation on it and I'm out of working floppies to try.
Attachments
bios-xi8088.bin.gz
(12.38 KiB) Downloaded 45 times

User avatar
SarahWalker
Site Admin
Posts: 1568
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Xi8088 - GPL XT system bios

Post by SarahWalker » Sat 24 Feb, 2018 6:09 pm

Committed at rev 1073. I fixed access to high density floppies, DOS 6.22 seems to boot for me now.

iwasaperson
Posts: 30
Joined: Sun 02 Nov, 2014 12:48 am

Re: [Patch] Xi8088 - GPL XT system bios

Post by iwasaperson » Sun 25 Feb, 2018 7:33 pm

I can't get CGA, MDA, or Hercules to work. It just doesn't render any video (video that was previously there stays stuck with no screen updates).

EGA and VGA both work fine.

EluanCM
Posts: 62
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Xi8088 - GPL XT system bios

Post by EluanCM » Mon 26 Feb, 2018 2:34 am

SarahWalker wrote:
Sat 24 Feb, 2018 6:09 pm
Committed at rev 1073. I fixed access to high density floppies, DOS 6.22 seems to boot for me now.
Oops, I forgot to check the "AT" variable in the code. I only checked the MODEL_AT and MODEL_PS2 flags for correct behavior.
iwasaperson wrote:
Sun 25 Feb, 2018 7:33 pm
I can't get CGA, MDA, or Hercules to work. It just doesn't render any video (video that was previously there stays stuck with no screen updates).

EGA and VGA both work fine.
Another oversight: the cga/mda switch in the kbc is inverted in the xi8088! It's an easy fix in keyboard_at_reset() @ keyboard_at.c

EluanCM
Posts: 62
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Xi8088 - GPL XT system bios

Post by EluanCM » Mon 26 Feb, 2018 6:04 am

Here is a new patch:

-Fixes CGA/MDA
-Turbo selection works (fix also applied to the Toshiba t3100/t1000) - Sarah, this is very intrusive to the cpu subsystem and I don't know much about it, please review carefully
-Added option to select flash size and turbo behavior, just like the real hardware
Attachments
xi8088_fixes_2018_02_26.diff.txt
(18.46 KiB) Downloaded 46 times

User avatar
SarahWalker
Site Admin
Posts: 1568
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Xi8088 - GPL XT system bios

Post by SarahWalker » Wed 28 Feb, 2018 9:36 pm

Added the non-CPU changes at revs 1084/1085.

iwasaperson
Posts: 30
Joined: Sun 02 Nov, 2014 12:48 am

Re: [Patch] Xi8088 - GPL XT system bios

Post by iwasaperson » Thu 01 Mar, 2018 3:49 am

SarahWalker wrote:
Wed 28 Feb, 2018 9:36 pm
Added the non-CPU changes at revs 1084/1085.
Not compiling anymore after this commit.

Code: Select all

pcem-keyboard_at.o: In function `keyboard_at_read':
keyboard_at.c:(.text+0xa07): undefined reference to `xi8088_turbo_get'
pcem-keyboard_at.o: In function `keyboard_at_write':
keyboard_at.c:(.text+0x3ec): undefined reference to `xi8088_turbo_set'
keyboard_at.c:(.text+0x544): undefined reference to `xi8088_turbo_set'
pcem-mem.o: In function `loadbios':
mem.c:(.text+0x1cae): undefined reference to `xi8088_bios_128kb'
pcem-mem.o: In function `mem_add_bios':
mem.c:(.text+0x6f22): undefined reference to `xi8088_bios_128kb'
pcem-model.o: In function `at_pb570_init':
model.c:(.text+0x159a): undefined reference to `pc87306_init'
pcem-model.o: In function `at_pb520r_init':
model.c:(.text+0x17c1): undefined reference to `cmd640b_init'
pcem-model.o: In function `at_endeavor_init':
model.c:(.text+0x19ee): undefined reference to `pc87306_init'
pcem-model.o: In function `at_zappa_init':
model.c:(.text+0x1b0e): undefined reference to `pc87306_init'
pcem-model.o: In function `at_sl82c460_init':
model.c:(.text+0xce7): undefined reference to `sl82c460_init'
pcem-model.o: In function `pb_l300sx_init':
model.c:(.text+0xfa7): undefined reference to `acc2036_init'
pcem-model.o:(.data.rel+0xe98): undefined reference to `xi8088_device'
pcem-video.o:(.data.rel+0x498): undefined reference to `compaq_cga_device'
pcem-video.o:(.data.rel+0x960): undefined reference to `oti037_device'
collect2: error: ld returned 1 exit status
Makefile:800: recipe for target 'pcem' failed
make[1]: *** [pcem] Error 1
make[1]: Leaving directory '/tmp/tmp.f53NkrjCkb/pcem/src'
Makefile:365: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

User avatar
SarahWalker
Site Admin
Posts: 1568
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Xi8088 - GPL XT system bios

Post by SarahWalker » Thu 01 Mar, 2018 5:35 pm

autoreconf

iwasaperson
Posts: 30
Joined: Sun 02 Nov, 2014 12:48 am

Re: [Patch] Xi8088 - GPL XT system bios

Post by iwasaperson » Thu 01 Mar, 2018 6:25 pm

SarahWalker wrote:
Thu 01 Mar, 2018 5:35 pm
autoreconf
That worked. Time to update my updater script :P (also CGA works as well now).

jznomoney
Posts: 80
Joined: Sat 06 Dec, 2014 9:11 pm

Re: [Patch] Xi8088 - GPL XT system bios

Post by jznomoney » Thu 01 Mar, 2018 9:55 pm

I keep having a hard time with the keyboard with this machine. Sometime it works sometimes it doesn't. I can't really explain it.

Post Reply