News:

Forum Updated! 

Main Menu

PC-9821 BIOS UV-EPROM

Started by 98digger, August 17, 2014, 09:25:39 AM

Previous topic - Next topic

98digger

Hello PC-98 SIG!

(Original discussion on this topic began here: http://nfggames.com/forum2/index.php?topic=5462.0)

It has been discovered that PC-9821 series computers (nearly every model of them) have the BIOS written to a single UV-EPROM (Chip name: NEC D27C4000D-15). As we all know, UV-EPROMs fail after an undetermined amount of time; usually 15-25 years. Because the BIOS in PC-9821 computers is model specific, it is impossible to replace it with a BIOS off the internet. Therefore, the only option is to "back-up" (or "dump") the BIOS chip, so one may reprogram the chip (or replace it) in the case of failure. In case anyone is wondering, I believe that it is in fact legal to back-up the BIOS for recovery purposes only (personal use only).

To do this, one would need either to physically take the chip, hook it up to a ROM reader and dump it onto a computer, or one could use software to dump it. Because there appears to be no software for PC-98 that can dump the BIOS, we need to use ROM readers to back up the BIOS instead.

Currently, I am consulting Vintage Computer Forums on exactly how one should go about doing this. I will post any information I receive here. :)

kobushi

There are 3 separate BIOS rom dumping utilities included in the hard drive image I posted recently.

98digger

Quote from: kobushi on August 17, 2014, 11:44:06 AM
There are 3 separate BIOS rom dumping utilities included in the hard drive image I posted recently.


Could you please link to where you found the utilities?

Also, how would you write the dump to a new EPROM? I believe that EPROM programmers require the dump to be in a ".bin" or ".rom" format. Do these programs generate either of those file-types?

Thanks!

SkyeWelse

#3
While failing eproms may not be something to be as concerned about as we are more likely to experience problems in other areas first such as bad capacitors, battery acid leakage, et cetera... Once the thought of these eproms containing the bios possibly going bad or getting corrupted was put into my head, like 98digger here, it raises some concern for me as well. Especially when considering long term preparation steps for keeping these machines alive and kicking. I think we would have more peace of mind once we are successful in making a backup of the bios that could be restored onto a new eprom (or eeprom? Could an eeprom be used in place of an eprom?) I only started learning about the main difference last night in a conversation with a friend of mine who dabbles in electronics and hardware modifications that eprom is programed and can be erased using UV light. Thus a sticker is typically placed on eproms to cover the hole that could be exposed to UV light if you wanted to erase it, whereas eeproms can be erased electronically and are typically used when we talk about flashing a chip through software. All pretty fascinating stuff to learn about for a beginner like myself.

Kobushi, I did look briefly last night through your Tools directory on the Harddrive image you had posted in the other thread and saw many executable files in both the Dos and DosV folders. One of these was called Backup.exe, seems like there were different versions of this too (file size being a bit different) between the two folders. Would you or anyone else who has successfully backed up (and or restored) a PC98 bios before mind walking us through the steps for how to accomplish this?

I currently still do not have a harddrive setup either, so I'm hoping to learn a process for this that I can use on a standard 3.5" floppy diskette and possibly backup the bios file directly on that disk inserted into the system. Having something prepared and ready to go on a simple diskette or fdi/fdd file might be nice to have for the PC98 community as well in the long run so that others who are interested in getting actual hardware can follow this process more easily. I would be happy to help with making such a disk/guide if I knew the process for it.

Thanks for your time,

-Thomas

caius

Quote from: 98digger on August 18, 2014, 12:42:50 AM



Could you please link to where you found the utilities?

Also, how would you write the dump to a new EPROM? I believe that EPROM programmers require the dump to be in a ".bin" or ".rom" format. Do these programs generate either of those file-types?

Thanks!

Yes, defintely.I didn't try for PC-98 but have dumped all other BIOS from my X68000 and FM-TOWNS using native programs and output format was binary.Anyway if you dump your PC-98 BIOS, please, send the files to MESS team, I will do it me too when I'll receive my upcoming PC-9821AP2

kobushi

