static void
try_boot(u16 seq_nr)
{
+ if (! CONFIG_BOOT)
+ BX_PANIC("Boot support not compiled in.\n");
+
SET_EBDA(ipl.sequence, seq_nr);
u32 bootdev = GET_EBDA(ipl.bootorder);
// Send debugging information to serial port
#define CONFIG_DEBUG_SERIAL 0
+// Support for int13 floppy drive access
#define CONFIG_FLOPPY_SUPPORT 1
+// Support for int15c2 mouse calls
#define CONFIG_PS2_MOUSE 1
+// Support for IDE disk code
#define CONFIG_ATA 1
+// Support calling int155f on each keyboard press
#define CONFIG_KBD_CALL_INT15_4F 1
// Support for booting from a CD
#define CONFIG_CDROM_BOOT 1
#define CONFIG_PCIBIOS 1
// Support int 15/53 APM BIOS calls
#define CONFIG_APMBIOS 1
+// Support int 19/18 system bootup support
+#define CONFIG_BOOT 1
+// Support int 14 parallel port calls
+#define CONFIG_SERIAL 1
+// Support int 17 parallel port calls
+#define CONFIG_LPT 1
+// Support int 16 keyboard calls
+#define CONFIG_KEYBOARD 1
+// Support an interactive boot menu at end of post.
+#define CONFIG_BOOTMENU 1
// Support generation of a PIR table in 0xf000 segment (for emulators)
#define CONFIG_PIRTABLE 1
#define CONFIG_MPTABLE 1
// Support generation of ACPI tables (for emulators)
#define CONFIG_ACPI 1
+// Support bios callbacks specific to via vgabios.
+#define CONFIG_VGAHOOKS 1
/* define it if the (emulated) hardware supports SMM mode */
#define CONFIG_USE_SMM 1
// Since no provisions are made for multiple drive types, most
// values in this table are ignored. I set parameters for 1.44M
// floppy here
+#if MODE16 == 1
struct floppy_ext_dbt_s diskette_param_table2 VISIBLE16 = {
.dbt = {
.specify1 = 0xAF,
.data_rate = 0, // data transfer rate
.drive_type = 4, // drive type in cmos
};
+#endif
void
floppy_drive_setup()
handle_0e()
{
debug_isr(DEBUG_ISR_0e);
+ if (! CONFIG_FLOPPY_SUPPORT)
+ goto done;
+
if ((inb(PORT_FD_STATUS) & 0xc0) != 0xc0) {
outb(0x08, PORT_FD_DATA); // sense interrupt status
while ((inb(PORT_FD_STATUS) & 0xc0) != 0xc0)
inb(PORT_FD_DATA);
} while ((inb(PORT_FD_STATUS) & 0xc0) == 0xc0);
}
- eoi_pic1();
// diskette interrupt has occurred
SETBITS_BDA(floppy_recalibration_status, FRS_TIMEOUT);
+
+done:
+ eoi_pic1();
}
// Called from int08 handler.
void
floppy_tick()
{
+ if (! CONFIG_FLOPPY_SUPPORT)
+ return;
+
// time to turn off drive(s)?
u8 fcount = GET_BDA(floppy_motor_counter);
if (fcount) {
SET_BDA(kbd_buf_end_offset
, x + FIELD_SIZEOF(struct bios_data_area_s, kbd_buf));
+ if (! CONFIG_KEYBOARD)
+ return;
+
keyboard_init();
// Enable IRQ1 (handle_09)
handle_16(struct bregs *regs)
{
debug_enter(regs, DEBUG_HDL_16);
+ if (! CONFIG_KEYBOARD)
+ return;
irq_enable();
handle_09()
{
debug_isr(DEBUG_ISR_09);
+ if (! CONFIG_KEYBOARD)
+ goto done;
// read key from keyboard controller
u8 v = inb(PORT_PS2_STATUS);
handle_74()
{
debug_isr(DEBUG_ISR_74);
+ if (! CONFIG_PS2_MOUSE)
+ goto done;
irq_enable();
int74_function();
irq_disable();
+done:
eoi_pic2();
}
static void
init_boot_vectors()
{
+ if (! CONFIG_BOOT)
+ return;
dprintf(3, "init boot device ordering\n");
// Floppy drive
// Found a device that thinks it can boot the system. Record
// its BEV and product name string.
+ if (! CONFIG_BOOT)
+ continue;
+
if (ebda->ipl.count >= ARRAY_SIZE(ebda->ipl.table))
continue;
void
interactive_bootmenu()
{
+ if (! CONFIG_BOOTMENU)
+ return;
+
while (check_for_keystroke())
get_keystroke();
void
serial_setup()
{
+ if (! CONFIG_SERIAL)
+ return;
dprintf(3, "init serial\n");
+
u16 count = 0;
count += detect_serial(0x3f8, 0x0a, count);
count += detect_serial(0x2f8, 0x0a, count);
handle_14(struct bregs *regs)
{
debug_enter(regs, DEBUG_HDL_14);
+ if (! CONFIG_SERIAL) {
+ handle_14XX(regs);
+ return;
+ }
irq_enable();
void
lpt_setup()
{
+ if (! CONFIG_LPT)
+ return;
dprintf(3, "init lpt\n");
+
u16 count = 0;
count += detect_parport(0x378, 0x14, count);
count += detect_parport(0x278, 0x14, count);
handle_17(struct bregs *regs)
{
debug_enter(regs, DEBUG_HDL_17);
+ if (! CONFIG_LPT) {
+ handle_17XX(regs);
+ return;
+ }
irq_enable();
#include "config.h" // CONFIG_*
#include "ioport.h" // outb
+#if CONFIG_USE_SMM
asm(
".global smm_relocation_start\n"
".global smm_relocation_end\n"
"smm_code_end:\n"
" .code32\n"
);
+#endif
extern u8 smm_relocation_start, smm_relocation_end;
extern u8 smm_code_start, smm_code_end;