• Please review our updated Terms and Rules here

XTIDE Universal BIOS

hargle

Veteran Member
Joined
Nov 30, 2007
Messages
1,396
Location
minneapolis, MN
most excellent. if I move forward with my PCjr design (gutting an LPT sidecar and putting XTIDE in there) I will be putting a microdrive into that as well for power requirements and obviously size restraints. Was thinking that I could do a CF slot in the back as well...
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
I have some good news and bad news. Good news first:
bootmenu.jpg

Beta 4 is going to have a boot menu with drive number swapping (DOS can only boot from first floppy or hard disk) and optional ROM boot (for systems with ROM Basic or ROM DOS). Hard disk drive numbers can even be swapped when booting from floppy drive A. Menu height can be configured and that info at the bottom can be hidden.

Bad news is that the boot menu takes much more space than i had hoped. I think there will be enough space left for HD floppy support for XT builds and EBIOS support for AT build. There are definitely not enough space for both of them at the same time. This is not a big problem since EBIOS support is quite useless on XTs and ATs already have HD floppy support. There likely won't be enough space for other features either (BIOS partitions, CD-ROM boot etc). I suppose it might be possible to compress most of initialization and boot menu code and then decompress and execute them from RAM. I hope there are some suitable free compression libraries.

Beta 4 will have block mode transfers and i'd like to include cylinder limiting as well.
 

hargle

Veteran Member
Joined
Nov 30, 2007
Messages
1,396
Location
minneapolis, MN
This is excellent news. I think the boot menu is extremely useful on these old machines, so I'm happy that it is now available.
Have you tested this out on a tandy machine that may boot up in 40 column mode? It looks like your menu should just barely fit!

Anyway, I plan on burning your BIOS onto all of the production level eeproms for the XTIDE, starting in about a week, so the clock is ticking to get a working release! (no pressure eh?) :)
 

mbbrutman

Associate Cat Herder
Staff member
Joined
May 3, 2003
Messages
6,276
Forgive me for not being perfectly up to date - I try, but there is a lot of activity ..

Is the BIOS available for download somewhere? I have a few reasons for asking:

  • The existing versions that I have on my card work well enough, and I would like a snapshot of the source code.
  • I want to have access to a version that only does PIO, and does not assume DMA or IRQs. This is the most widely compatible code, and is suitable for other machines.
  • I'm going to be working with Hargle on the PCjr version of the adapter
  • I plan on experimenting with a memory mapped version of the adapter for improved speed when doing PIO transfers. (The IDE registers would stay the same, except for the DATA register which I would like to be in memory space, not I/O space.)


Thanks,
Mike
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
Have you tested this out on a tandy machine that may boot up in 40 column mode?

Boot menu width is 38 characters (just like configuration program) so it will work fine on 40 column mode. I just tested it on Tandy and it looks and works fine. I'll try to get beta4 released during next week. Cylinder limitation is missing but that should be easy. Boot menu default drive is fixed to 00h (Floppy Drive A) and i want it to be configurable.
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
The existing versions that I have on my card work well enough, and I would like a snapshot of the source code.
You can have sources for beta3 right away or do you want to wait beta4?

I plan on experimenting with a memory mapped version of the adapter for improved speed when doing PIO transfers. (The IDE registers would stay the same, except for the DATA register which I would like to be in memory space, not I/O space.)
Do you mean adapter with RAM as a transfer buffer or do you intent to map XTIDE Data High register to memory space and keep Data Low in I/O space? Or maybe map both data registers to adjacent memory addresses? Best thing would be to modify XTIDE so that only one 8-bit data register would be needed.
 

mbbrutman

Associate Cat Herder
Staff member
Joined
May 3, 2003
Messages
6,276
I'll take whatever you have available right now. Ideally this code is in a repository somewhere so we can see the changes between the releases.

The key to performance with the PIO design is to be able to utilize 16 bit transfers .. and we can't use 16 bit transfers with the current design using I/O ports. On these machines an in or out of a word generates two bus transactions to two adjacent port addresses. This behavior would have been fine, except that the second port address that would be generated is in use already.

My plan is to change the latches used for the 16 bit data transfers. Instead of using two different ports for hi and low, I would use two adjacent memory addresses. That way a single read word or store word can be used to get all 16 bits. The processor can do a 16 bit read much more efficiently than it can do two 8 bit reads - less instructions are required and it generates the two bus cycles by itself.