Quote from: 98digger on August 18, 2014, 12:42:50 AM
Could you please link to where you found the utilities?
As I explained in the other thread, they are utilities created by different emulator authors. They're available at the emulator websites.
getbios
http://retropc.net/yui/np2tool/
Source code is available at http://retropc.net/yui/np2.html (GETBIOS.ASM in the NP2TOOL folder)

mkbios
http://hwbb.gyao.ne.jp/soltin/virtual98.html
(in v98tools)

rommake
http://www.geocities.jp/t98next/download.html
(in T98-Next Tool)

QuoteAlso, how would you write the dump to a new EPROM? I believe that EPROM programmers require the dump to be in a ".bin" or ".rom" format. Do these programs generate either of those file-types?
If by .bin or .rom format you mean a raw memory dump, then yes. The main BIOS rom is the 96KB from 0xE8000 to 0xFFFFF. There's also a 32KB initial test firmware (ITF) rom, which is only dumped by mkbios.

Actually, if your goal is to backup and restore the entire rom chip, this program is better.
http://hp.vector.co.jp/authors/VA012947/util/getitf98.html

To restore a backup of the rom data, you would need to demount the rom chip and re-flash it using a rom writer. It's not terribly complicated, but then again I've never done it myself. ;D

Quote from: SkyeWelse on August 18, 2014, 02:51:53 AM
Kobushi, I did look briefly last night through your Tools directory on the Harddrive image you had posted in the other thread and saw many executable files in both the Dos and DosV folders. One of these was called Backup.exe, seems like there were different versions of this too (file size being a bit different) between the two folders. Would you or anyone else who has successfully backed up (and or restored) a PC98 bios before mind walking us through the steps for how to accomplish this?
Backup.exe is just the standard MS-DOS file backup tool. There are different versions because it's DOS 6 and DOS 5. It has nothing to do with dumping the bios.

The dumping tools are extremely easy to use. Do a clean boot (Reset and hold Shift if you're using DOS 6), then run the dumping program. If you can't run them from the hard drive, just copy the tools to a freshly formatted boot floppy (FORMAT /S).

98digger

#6
@SkyeWelse

Could you possibly open your PC-9821 and see if the BIOS chip is in a socket? Below is a picture of what a chip socket looks like:

http://img821.imageshack.us/img821/3361/40picsocketpl.jpg

If the BIOS EPROM is in a socket, then the need for de-soldering it from the motherboard is eliminated. This would make writing the BIOS back to the chip a lot easier.  :)

@kobushi

Thanks for posting the links! Like you said, getitf98 looks like the right program to use. I probably will make backups using all the programs, just in case. If the chip died and I found the backup unusable, that would be pretty bad.

I think that writing the BIOS back to the chip will probably be the biggest challenge. I've looked around online, and found that the EPROM the BIOS is written to is very difficult to get working with a ROM writer (the EPROM is used in numerous other old electronics, too). I know close-to-nothing about writing EPROMs, what writer to buy, hex codes, or bank switching, so a guide might be helpful.  :)

Also, is the ITF written to the same chip as the BIOS, or is it a different chip?

@caius

Did you use a ROM reader to dump the BIOS in the X68k and FM-TOWNS, or did you use a program to do it?

Also, as much as I would like to help the MESS Team, distributing your BIOS backups over the internet is illegal. One Japanese PC-98 website had a user refusing to distribute the BIOS because of 2 million yen fines. It's kind of strange, actually, because the Neko Project, Annex86 and T98 teams all illegally distribute the BIOS in their emulators.

