Cosmetic changes.

This commit is contained in:
Yoshihiro Takahashi 1999-11-16 00:42:18 +00:00
parent f089b54dc6
commit 4374deee58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53207
5 changed files with 48 additions and 9 deletions

View file

@ -227,6 +227,7 @@ bd_init(void)
static int
bd_int13probe(struct bdinfo *bd)
{
#ifdef PC98
int addr;
if (bd->bd_flags & BD_FLOPPY){
@ -535,6 +536,7 @@ bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev)
od->od_boff = sector; /* no partition, must be after the slice */
DEBUG("opening raw slice");
} else {
if (bd_read(od, sector + LABELSECTOR, 1, buf)) {
DEBUG("error reading disklabel");
error = EIO;
@ -938,6 +940,37 @@ bd_getgeom(struct open_disk *od)
return(0);
}
#ifndef PC98
/*
* Return the BIOS geometry of a given "fixed drive" in a format
* suitable for the legacy bootinfo structure. Since the kernel is
* expecting raw int 0x13/0x8 values for N_BIOS_GEOM drives, we
* prefer to get the information directly, rather than rely on being
* able to put it together from information already maintained for
* different purposes and for a probably different number of drives.
*
* For valid drives, the geometry is expected in the format (31..0)
* "000000cc cccccccc hhhhhhhh 00ssssss"; and invalid drives are
* indicated by returning the geometry of a "1.2M" PC-format floppy
* disk. And, incidentally, what is returned is not the geometry as
* such but the highest valid cylinder, head, and sector numbers.
*/
u_int32_t
bd_getbigeom(int bunit)
{
v86.ctl = V86_FLAGS;
v86.addr = 0x13;
v86.eax = 0x800;
v86.edx = 0x80 + bunit;
v86int();
if (v86.efl & 0x1)
return 0x4f010f;
return ((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) |
(v86.edx & 0xff00) | (v86.ecx & 0x3f);
}
#endif
/*
* Return a suitable dev_t value for (dev).
*

View file

@ -1,5 +1,7 @@
/*
* mjs copyright
*
* $FreeBSD$
*/
/*
@ -51,6 +53,7 @@ getextmem(void)
v86int();
extkb = v86.eax & 0xffff;
#endif
/* Set memtop to actual top or 16M, whicheve is less */
memtop = min((0x100000 + (extkb * 1024)), (16 * 1024 * 1024));

View file

@ -242,13 +242,10 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
struct i386_devdesc *rootdev;
vm_offset_t addr, bootinfo_addr;
char *rootdevname;
int bootdevnr;
int bootdevnr, i;
u_int pad;
char *kernelname;
const char *kernelpath;
#ifdef PC98
int i;
#endif
*howtop = bi_getboothowto(args);
@ -289,10 +286,12 @@ bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip)
bi.bi_kernelname = 0; /* XXX char * -> kernel name */
bi.bi_nfs_diskless = 0; /* struct nfs_diskless * */
bi.bi_n_bios_used = 0; /* XXX would have to hook biosdisk driver for these */
/* bi.bi_bios_geom[] */
#ifdef PC98
for(i = 0; i < N_BIOS_GEOM; i++)
bi.bi_bios_geom[i] = initial_bootinfo->bi_bios_geom[i];
#else
for (i = 0; i < N_BIOS_GEOM; i++)
bi.bi_bios_geom[i] = bd_getbigeom(i);
#endif
bi.bi_size = sizeof(bi);
bi.bi_memsizes_valid = 1;

View file

@ -1,5 +1,7 @@
/*
* mjs copyright
*
* $FreeBSD$
*/
#include <stand.h>
@ -21,6 +23,7 @@ time(time_t *t)
{
static time_t lasttime, now;
int hr, min, sec;
#ifdef PC98
unsigned char bios_time[6];
#endif

View file

@ -646,6 +646,7 @@ vidc_ischar(void)
}
#if KEYBOARD_PROBE
#ifdef PC98
static int
probe_keyboard(void)