mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-28 08:02:54 +00:00
Minor cleanup, no functional changes:
- Add/change some comments, - remove superfluous `if (1||x)' and re-indent, - fix initialization of floppyinfo[] to get rid of warning.
This commit is contained in:
parent
3a10201f01
commit
ff7926e949
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84837
@ -116,28 +116,26 @@ int15(regcontext_t *REGS)
|
||||
R_AH = 0x86;
|
||||
R_FLAGS |= PSL_C; /* We don't support a cassette */
|
||||
break;
|
||||
|
||||
case 0x04: /* Set ABIOS table */
|
||||
case 0x04: /* Set ABIOS table */
|
||||
R_FLAGS |= PSL_C; /* We don't support it */
|
||||
break;
|
||||
|
||||
case 0x4f:
|
||||
/*
|
||||
* XXX - Check scan code in GET8L(sc->sc_eax).
|
||||
*/
|
||||
case 0x4f: /* Keyboard intercept */
|
||||
debug(D_TRAPS | 0x15, "BIOS: Keyboard intercept\n");
|
||||
/* Don't translate scan code. */
|
||||
break;
|
||||
case 0x88:
|
||||
get_raw_extmemory_info(REGS);
|
||||
break;
|
||||
case 0xc0: /* get configuration */
|
||||
debug (D_TRAPS|0x15, "Get configuration\n", R_DX);
|
||||
case 0xc0: /* Get configuration */
|
||||
debug(D_TRAPS | 0x15, "BIOS: Get configuration\n");
|
||||
PUTVEC(R_ES, R_BX, rom_config);
|
||||
R_AH = 0;
|
||||
break;
|
||||
case 0xc1: /* get extended BIOS data area */
|
||||
case 0xc1: /* Get extended BIOS data area */
|
||||
R_FLAGS |= PSL_C;
|
||||
break;
|
||||
case 0xc2: /* Pointing device */
|
||||
case 0xc2: /* Pointing device */
|
||||
debug(D_TRAPS | 0x15, "BIOS: Pointing device?\n");
|
||||
R_FLAGS |= PSL_C;
|
||||
R_AH = 5; /* No pointer */
|
||||
break;
|
||||
@ -158,55 +156,46 @@ bios_init(void)
|
||||
struct tm tm;
|
||||
u_long vec;
|
||||
|
||||
if (1 || !raw_kbd) {
|
||||
strcpy((char *)BIOS_copyright,
|
||||
"Copyright (C) 1993 Krystal Technologies/BSDI");
|
||||
strcpy((char *)BIOS_copyright,
|
||||
"Copyright (C) 1993 Krystal Technologies/BSDI");
|
||||
|
||||
*(u_short *)BIOS_reset = 0xffcd;
|
||||
*(u_short *)BIOS_nmi = 0xffcd;
|
||||
*(u_short *)BIOS_boot = 0xffcd;
|
||||
*(u_short *)BIOS_comm_io = 0xffcd;
|
||||
*(u_short *)BIOS_keyboard_io = 0xffcd;
|
||||
*(u_short *)BIOS_keyboard_isr = 0xffcd;
|
||||
*(u_short *)BIOS_fdisk_io = 0xffcd;
|
||||
*(u_short *)BIOS_fdisk_isr = 0xffcd;
|
||||
*(u_short *)BIOS_printer_io = 0xffcd;
|
||||
*(u_short *)BIOS_video_io = 0xffcd;
|
||||
*(u_short *)BIOS_cassette_io = 0xffcd;
|
||||
*(u_short *)BIOS_time_of_day = 0xffcd;
|
||||
*(u_short *)BIOS_timer_int = 0xffcd;
|
||||
*(u_short *)BIOS_dummy_iret = 0xffcd;
|
||||
*(u_short *)BIOS_print_screen = 0xffcd;
|
||||
*(u_short *)BIOS_hard_reset = 0xffcd;
|
||||
*(u_short *)BIOS_mem_size = 0xffcd;
|
||||
*(u_short *)BIOS_equipment = 0xffcd;
|
||||
*(u_short *)BIOS_vector = 0xffcd;
|
||||
*(u_char *)0xffff2 = 0xcf; /* IRET */
|
||||
*(u_short *)BIOS_reset = 0xffcd;
|
||||
*(u_short *)BIOS_nmi = 0xffcd;
|
||||
*(u_short *)BIOS_boot = 0xffcd;
|
||||
*(u_short *)BIOS_comm_io = 0xffcd;
|
||||
*(u_short *)BIOS_keyboard_io = 0xffcd;
|
||||
*(u_short *)BIOS_keyboard_isr = 0xffcd;
|
||||
*(u_short *)BIOS_fdisk_io = 0xffcd;
|
||||
*(u_short *)BIOS_fdisk_isr = 0xffcd;
|
||||
*(u_short *)BIOS_printer_io = 0xffcd;
|
||||
*(u_short *)BIOS_video_io = 0xffcd;
|
||||
*(u_short *)BIOS_cassette_io = 0xffcd;
|
||||
*(u_short *)BIOS_time_of_day = 0xffcd;
|
||||
*(u_short *)BIOS_timer_int = 0xffcd;
|
||||
*(u_short *)BIOS_dummy_iret = 0xffcd;
|
||||
*(u_short *)BIOS_print_screen = 0xffcd;
|
||||
*(u_short *)BIOS_hard_reset = 0xffcd;
|
||||
*(u_short *)BIOS_mem_size = 0xffcd;
|
||||
*(u_short *)BIOS_equipment = 0xffcd;
|
||||
*(u_short *)BIOS_vector = 0xffcd;
|
||||
*(u_char *)0xffff2 = 0xcf; /* IRET */
|
||||
|
||||
/*
|
||||
*memcpy((u_char *)BIOS_video_parms, video_parms, sizeof(video_parms));
|
||||
*/
|
||||
memcpy((u_char *)BIOS_disk_parms, disk_params, sizeof(disk_params));
|
||||
memcpy((u_char *)BIOS_comm_table, comm_table, sizeof(comm_table));
|
||||
memcpy((u_char *)BIOS_disk_parms, disk_params, sizeof(disk_params));
|
||||
memcpy((u_char *)BIOS_comm_table, comm_table, sizeof(comm_table));
|
||||
|
||||
*(u_short *)BIOS_video_font = 0xffcd;
|
||||
*(u_short *)BIOS_video_font = 0xffcd;
|
||||
|
||||
jtab = (u_char *)BIOS_date_stamp;
|
||||
*jtab++ = '1';
|
||||
*jtab++ = '0';
|
||||
*jtab++ = '/';
|
||||
*jtab++ = '3';
|
||||
*jtab++ = '1';
|
||||
*jtab++ = '/';
|
||||
*jtab++ = '9';
|
||||
*jtab++ = '3';
|
||||
jtab = (u_char *)BIOS_date_stamp;
|
||||
*jtab++ = '1';
|
||||
*jtab++ = '0';
|
||||
*jtab++ = '/';
|
||||
*jtab++ = '3';
|
||||
*jtab++ = '1';
|
||||
*jtab++ = '/';
|
||||
*jtab++ = '9';
|
||||
*jtab++ = '3';
|
||||
|
||||
#if 0
|
||||
*(u_char *)BIOS_hardware_id = 0xfe; /* Identify as a PC/XT */
|
||||
*(u_char *)BIOS_hardware_id = 0xff; /* Identify as a PC */
|
||||
#endif
|
||||
*(u_char *)BIOS_hardware_id = 0xfc; /* Identify as a PC/AT */
|
||||
}
|
||||
*(u_char *)BIOS_hardware_id = 0xfc; /* Identify as a PC/AT */
|
||||
|
||||
/*
|
||||
* Interrupt revectors F000:0000 - F000:03ff
|
||||
|
@ -19,7 +19,7 @@
|
||||
*
|
||||
* Related functions:
|
||||
* int isinhardint(int irql)
|
||||
* void set_eoir(int irql, void(*eoir)(void*), void* arg);
|
||||
* void set_eoir(int irql, void (*eoir)(void *), void *arg);
|
||||
*
|
||||
*/
|
||||
|
||||
@ -29,8 +29,8 @@ struct IRQ {
|
||||
int pending;
|
||||
int busy;
|
||||
int within;
|
||||
void (*eoir) (void* arg);
|
||||
void* arg;
|
||||
void (*eoir)(void *arg);
|
||||
void *arg;
|
||||
};
|
||||
|
||||
static unsigned char IM;
|
||||
@ -40,7 +40,7 @@ static struct IRQ Irqs[8];
|
||||
#define int_allowed(n) ((IM & 1 << (n)) == 0 && Irql > (n))
|
||||
|
||||
void
|
||||
set_eoir(int irql, void(*eoir)(void*), void* arg)
|
||||
set_eoir(int irql, void (*eoir)(void *), void *arg)
|
||||
{
|
||||
Irqs [irql].eoir = eoir;
|
||||
Irqs [irql].arg = arg;
|
||||
@ -63,7 +63,7 @@ set_vip(void)
|
||||
return;
|
||||
}
|
||||
|
||||
for (irql = 0; irql < 8; irql ++)
|
||||
for (irql = 0; irql < 8; irql++)
|
||||
if (int_allowed(irql) && (Irqs[irql].within || Irqs[irql].pending)) {
|
||||
R_EFLAGS |= PSL_VIP;
|
||||
return;
|
||||
@ -79,14 +79,14 @@ resume_interrupt(void)
|
||||
int irql;
|
||||
|
||||
if (R_EFLAGS & PSL_VIF) {
|
||||
for (irql = 0; irql < 8; irql ++)
|
||||
for (irql = 0; irql < 8; irql++)
|
||||
if (Irqs[irql].within && int_allowed(irql)) {
|
||||
Irqs[irql].within = 0;
|
||||
if (Irqs[irql].eoir)
|
||||
Irqs[irql].eoir(Irqs[irql].arg);
|
||||
}
|
||||
|
||||
for (irql = 0; irql < 8; irql ++)
|
||||
for (irql = 0; irql < 8; irql++)
|
||||
if (Irqs[irql].pending && int_allowed(irql)) {
|
||||
Irqs[irql].pending = 0;
|
||||
hardint(irql);
|
||||
@ -135,7 +135,7 @@ hardint(int irql)
|
||||
if ((vec >> 16) == 0xf000 || *(u_char *)VECPTR(vec) == 0xcf)
|
||||
return;
|
||||
|
||||
if (!int_allowed (irql)) {
|
||||
if (!int_allowed(irql)) {
|
||||
Irqs[irql].pending = 1;
|
||||
return;
|
||||
}
|
||||
|
@ -256,53 +256,68 @@ int10(regcontext_t *REGS)
|
||||
break;
|
||||
case 0x11:
|
||||
switch (R_AL) {
|
||||
case 0x00:
|
||||
case 0x00: /* Text-mode chargen: load user-specified
|
||||
patterns */
|
||||
debug(D_VIDEO, "Tried to load user defined font.\n");
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x01: /* Text-mode chargen: load ROM monochrome
|
||||
patterns */
|
||||
debug(D_VIDEO, "Tried to load 8x14 font.\n");
|
||||
break;
|
||||
case 0x02:
|
||||
case 0x02: /* Text-mode chargen: load ROM 8x8 double-dot
|
||||
patterns */
|
||||
debug(D_VIDEO, "Tried to load 8x8 font.\n");
|
||||
break;
|
||||
case 0x03:
|
||||
case 0x03: /* Text-mode chargen: set block specifier */
|
||||
debug(D_VIDEO, "Tried to activate character set\n");
|
||||
break;
|
||||
case 0x04:
|
||||
case 0x04: /* Text-mode chargen: load ROM 8x16 character
|
||||
set */
|
||||
debug(D_VIDEO, "Tried to load 8x16 font.\n");
|
||||
break;
|
||||
case 0x10:
|
||||
case 0x10: /* Text-mode chargen: load and activate
|
||||
user-specified patterns */
|
||||
debug(D_VIDEO,
|
||||
"Tried to load and activate user defined font\n");
|
||||
break;
|
||||
case 0x11:
|
||||
case 0x11: /* Text-mode chargen: load and activate ROM
|
||||
monochrome patterns */
|
||||
debug(D_VIDEO,
|
||||
"Tried to load and activate 8x14 font.\n");
|
||||
break;
|
||||
case 0x12:
|
||||
case 0x12: /* Text-mode chargen: load and activate ROM
|
||||
8x8 double-dot patterns */
|
||||
debug(D_VIDEO,
|
||||
"Tried to load and activate 8x8 font.\n");
|
||||
break;
|
||||
case 0x14:
|
||||
case 0x14: /* Text-mode chargen: load and activate ROM
|
||||
8x16 character set */
|
||||
debug(D_VIDEO,
|
||||
"Tried to load and activate 8x16 font.\n");
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x20: /* Graph-mode chargen: set user 8x8 graphics
|
||||
characters */
|
||||
debug(D_VIDEO, "Load second half of 8x8 char set\n");
|
||||
break;
|
||||
case 0x21:
|
||||
case 0x21: /* Graph-mode chargen: set user graphics
|
||||
characters */
|
||||
debug(D_VIDEO, "Install user defined char set\n");
|
||||
break;
|
||||
case 0x22:
|
||||
case 0x22: /* Graph-mode chargen: set ROM 8x14 graphics
|
||||
chars */
|
||||
debug(D_VIDEO, "Install 8x14 char set\n");
|
||||
break;
|
||||
case 0x23:
|
||||
case 0x23: /* Graph-mode chargen: set ROM 8x8 double-dot
|
||||
chars */
|
||||
debug(D_VIDEO, "Install 8x8 char set\n");
|
||||
break;
|
||||
case 0x24:
|
||||
case 0x24: /* Graph-mode chargen: load 8x16 graphics
|
||||
chars */
|
||||
debug(D_VIDEO, "Install 8x16 char set\n");
|
||||
break;
|
||||
case 0x30:
|
||||
case 0x30: /* Get font information */
|
||||
debug(D_VIDEO,
|
||||
"INT 10 11:30 Request font address %02x\n", R_BH);
|
||||
R_CX = CharHeight;
|
||||
R_DL = DpyRows;
|
||||
switch(R_BH) {
|
||||
@ -320,9 +335,6 @@ int10(regcontext_t *REGS)
|
||||
case 7:
|
||||
R_ES = 0;
|
||||
R_BP = 0;
|
||||
debug(D_VIDEO,
|
||||
"INT 10 11:30 Request font address %02x",
|
||||
R_BH);
|
||||
break;
|
||||
default:
|
||||
unknown_int4(0x10, 0x11, 0x30, R_BH, REGS);
|
||||
@ -334,7 +346,7 @@ int10(regcontext_t *REGS)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x12: /* Load multiple DAC color register */
|
||||
case 0x12: /* Alternate function select */
|
||||
if (!xmode)
|
||||
goto unsupported;
|
||||
switch (R_BL) {
|
||||
@ -406,9 +418,13 @@ int10(regcontext_t *REGS)
|
||||
}
|
||||
break;
|
||||
case 0x1c: /* Save/Restore video state */
|
||||
debug(D_VIDEO, "Save/restore video state\n");
|
||||
debug(D_VIDEO, "VGA: Save/restore video state\n");
|
||||
R_AL = 0;
|
||||
break;
|
||||
case 0x30: /* Locate 3270PC configuration table */
|
||||
R_CX = 0;
|
||||
R_DX = 0;
|
||||
break;
|
||||
case 0x4f: /* get VESA information */
|
||||
R_AH = 0x01; /* no VESA support */
|
||||
break;
|
||||
|
@ -114,13 +114,20 @@ static u_long htable = 0xF1020; /* Hard disk table */
|
||||
static struct diskinfo diskinfo[26];
|
||||
|
||||
static struct diskinfo floppyinfo[] = {
|
||||
{ 0, 9, 40, 1, 512, -1, 0, 0, }, /* Probably not correct */
|
||||
{ 1, 9, 40, 2, 512, -1, 0, 0, },
|
||||
{ 2, 9, 80, 2, 512, -1, 0, 0, },
|
||||
{ 3, 15, 80, 2, 512, -1, 0, 0, },
|
||||
{ 4, 18, 80, 2, 512, -1, 0, 0, },
|
||||
{ 6, 36, 80, 2, 512, -1, 0, 0, },
|
||||
{ -1, 0, 0, 0, 0, 0, 0, 0, },
|
||||
{0, 9, 40, 1, 512, -1, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0}, /* Probably not correct */
|
||||
{1, 9, 40, 2, 512, -1, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0},
|
||||
{2, 9, 80, 2, 512, -1, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0},
|
||||
{3, 15, 80, 2, 512, -1, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0},
|
||||
{4, 18, 80, 2, 512, -1, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0},
|
||||
{6, 36, 80, 2, 512, -1, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0},
|
||||
{-1, 0, 0, 0, 0, 0, NULL, 0, NULL, 0,
|
||||
{NULL, NULL, NULL, NULL}, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static struct diskinfo *
|
||||
|
@ -60,9 +60,9 @@ timer_init(void)
|
||||
(((tm.tm_hour * 60 + tm.tm_min) * 60) + tm.tm_sec) * 182 / 10;
|
||||
|
||||
itv.it_interval.tv_sec = 0;
|
||||
itv.it_interval.tv_usec = 54925; /* 1193182/65536 times per second */
|
||||
itv.it_interval.tv_usec = 54925; /* 1193182/65536 times per second */
|
||||
itv.it_value.tv_sec = 0;
|
||||
itv.it_value.tv_usec = 54925; /* 1193182/65536 times per second */
|
||||
itv.it_value.tv_usec = 54925; /* 1193182/65536 times per second */
|
||||
if (! timer_disable)
|
||||
setitimer(ITIMER_REAL, &itv, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user