(I had a conversation on MoTK (Touhou forum) about the emulators' BIOS a while ago: https://www.shrinemaiden.org/forum/index.php/topic,16841.0.html)

@everyone

I just remembered that PC-XT clones have similar problems with the EPROM BIOS chip being erased over time. What the PC-XT enthusiasts did, to fix this problem, is that they created a universal, legal, advanced clone BIOS for PC-XT computers. That way, it did not matter how long the EPROM lasted, because a free alternative was available. I don't think our PC-98 SIG is capable of it yet (we need to document the hardware more), but if someone was able to program a new universal BIOS for PC-98, then we could not only solve the EPROM BIOS problem, but possibly other problems too, such as picky CD drives and incompatibilities.

SkyeWelse

#7
98digger- Sure, it definitely appears to be a chip that is in a socket. Here are some closer photos of what I believe the chip is that you are referring to:
http://retro-type.com/PC98/ce2-bios-eprom-01.jpg
http://retro-type.com/PC98/ce2-bios-eprom-02.jpg

Thanks for providing these links Kobushi, I was able to successfully back up the Ce2 model S2D BIOS today with all 4 programs.

GETBIOS dumps the following files:
-BIOS.ROM
-FONT.ROM
-SOUND.ROM

T98-NEXT TOOLS dumps:
-BIOS.ROM
-FONT.ROM
-SOUND.ROM

MKBIOS dumps:
-BIOS.ROM
-ITF.ROM
-FONT.ROM
-SOUND.ROM

GETITF98 dumps:
-BANK0.BIN   
-BANK1.BIN
-BANK2.BIN
-BANK3.BIN
-BANK4.BIN
-BANK5.BIN
-BANK6.BIN
-BANK7.BIN

And according to the text file:

-BANK0 is PCI/PnP BIOS D8000h
-BANK1 is *Something in Hexidecimal*CAPIC Microcode update
-BANK2 is *Something in Hexidecimal*(MMDUMP), E, C
-Bank3 is IDE/ system setup menu D8000h
-Bank4 is ITF F8000h (Top boot block)
-Bank5 is BIOS E8000h (N88BASIC)
-Bank6 is BIOS F0000h (system)
-Bank7 is BIOS F8000h (system)

Of all the programs, this GETITF98 program was the most different. First off it will not let you run the program at all unless you are booting into DOS holding down SHIFT + RESET. If you do not, it will simply say: Cannot Run in V86 Mode

When you do run it holding down SHIFT + RESET, at least in my case it asked me: Not PCI Machine, Continue? Y/N Hitting Y (yes) will start the process dumping the BANK#.BIN files above.

In case this makes it easier, I've made 4 separate disk files (HDM format) that can be written to floppy diskette that contain these programs on each disk along with DOS 6.2. They are all ready to go, all you have to do is write them to disk, drop them in your FDD slot and run the commands/executables. Once I had the data collected, I used ImageDisk (After copy-protecting my disks using the sliding tab/cover on the disk itself) to make HDM images of each of my BIOS disks and saved those separately in a safe place.

Here are the disk files with the BIOS tools:


Edit: I have remade the disks using a Clean Dos 6.2 Disk as a starting point. These are ready to be written to actual disks using DiskImage.

PC98-BIOS-BACKUP-TOOLS.zip

-Thomas

kobushi

#8
Quote from: 98digger on August 19, 2014, 01:24:03 AM
Thanks for posting the links! Like you said, getitf98 looks like the right program to use. I probably will make backups using all the programs, just in case. If the chip died and I found the backup unusable, that would be pretty bad.

I think that writing the BIOS back to the chip will probably be the biggest challenge. I've looked around online, and found that the EPROM the BIOS is written to is very difficult to get working with a ROM writer (the EPROM is used in numerous other old electronics, too). I know close-to-nothing about writing EPROMs, what writer to buy, hex codes, or bank switching, so a guide might be helpful.  :)

Also, is the ITF written to the same chip as the BIOS, or is it a different chip?
As a minimum, I would recommend using getbios so you have the necessary roms to reproduce your machine in an emulator, and also getitf98 so you have a complete backup of the EPROM chip.

I've never tried to restore a PC98 EPROM, so I can't give you a detailed guide, but you would need a rom writer that's compatible with the EPROM chip type. After that, I think you could just concatenate the getitf98 BANK*.BIN files in the right order (read the readme!), and write them back all at once to the chip.

The ITF is definitely on the same chip as the BIOS.

QuoteIt's kind of strange, actually, because the Neko Project, Annex86 and T98 teams all illegally distribute the BIOS in their emulators.
This is completely untrue. The font rom is artificially created if an authentic rom is not present, and np2 and T98-Next do not include or require the bios/sound roms (although emulation is better if you supply the correct roms). There is absolutely nothing illegal about any of those emulators.

Anex86 can't even use the bios/sound roms, because strictly speaking Anex86 doesn't even emulate an NEC PC-9801 (it emulates the Epson clones of the PC-9801). This is why Anex86 can't play back the YM2608 rhythm samples, can't run anything written in N88 BASIC, and can't support games that use the sound rom (like Ultima IV).

Quote from: SkyeWelse on August 19, 2014, 06:40:44 AM
Of all the programs, this GETITF98 program was the most different. First off it will not let you run the program at all unless you are booting into DOS holding down SHIFT + RESET. If you do not, it will simply say: Cannot Run in V86 Mode

When you do run it holding down SHIFT + RESET, at least in my case it asked me: Not PCI Machine, Continue? Y/N Hitting Y (yes) will start the process dumping the BANK#.BIN files above.
You should be doing a clean boot regardless of which rom dumping program you use. That means no himem.sys, no emm386.exe, and no other device drivers.
The PCI error appears because getitf98 was mainly written for the last models of the PC-9821 that also included a PCI bus. It should still dump the correct data, but to be safe, you should confirm that bank4.bin is hash-identical to itf.rom dumped using mkbios, and that the concatenation of bank5.bin+bank6.bin+bank7.bin is hash-identical to bios.rom dumped using getbios and/or rommake.

98digger

Quote from: kobushi on August 19, 2014, 11:02:36 AM
QuoteIt's kind of strange, actually, because the Neko Project, Annex86 and T98 teams all illegally distribute the BIOS in their emulators.
This is completely untrue. The font rom is artificially created if an authentic rom is not present, and np2 and T98-Next do not require the bios/sound roms (although emulation is better with the correct roms). There is absolutely nothing illegal about any of those emulators.

Anex86 can't even use the bios/sound roms, because strictly speaking Anex86 doesn't even emulate an NEC PC-9801 (it emulates the Epson clones of the PC-9801). This is why Anex86 can't play back the YM2608 rhythm samples, can't run anything written in N88 BASIC, and can't support games that use the sound rom (like Ultima IV).

Actually, I debated this with the people over at Maidens of the Kaleidoscope (link to the topic is in my previous post on this thread). We ended up figuring out that the defualt BIOS included in both Neko and T89 had an NEC Copyright string when viewed with a hex editor. Annex86 apparently had no copyright in its included BIOS. However, we figured that all of the emulators are, in fact, illegal, when we were able to see the NEC boot loader on every emulator when two HDI's were mounted. The boot loader (which is, to my knowledge, stored in the BIOS) had the text "COPYRIGHT NEC CORPORATION" on every emulator.

Now, it is quite possible that the boot loader *could*, for some reason, be included in HDI files. I don't know whether it is the emulators or the images, so I opted to stay away from both until a clear answer became available.

In the case that the boot loader is actually included in PC-98 HDI, does anyone know a way to get rid of it/create a bootable image without it?

Thanks!  :)