The other ports would stay the same for compatibility. Only the data port would change. User written software that uses the data port directly would be broken, although it's already broken on these machines because you have to do two different port I/Os to get the 16 bit data. I'm anticipating that the BIOS code to read and write sectors is all that most people care about for these machines, and as long as that code is correct if other utilities don't work it is not a big loss.


Mike
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
I noticed something about CF-cards and microdrives when testing boot menu and other new features. It seems that not all CF-cards are bootable and some cards do not work properly when other card or drive is present.

Here are the CF cards that i have:
  • 64MB Apacer (no speed rating), not bootable
  • 256MB Apacer (no speed rating), not bootable
  • 256MB Apacer Photo Steno II Pro (100x)
  • 512MB Apacer Photo Steno III (88x), works only as single drive
And here are the microdrives:
  • 4GB Magicstor (model: GS10040A-11 47), not bootable
  • 4GB Seagate ST1.2 (model: ST64022CF), works only as master
  • 6GB Hitachi (model: HMS360606D5CF00)

So three of the drives cannot be booted. Apparently they intentionally have fixed boot sector that does not actually boot anything (AA55h signature is present). They allow writes to boot sector but no data is actually written. I have no idea why they work that way. I believe there is a way to get them to boot. BIOS reserves one cylinder for diagnostics. It is not needed but i reserve it for compatibility with other BIOSes. Diagnostics cylinder is the last cylinder but if i reserved first cylinder, then boot sector would be located to some writable sector. That would break the compatibility with other BIOSes so I don't want to do that. When I implement BIOS partitions (if there are enough space for it) i'll make sure that it is possible to left some space unused at the beginning of disk.

So I have only one fully working CF-card and one microdrive. It is a good thing that the Hitachi is the only 100% working microdrive since it have the best access times of all the three microdrives.

It is time to release beta4. It is a bit of rushed release so I hope there are not a lot of bugs. This will be the last beta before first stable release. There might be release candidate version(s) if lots of bugs are found. There won't be any new features before stable v.1.0.0. I will fully release source codes when first stable version gets released.

Here are the changes since beta3:
  • Boot menu with drive swapping
  • Block mode transfers
  • Cylinder limiting
  • Drive detection read errors are now properly detected
  • A little longer timeout value when detecting drives
  • Minor optimizations to save some bytes


Boot menu
Boot menu allows to select hard disk or floppy where to boot from. Drive swapping is enabled by default. It is required since DOS can only boot from first floppy or hard disk drive. It is possible to swap hard disks and boot from floppy drive A. Select hard disk you want as a first hard disk and press F instead of Enter. This is needed so DOS could be easily installed to any hard disk. Boot menu has several settings in configuration program.

Block mode transfers
This is what is known as “IDE HDD Block Mode” in many BIOSes. I see no reason to disable this so it is always enabled and set to maximum block size supported by drive. Block mode increases transfer rates since more sectors can be transferred per interrupt to minimize any sector handling overhead. It will also help the drive to use cache more optimally.

Cylinder limiting
Old software (like FDISK on Tandy DOS 3.2) won't work with large drives. Cylinder limiting can make the drive appear smaller than it actually is. This is a temporary solution that will likely be removed when BIOS partitions are implemented. Disk size in MiB can be calculated with following formula: (cylinders * heads * sectors per track) / 2048. There are many programs to detect CHS parameters from drive. For example DOS 6.x has MSD.EXE that can be used to see the CHS parameters so wanted cylinder limit can be calculated.
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
I believe there is a bug when 386 or later processor is used and DPTs are stored to top of interrupt vectors (30:0h). Some (most?) BIOSes use top of interrupt vectors as a stack during POST. This doesn't normally matter since stack grows towards lower addresses.

It does matter now since boot menu is created to stack. Before releasing v1.0.0_b4 i noticed that the second Disk Parameter Table occasionally got corrupted. This seemed to happen only when stack usage was highest, like when timer interrupt was generated when boot menu selection was being changed.

I fixed it by moving stack to top of first 64kB of RAM by setting SS and SP to zero. It works fine on Tandy 1000 SX with NEC V20. It should work with any 286 and below but i think that 386 and later generates Stack Fault exception (since SP underruns to FFFEh where first word is stored). It might not matter if default exception handler just returns so if anyone has 386 or later, please try and let me know if it works.

