summaryrefslogtreecommitdiffstats
path: root/sys/boot/pc98/boot2
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2005-05-08 14:17:28 +0000
committernyan <nyan@FreeBSD.org>2005-05-08 14:17:28 +0000
commit27c543668baefe5a124d7e62e2250fe8e836e773 (patch)
treee22736b5de266941b5b960296376f7f3f9f5c1c8 /sys/boot/pc98/boot2
parent7ccdf6dff30bd501b457faa9e066fba043a5916f (diff)
downloadFreeBSD-src-27c543668baefe5a124d7e62e2250fe8e836e773.zip
FreeBSD-src-27c543668baefe5a124d7e62e2250fe8e836e773.tar.gz
Remove ifdef PC98.
Diffstat (limited to 'sys/boot/pc98/boot2')
-rw-r--r--sys/boot/pc98/boot2/Makefile2
-rw-r--r--sys/boot/pc98/boot2/boot.c44
-rw-r--r--sys/boot/pc98/boot2/boot.h5
-rw-r--r--sys/boot/pc98/boot2/boot2.S2
-rw-r--r--sys/boot/pc98/boot2/disk.c31
-rw-r--r--sys/boot/pc98/boot2/io.c26
-rw-r--r--sys/boot/pc98/boot2/sys.c17
-rw-r--r--sys/boot/pc98/boot2/table.c4
8 files changed, 3 insertions, 128 deletions
diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile
index 7d2447a..2bac1e4 100644
--- a/sys/boot/pc98/boot2/Makefile
+++ b/sys/boot/pc98/boot2/Makefile
@@ -10,7 +10,7 @@ BINMODE= 444
CFLAGS= -Os -mrtd \
-fno-guess-branch-probability \
-fno-unit-at-a-time \
- -D_KERNEL -DPC98 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
+ -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
CFLAGS+= ${CWARNFLAGS}
CFLAGS+= -I${.CURDIR}/../../.. -I.
diff --git a/sys/boot/pc98/boot2/boot.c b/sys/boot/pc98/boot2/boot.c
index 58c789d..fe288c0 100644
--- a/sys/boot/pc98/boot2/boot.c
+++ b/sys/boot/pc98/boot2/boot.c
@@ -81,24 +81,16 @@ static void readfile(char *path, char *buf, size_t nbytes);
void
boot(int drive)
{
- int ret;
-#ifdef PC98
- int i;
+ int i, ret;
unsigned char disk_equips;
-#endif
/* Pick up the story from the Bios on geometry of disks */
-#ifdef PC98
for(ret = 0; ret < 2; ret ++) {
if (*(unsigned char*)V(0xA155d) & (1 << ret)) {
bootinfo.bi_bios_geom[ret] = get_diskinfo(ret + 0x80);
}
}
-#else /* IBM-PC */
- for(ret = 0; ret < N_BIOS_GEOM; ret ++)
- bootinfo.bi_bios_geom[ret] = get_diskinfo(ret + 0x80);
-#endif /* PC98 */
bootinfo.bi_basemem = memsize(0);
bootinfo.bi_extmem = memsize(1);
@@ -106,17 +98,14 @@ boot(int drive)
gateA20();
-#ifdef PC98
/* set machine type to PC98_SYSTEM_PARAMETER */
machine_check();
-#endif /* PC98 */
/*
* The default boot device is the first partition in the
* compatibility slice on the boot drive.
*/
dosdev = drive;
-#ifdef PC98
maj = (drive&0x70) >> 3; /* a good first bet */
if (maj == 4) { /* da */
disk_equips = *(unsigned char *)V(0xA1482);
@@ -132,29 +121,6 @@ boot(int drive)
} else {
unit = drive & 0x0f;
}
-#else /* IBM-PC */
- maj = 2;
- unit = drive & 0x7f;
-#ifdef dontneed
- slice = 0;
- part = 0;
-#endif
- if (drive & 0x80) {
- /* Hard drive. Adjust. */
- maj = 0;
-#if BOOT_HD_BIAS > 0
- if (unit >= BOOT_HD_BIAS) {
- /*
- * The drive is probably a SCSI drive with a unit
- * number BOOT_HD_BIAS less than the BIOS drive
- * number.
- */
- maj = 4;
- unit -= BOOT_HD_BIAS;
- }
-#endif
- }
-#endif /* PC98 */
readfile("boot.config", boot_config, BOOT_CONFIG_SIZE);
name = "/boot/loader";
if (boot_config[0] != '\0') {
@@ -173,11 +139,7 @@ loadstart:
ouraddr, bootinfo.bi_basemem, bootinfo.bi_extmem,
(loadflags & RB_SERIAL) ? "serial" : "internal",
(loadflags & RB_DUAL) ? "/dual" : "",
-#ifdef PC98
dosdev & 0x0f, devs[maj], unit, 'a' + part,
-#else
- dosdev & 0x7f, devs[maj], unit, 'a' + part,
-#endif
name ? name : "*specify_a_kernel_name*",
boot_help);
@@ -242,11 +204,7 @@ loadprog(void)
startaddr = head.a_entry & 0x00FFFFFF;
addr = startaddr;
printf("Booting %d:%s(%d,%c)%s @ 0x%x\n"
-#ifdef PC98
, dosdev & 0x0f
-#else
- , dosdev & 0x7f
-#endif
, devs[maj]
, unit
, 'a'+part
diff --git a/sys/boot/pc98/boot2/boot.h b/sys/boot/pc98/boot2/boot.h
index 6fd1e99..e39fee5 100644
--- a/sys/boot/pc98/boot2/boot.h
+++ b/sys/boot/pc98/boot2/boot.h
@@ -89,9 +89,7 @@ int strcasecmp(const char *s1, const char *s2);
#endif /* !CDBOOT */
void memcpy(const void *from, void *to, size_t len);
void twiddle(void);
-#ifdef PC98
void machine_check(void);
-#endif
/* probe_keyboard.c */
int probe_keyboard(void);
@@ -107,7 +105,4 @@ void xread(char *addr, int size);
void read(char *buffer, int count);
int openrd(void);
-#ifdef PC98
#define V(ra) (ra - BOOTSEG * 0x10)
-#endif
-
diff --git a/sys/boot/pc98/boot2/boot2.S b/sys/boot/pc98/boot2/boot2.S
index 6055475..be85030 100644
--- a/sys/boot/pc98/boot2/boot2.S
+++ b/sys/boot/pc98/boot2/boot2.S
@@ -173,9 +173,7 @@ ENTRY(boot2)
movl %esp, EXT(dflt_name)
#endif
-#ifdef PC98
movb 0xA1584 - BOOTSEG * 0x10, %dl
-#endif
movzbl %dl, %edx /* discard head (%dh) and random high bits */
pushl %edx
call EXT(boot)
diff --git a/sys/boot/pc98/boot2/disk.c b/sys/boot/pc98/boot2/disk.c
index 835fff0..f9706ca 100644
--- a/sys/boot/pc98/boot2/disk.c
+++ b/sys/boot/pc98/boot2/disk.c
@@ -98,7 +98,6 @@ devopen(void)
#ifdef EMBEDDED_DISKLABEL
dl = &disklabel;
#else /* EMBEDDED_DISKLABEL */
-#ifdef PC98
p = Bread(dosdev_copy, 1);
dptr = (struct pc98_partition *)p;
slice = WHOLE_DISK_SLICE;
@@ -111,20 +110,6 @@ devopen(void)
p = Bread(dosdev, sector + LABELSECTOR);
dl=((struct disklabel *)p);
disklabel = *dl; /* structure copy (maybe useful later)*/
-#else
- p = Bread(dosdev_copy, 0);
- dptr = (struct dos_partition *)(p+DOSPARTOFF);
- slice = WHOLE_DISK_SLICE;
- for (i = 0; i < NDOSPART; i++, dptr++)
- if (dptr->dp_typ == DOSPTYP_386BSD) {
- slice = BASE_SLICE + i;
- sector = dptr->dp_start;
- break;
- }
- p = Bread(dosdev_copy, sector + LABELSECTOR);
- dl=((struct disklabel *)p);
- disklabel = *dl; /* structure copy (maybe useful later)*/
-#endif /* PC98 */
#endif /* EMBEDDED_DISKLABEL */
if (dl->d_magic != DISKMAGIC) {
printf("bad disklabel\n");
@@ -133,16 +118,6 @@ devopen(void)
/* This little trick is for OnTrack DiskManager disks */
boff = dl->d_partitions[part].p_offset -
dl->d_partitions[2].p_offset + sector;
-
-#ifndef PC98
- bsize = dl->d_partitions[part].p_size;
- if (bsize == 0) {
- printf("empty partition\n");
- return 1;
- }
-
-#endif
-
}
#endif /* RAWBOOT */
return 0;
@@ -176,12 +151,6 @@ Bread(int dosdev, int sector)
int cyl, head, sec, nsec;
cyl = sector/spc;
-#ifndef PC98
- if (cyl > 1023) {
- printf("Error: C:%d > 1023 (BIOS limit)\n", cyl);
- for(;;); /* loop forever */
- }
-#endif
head = (sector % spc) / spt;
sec = sector % spt;
nsec = spt - sec;
diff --git a/sys/boot/pc98/boot2/io.c b/sys/boot/pc98/boot2/io.c
index 88dc8ba..d4657a2 100644
--- a/sys/boot/pc98/boot2/io.c
+++ b/sys/boot/pc98/boot2/io.c
@@ -32,10 +32,7 @@ __FBSDID("$FreeBSD$");
#include "boot.h"
#include <machine/cpufunc.h>
#include <sys/reboot.h>
-#ifdef PC98
#include <pc98/pc98/pc98.h>
-#endif
-
static int getchar(int in_buf);
@@ -159,15 +156,10 @@ loop:
void
delay1ms(void)
{
-#ifdef PC98
int i = 800;
+
while (--i >= 0)
(void)outb(0x5f,0); /* about 600ns */
-#else
- int i = 800;
- while (--i >= 0)
- (void)inb(0x84);
-#endif
}
static __inline int
@@ -193,7 +185,6 @@ isch(void)
static __inline unsigned
pword(unsigned physaddr)
{
-#ifdef PC98
static int counter = 0;
int i;
@@ -201,28 +192,13 @@ pword(unsigned physaddr)
(void)outb(0x5f, 0);
return (counter++);
-#else
- unsigned result;
-
- /*
- * Give the fs prefix separately because gas omits it for
- * "movl %fs:0x46c, %eax".
- */
- __asm __volatile("fs; movl %1, %0" : "=r" (result)
- : "m" (*(unsigned *)physaddr));
- return (result);
-#endif
}
int
gets(char *buf)
{
#define bios_tick pword(0x46c)
-#ifdef PC98
#define BIOS_TICK_MS 1
-#else
-#define BIOS_TICK_MS 55
-#endif
unsigned initial_bios_tick;
char *ptr=buf;
diff --git a/sys/boot/pc98/boot2/sys.c b/sys/boot/pc98/boot2/sys.c
index d924624..0ceb07e 100644
--- a/sys/boot/pc98/boot2/sys.c
+++ b/sys/boot/pc98/boot2/sys.c
@@ -262,11 +262,7 @@ openrd(void)
}
biosdrive = biosdrivedigit - '0';
if (biosdrivedigit == '\0') {
-#ifdef PC98
biosdrive = dosdev & 0x0f;
-#else
- biosdrive = unit;
-#endif
#if BOOT_HD_BIAS > 0
/* XXX */
if (maj == 4)
@@ -275,29 +271,16 @@ openrd(void)
}
switch(maj)
{
-#ifdef PC98
case 4: /* da */
dosdev_copy = biosdrive | 0xA0; /* SCSI HD or MO */
-#else /* IBM-PC */
- case 0:
- case 4:
- dosdev_copy = biosdrive | 0x80;
-#endif
break;
-#ifdef PC98
case 0: /* wd */
case 2: /* 1200KB fd */
dosdev_copy = (maj << 3) | unit | 0x80;
-#else
- case 2:
- dosdev_copy = biosdrive;
-#endif
break;
-#ifdef PC98
case 6: /* 1440KB fd */
dosdev_copy = (maj << 3) | unit;
break;
-#endif
default:
printf("Unknown device\n");
return 1;
diff --git a/sys/boot/pc98/boot2/table.c b/sys/boot/pc98/boot2/table.c
index bcdc178..e8e6dea5 100644
--- a/sys/boot/pc98/boot2/table.c
+++ b/sys/boot/pc98/boot2/table.c
@@ -85,16 +85,12 @@ struct seg_desc Gdt[] = {
{0xFFFF, 0x0, 0x0, 0x93, 0xCF, 0x0}, /* 0x10 : kernel data */
/* 0x92? */
{0xFFFF, RUN, RUN, 0x9E, 0x40, 0x0}, /* 0x18 : boot code */
-#ifdef PC98
/*
* The limit of boot data should be more than or equal to 0x9FFFF
* for saving BIOS parameter and EPSON machine ID into 2'nd T-VRAM,
* because base address is normally 0x10000.
*/
{0xFFFF, RUN, RUN, 0x92, 0x4F, 0x0}, /* 0x20 : boot data */
-#else
- {0xFFFF, RUN, RUN, 0x92, 0x40, 0x0}, /* 0x20 : boot data */
-#endif
{0xFFFF, RUN, RUN, 0x9E, 0x0, 0x0}, /* 0x28 : boot code, 16 bits */
{0xFFFF, 0x0, 0x0, 0x92, 0x0, 0x0}, /* 0x30 : boot data, 16 bits */
#ifdef BDE_DEBUGGER
OpenPOWER on IntegriCloud