kobushi

Quote from: 98digger on August 19, 2014, 11:48:15 AM
Actually, I debated this with the people over at Maidens of the Kaleidoscope (link to the topic is in my previous post on this thread). We ended up figuring out that the defualt BIOS included in both Neko and T89 had an NEC Copyright string when viewed with a hex editor. Annex86 apparently had no copyright in its included BIOS.
None of those emulators include a "default BIOS", so what you're saying doesn't make sense. The emulators are in no way illegal by themselves. What specific file did you view with a hex editor?

QuoteHowever, we figured that all of the emulators are, in fact, illegal, when we were able to see the NEC boot loader on every emulator when two HDI's were mounted. The boot loader (which is, to my knowledge, stored in the BIOS) had the text "COPYRIGHT NEC CORPORATION" on every emulator.

Now, it is quite possible that the boot loader *could*, for some reason, be included in HDI files. I don't know whether it is the emulators or the images, so I opted to stay away from both until a clear answer became available.
That's the PC-9801 hard disk MBR, which is stored on the hard disk. It includes a built-in boot selector that activates when multiple partitions are present.
The PC-9801 MBR is copyrighted by NEC, but I don't know if it's legally distributable or not. If you're that concerned about it, you should contact NEC and ask them. And you probably shouldn't go around downloading random HDI files.