By default 1kB of base RAM is used for DTPs so there is no need to relocate stack. This bug can happen only when ”Reserve 1kB of base memory” is set to N and 386 or later processor is used.
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
XTIDE Universal BIOS v1.0.0_RC1

Changes since v1.0.0_b4
  • Fixed 386 (and later) stack exception bug
  • Stack is relocated for boot menu even if DPTs are not stored to 30:0h
  • Strings and boot menu are displayed properly on BIOSes that corrupts AH when returning from INT 10h/AH=Eh
  • L-CHS addressing is now used for <=504MiB drives even if LBA is supported

386 stack exception bug is fixed by relocating boot menu stack to 0:7C00h (below boot sector). Stack is now relocated even if 1kB of base RAM has been stolen. It is possible that some other BIOS uses 30:0h so now stack cannot corrupt anything important.

L-CHS to LBA translation is slow on 8088/8086. Previously translation was performed for all drives that supported LBA. Now it is only done when necessary. This will slightly improve access times for 512MB and smaller CF cards when slow processor is used.

Configuration program (idecfg.com) has been updated too:
  • Optimized flashing so 8088@4.77MHz is fast enough to flash with Software Data Protection enabled
  • Quick help can be hidden by pressing F2. This will make menu navigation faster.
 
Last edited:

hargle

Veteran Member
Joined
Nov 30, 2007
Messages
1,396
Location
minneapolis, MN
All XTIDE cards will have this version of the BIOS pre-flashed onto the atmel parts when you receive the card.

