O PC-98 in FreeBSD source


This section describes PC-98 related code in the FreeBSD source tree.

OContents

O Get memory size
O SCSI HDD geometry of PC-98
O Multi vendor support in ed driver
O Multi bus support in aic driver

Back to PC-98 architecture main page


OGet memory size

BIOS stores physical memory size on PC-98 into three parts. First is conventional memorysize, which can be considered always 640KB. Second is extended RAM size in the area 1MB-16MB. Memory size in this area is stored at 0000:0x0401 (real mode addressing) in 128KB. This can be accessed via following macro in the kernel:
PC98_SYSTEM_PARAMETER(0x401)

The third is extended RAM size in the area higher than 16MB. The size in this area is stored at 0000:0x594 (real mode addressubg) in 1MB. This can be accessed via following macro:

PC98_SYSTEM_PARAMETER(0x594)

Therefore, physical memory size can be calculated by follwoing code:


        u_char	under16, over16;

        under16 = PC98_SYSTEM_PARAMETER(0x401);
        over16 = PC98_SYSTEM_PARAMETER(0x594);
        under16 += 8;		/* Conventional memory size in 128KB */
        Maxmem = under16 * 128 * 1024 / PAGE_SIZE;
        Maxmem += (over16 * 1024 * 1024 / PAGE_SIZE);
    

Exception 1

The BIOS on old EPSON machine does not set extended memory size into BIOS work area. The locore.s detects such machine and count up memory size in it.

Exception 2

Some CPU upgrade products for i386 machines have memory slots on it. The memory on the CPU upgrade board is assigned to the area higher than 16MB. Because BIOS on i386 machine never counts the memory size in such area. We, currently, do not have extra memory count machanism for this case. Please use MAXMEM option at kernel conmilation time.

Back to the contents


OSCSI HDD geometry of PC-98

For historical reason, the geometry information of SCSI HDD should be faked by SCSI card BIOS, except for PCMCIA device. The geometry information is collected in the function sd_get_parms(), and there is PC-98 code in it. The geometry information is set into the BIOS work area in the range of 0000:0x0460 - 0000:0x47f (real mode addressing). This area is composed of seven parts which correspond to SCSI IDs. The first octet indicates the number of sectors per track. The next octet indicates the number of head. The bit 15 of next 16 bit indicates that the device is hard sectored or soft sectored. The bit 13 and 12 of this word indicate the number of bytes per sector. The rest of this word indicates number of cylinders.

 7             0 7     4     1 0 7             0 7 6 5 4 3     0
+---------------+-------+-------+---------------+-+-+---+-------+
|  S            | C3    |  H    |    C1         |T|N|BS |  C2   |
+---------------+-------+-------+---------------+-+-+---+-------+
S
number of sectors per track
C1, C2, C3
number of cylinders
H
number of heads
T
sector type
  • 0 soft sector
  • 1 hard sector
N
  • 0 cylinder size field is 12 bits
  • 1 cylinder size filed is 16 bits
BS
logical block size
  • 00 256 byts / block
  • 01 512 byts / block
  • 10 1024 byts / block
The number of cylinder is calculated by:

Back to the contents


OMulti vendor support in ed driver

Back to the contents


OMulti bus support in aic driver

Back to the contents


PC-98 architecture main page

my face My home page