SkyeWelse

Quote from: kobushi on August 19, 2014, 11:02:36 AM
You should be doing a clean boot regardless of which rom dumping program you use. That means no himem.sys, no emm386.exe, and no other device drivers.
The PCI error appears because getitf98 was mainly written for the last models of the PC-9821 that also included a PCI bus. It should still dump the correct data, but to be safe, you should confirm that bank4.bin is hash-identical to itf.rom dumped using mkbios, and that the concatenation of bank5.bin+bank6.bin+bank7.bin is hash-identical to bios.rom dumped using getbios and/or rommake.

Ah, I guess that case, I need to find a way to create a very barebones Dos 6.2. I was playing around with it earlier trying to take out himem and emm386 and one other, but by removing them I was getting "No System Files" errors. So I thought they needed to be in there to work. I didn't try removing them from the config.sys file, but I suppose I'm working from the CD-Rom Loader with Dos 6.2 as a starting point, so I'm a bit confused on what really should be there and what shouldn't.

For now I'll remove the link to that zip file with the pre-configured Bios tools disks until I can learn how to create a cleaner version of DOS. Thanks for stepping in to point this out or my dumps may not have been good ones to preserve.

-Thomas

caius

Quote from: 98digger on August 19, 2014, 01:24:03 AM

@caius

Did you use a ROM reader to dump the BIOS in the X68k and FM-TOWNS, or did you use a program to do it?




Regarding X68000 I used some program as well as for Fujitsu FM-TOWNS Marty 2 and FM-TOWNS II MX and Fresh-TV.Only one time I used my EPROM programmer to read the BIOS from the FM-TOWNS II MX but the resulting file (2048 KB) had to be splitted in more parts  to be emulator usable while native programs do the job for you.

98digger

While opening up my PC-9821 Ce2 for copper-trace examination today, I decided to copy down the info of the chip I found in place of the BIOS EPROM:

NEC Japan
D23C4000SCZ
9414K D001

Apparently, this is a mask-ROM, the same type of which was used in the Japanese SEGA Channel cart (which was built for SEGA by NEC).

Also, I copied down the names of several other interesting chips I saw:

-PEBBLEBEACH
-AUGUSTA
-BAKURYU
-GRANDPAPA2
-CHEZRITH
-KODAMA2
-HRTC3
-HIKARIR
-TOKIR
-VL-PALETTE/E (Probably contains the palette)
-WAVEMIXER2 (Probably for PCM audio, possibly from the CD-ROM drive)
-YM3016-D (Digital to Analog Converter (DAC), which accompanies all OPNA and OPNB chips)
-Bt (Another DAC, but this one is most likely used for the video output, I guess)
-2 (C) NEC Corp.-labeled chips

Apparently, most of these chips are the main difference between IBM-PC and NEC-PC. i486 IBM clones I see have about four or less chips that contain the architecture, while the processor and ISA bus take up like 75% of the board. PC-98 has more than 13 chips that make up the architecture, which appear to demonstrate the complexity and advancement over the IBM-PC architecture (at the time, at least). Also, none of these other chip appear to be EPROM/EEPROM; we only need to worry about the BIOS EPROM, which is not even present on some PC-98 revisions.

SO, from what I've gathered, 98multi PC-98 vary between whether they have an EPROM or not. A-Mate computers use either an EPROM or flash memory, the latter which was upgrades by some sort of bootable disk. Many PC-9801 have either mask-ROM or EPROM, while PC-9821 (mostly the Windows-optimized ones) use flash memory. I don't know about FC-98, SC-98, SV-98, H98, or PC-88 yet.

-98digger

caius

Some days ago I dumped the BIOS from my PC-9821AP2/U8W, device was a NEC 27C4000 labelled 'PHD0102'.Here is the dump:

https://drive.google.com/file/d/0B0oZORLQc26xeXd0Y292QjFVYVk/edit?usp=sharing

Now, it would be interesting if someone could try it in a emulator after splitting it in needed files.