Something I just thought about though: since I will be using my eeprom burner to program them all; I doubt that software write protect will be enabled on your chip after the burner is done. You may have to go in and flash it again and enable WP on the eeprom to get it locked down... (or just don't put the write enable jumper on the card)
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
since I will be using my eeprom burner to program them all

Remember to generate the checksum byte. None of the files have checksum byte at the end since configuration program generates it automatically.
Are you going to flash XT build with default settings?
 

hargle

Veteran Member
Joined
Nov 30, 2007
Messages
1,396
Location
minneapolis, MN
so using the config program and then exiting (and saving the file) doesn't generate the checksum? Shouldn't be a problem though, since I burned it onto a couple atmel parts to test it. I'll just read that chip before programming the rest of them.

The only option I changed from defaults was to *not* use the 1k base memory, since that caused all the Tandy owners to have issues with certain video modes.
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
Checksum byte is generated when saving changes to a file and when flashing. There are no checksum bytes on the unmodified files but that doesn't matter since you made changes to default settings.

XT build should work for everyone. Those XT users with 188, 186, V20, V30 or 286 processor should upgrade to XT+ build for a little faster transfer rates. AT users should upgrade to AT build for 16-bit transfers and OS hooks.
 

hargle

Veteran Member
Joined
Nov 30, 2007
Messages
1,396
Location
minneapolis, MN
I've burned approximately 1/2 of the ROMs over the past couple nights, and they work just fine. It even turns out that my burner has support for enabling the software write protect, so all the roms I am doing are protected when they come off the burner. I have not tested that they are actually protected, only that the code burned in worked.

As soon as I'm finished burning these, I'm ready to ship all the parts to lutiana for kitting, but he's disappeared for the time being...
 

Lord Moz

Experienced Member
Joined
Oct 20, 2009
Messages
217
Location
Texas
The wheels of progress!

Glorious to behold! :p

*rubs hands together in anxious anticipation* :D

Thanks for the time and effort Hargle!
__
Trevor
 

quark

New Member
Joined
Sep 30, 2009
Messages
7
Location
Germany
Harddisk recognitation with Multi/IO/RTC-Card not possible

Harddisk recognitation with Multi/IO/RTC-Card not possible

Hi, Folks!

My Configuration: XT 8088 Board, 8-bit VGA Graphics Adapter, XTIDE installed BIOS v1.0.0_RC1.

When I use a original IBM Floppy Controller with 5 1/4" 360k drive, it works fine.

If I remove the floppy controller and I try to boot without any floppy controller, my HDD couldn't be detected by XTIDE Bios.
Thats no problem, because I normally use a floppy controller.

My problem is, I have a Multi-IO Card (COM1, LPT1, Game Port, Floppy Disk and Real Time Clock). I use this card several years now and it works fine. When I replace the old IBM Controller with my "Multi"-Card which I use normally, then the XTIDE Bios don't work correctly any more.

First boot, BIOS 0x80 detect a drive but the drive name "nec ...." is not displayed or only the last part of the string will be shown. If I make a warm reboot, XTIDE shows the name of die drive correctly, and It says "boot sector found" (or similar) but boot is still not possible.

I tried to change IO Range and Memory Adress, but the situation is always the same.

Do you have any idea what I can do in order to use my Multi-RTC card with the XTIDE together?

Thank you very much for the gread developement!
quark
 

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
Hi, Folks!
My Configuration: XT 8088 Board, 8-bit VGA Graphics Adapter, XTIDE installed BIOS v1.0.0_RC1.
Is it an original IBM or some clone?

If I remove the floppy controller and I try to boot without any floppy controller, my HDD couldn't be detected by XTIDE Bios.
Are hard disk detection strings and boot menu displayed? If not, then this might be related to late initialization. If no floppy or hard disks are found during POST, main BIOS probably won't ever call boot strap loader to start XTIDE late initialization.


First boot, BIOS 0x80 detect a drive but the drive name "nec ...." is not displayed or only the last part of the string will be shown. If I make a warm reboot, XTIDE shows the name of die drive correctly, and It says "boot sector found" (or similar) but boot is still not possible.
I tried to change IO Range and Memory Adress, but the situation is always the same.
Sounds like a hardware or BIOS conflict.
Does the Multi I/O card has BIOS of its own?
Can you boot from floppy drive using boot menu?
Did you remember to update BIOS configuration when you tried other I/O port? Try port 340h and make sure that both XTIDE card and BIOS are configured properly.
 

quark

New Member
Joined
Sep 30, 2009
Messages
7
Location
Germany
detailed test results

detailed test results

Is it an original IBM or some clone?

It is a clone (with 640kb memory onboard, speed 4,77 Mhz or 8,00 MHz).
I also own a original IBM mainboard ( 256kb system board without ram extensions) and I make the same tests in this moment.

Both mainboards have the same behavior. There is nearly no difference (see detailed test results).

Are hard disk detection strings and boot menu displayed? If not, then this might be related to late initialization. If no floppy or hard disks are found during POST, main BIOS probably won't ever call boot strap loader to start XTIDE late initialization.

XTIDE boot menu will be displayed all time.

My test results:

Harddisk: D3755 (NEC 100MB capacity)
Operating System: MS-DOS V6.22
8-bit VGA-Graphic Adapter

Original IBM Floppy Controller (Clone + IBM Board identically
floppy boot -> OK
hard disk boot -> OK

Without any Floppy Controller (Clone + IBM Board identcially)
floppy boot -> not possible, no controller installed
hard disk boot
boot menu displays "D3755" string correctly, message "80h ... boot sector found", next message not in english, translation: "Please insert a system disk". It's seems to be a message from MBR, because its in the language of the operating system.​

Multi I/O Card with Floppy Controller and RTC
floppy boot -> OK
hard disk boot
----> Clone-Board: boot menu displays at cold boot a wrong string, missing first characters. displays "5" or "755" it varied. Next message "no valid boot sector". After a warm boot, the string "D3755" is shown correctly, but still "no valid boot sector".
----> IBM-Board: boot menu displays string "D3755" correctly, next "boot sector found" and then the system hang up. (No message from operating system)​

Does the Multi I/O card has BIOS of its own?

No, there is no EEPROM. Just UM8272A, MM58167 (RTC), NS8250N and some logic chips.

Can you boot from floppy drive using boot menu?

Yes, see test results above.

Did you remember to update BIOS configuration when you tried other I/O port? Try port 340h and make sure that both XTIDE card and BIOS are configured properly.

Yes I updated BIOS configuration and change dip switches. I verifiy this with booting from HDD with the IBM Controller. I tried 0x300, 0x380 and now 0x340 but the above test results are the same.
 
Last edited:

aitotat

Experienced Member
Joined
Aug 13, 2009
Messages
351
Location
Finland
Really strange. Missing characters might indicate that something corrupts data somewhere in 0:800h and above. Not only drive names but POST stack address is also stored there so that might explain why system hangs. It does not explain why clone board doesn't find valid boot sector. Is the drive information correct when the name is only partially displayed?

I have a clone XT (8088@8 MHz, 640kB and similar multi I/O card) waiting for new XTIDE card. I'll take the XTIDE from 286 and try it on the XT on sunday. I hope i can reproduce the problem and find a solution.

Does anyone know what ports the MM58167 (i have MM58167AN) RTC chip uses?
 
Top